138851 Commits

Author SHA1 Message Date
Zachary Turner
9f072db19b Add a comment on StringRef::contains(char)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-25 04:06:39 +00:00
Zachary Turner
3ae26e9375 Fix signed / unsigned comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-25 03:57:34 +00:00
Zachary Turner
568a8f4a4d Add some predicated searching functions to StringRef.
This adds 4 new functions to StringRef, which can be used to
take or drop characters while a certain condition is met, or
until a certain condition is met.  They are:

take_while - Return characters until a condition is not met.
take_until - Return characters until a condition is met.
drop_while - Remove characters until a condition is not met.
drop_until - Remove characters until a condition is met.

Internally, all of these functions delegate to two additional
helper functions which can be used to search for the position
of a character meeting or not meeting a condition, which are:

find_if - Find the first character matching a predicate.
find_if_not - Find the first character not matching a predicate.

Differential Revision: https://reviews.llvm.org/D24842

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-25 03:27:29 +00:00
Craig Topper
386ab19245 [AVX-512] Don't use two opcodes for INTR_TYPE_SCALAR_MASK_RM. The handling was such that if the second opcode was present the first was ingored, so we can just have one opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-25 01:03:10 +00:00
Craig Topper
6928dfadcd [X86] Teach combineShuffle to avoid creating floating point operations with integer types and integer operations with floating point types. Seems isOperationLegal lies for mismatched types and operations.
Fixes PR30511.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 21:42:49 +00:00
Craig Topper
1e23cc89e7 [AVX-512] Split scalar version of X86ISD::SELECT into a separate opcode because isel is not robust with multiple type profiles for the same opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 21:42:47 +00:00
Craig Topper
9ca28eca4f [AVX-512] Remove the patterns for selecting scalar VCOMI/VUCOMI instructions with SAE as there is no way to create the pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 21:42:43 +00:00
Duncan P. N. Exon Smith
affe79938b ObjCARC: Don't look at users of ConstantData
Stop looking at users of UndefValue and ConstantPointerNull in the
objective C ARC optimizers.  The other users aren't actually
interesting, since they're not pointing at a particular object.  I
imagine these calls could be optimized through -instcombine... maybe
they already are?

These early returns will be required at some point in the future, with a
WIP patch that asserts when someone accesses a use-list on ConstantData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 21:01:20 +00:00
Duncan P. N. Exon Smith
5cb2954160 Analysis: Return early for UndefValue in computeKnownBits
There is no benefit in looking through assumptions on UndefValue to
guess known bits.  Return early to avoid walking their use-lists, and
assert that all instances of ConstantData are handled here for similar
reasons (UndefValue was the only integer/pointer holdout).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 20:42:02 +00:00
Sanjay Patel
c7ebf69800 [x86] don't try to create a vector integer inst for an SSE1 target (PR30512)
This bug was introduced with:
http://reviews.llvm.org/rL272511

We need to restrict the lowering to v4f32 comparisons because that's all SSE1 can handle.

This should fix:
https://llvm.org/bugs/show_bug.cgi?id=28044



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 20:24:06 +00:00
Duncan P. N. Exon Smith
3a296bc80d Scalar: Ignore ConstantData in processAssumption
Assumptions on UndefValue and ConstantPointerNull aren't relevant to
other users.  Ignore them entirely to avoid wasting cycles walking
through their (possibly extremely extensive (cross-module)) use-lists.

It wasn't clear how to add a specific test for this, and it'll be
covered anyway by an eventual patch that asserts when trying to access
the use-list of an instance of ConstantData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 20:00:38 +00:00
Duncan P. N. Exon Smith
e31ddb4329 Analysis: Return early in isKnownNonNullAt for ConstantData
Check and return early for ConstantPointerNull and UndefValue
specifically in isKnownNonNullAt, and assert that ConstantData never
make it to isKnownNonNullFromDominatingCondition.

This confirms that isKnownNonNullFromDominatingCondition never walks
through the use-list of an instance of ConstantData.  Given that such
use-lists cross module boundaries, it never really made sense to do so,
and was potentially very expensive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 19:39:47 +00:00
Dylan McKay
2e99ba25d5 [AVR] Update signature of AVRTargetObjectFile::SelectSectionForGlobal
It was changed recently, and was breaking compilation of the backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 11:38:08 +00:00
Quentin Colombet
9b473140dd [RegisterBankInfo] Constify the member of the XXXMapping maps.
This makes it obvious that items in those maps behave like statically
created objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 04:54:03 +00:00
Quentin Colombet
ab46f81198 [RegisterBankInfo] Document the design choice for the BreakDown.
This adds a comment explaining why we will duplicate PartialMapping to
represent the breakdown for complex mappings (mappings with more than
one partial mapping), instead of using an array of pointer.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 04:53:58 +00:00
Quentin Colombet
d1ab103882 [RegisterBankInfo] Add statistics for dynamic value mappings.
Like partial mappings, as we move toward TableGen'ed information, the
number should reach zero eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 04:53:55 +00:00
Quentin Colombet
9545266289 [RegisterBankInfo] Uniquely generate ValueMapping.
This is a step toward statically allocate ValueMapping. Like the
previous few commits, the goal is to move toward a TableGen'ed like
structure with no dynamic allocation at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 04:53:52 +00:00
Quentin Colombet
245edb6c14 [RegisterBankInfo] Keep valid pointers for PartialMappings.
Previously we were using the address of the unique instance of a partial
mapping in the related map to access this instance. However, when the
map grows, the whole set of instances may be moved elsewhere and the
previous addresses are not valid anymore.

Instead, keep the address of the unique heap allocated instance of a
partial mapping.

Note: I did not see any actual bugs for that problem as the number of
partial mappings dynamically allocated is small (<= 4).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 04:53:48 +00:00
Kostya Serebryany
ec25365d1b [libFuzzer] add a standalone build script
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 04:00:00 +00:00
Duncan P. N. Exon Smith
c1ce9acb64 GlobalStatus: Don't walk use-lists of ConstantData
Return early from llvm::isSafeToDestroyConstant() whenever the value
`isa<ConstantData>()`.  These constants are shared across the
LLVMContext.  We never really want to delete them here, and walking
their use-lists can be very expensive.

(This is motivated by an eventual goal of removing use-lists entirely
from ConstantData.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-24 02:30:11 +00:00
Kostya Serebryany
e2e54904b7 [libFuzzer] simplify HandleTrace again, start re-running interesting units and collecting their features.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 23:51:58 +00:00
Peter Collingbourne
9194bd40e5 Add qualification to fix MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 23:23:23 +00:00
Sanjay Patel
e86f70292b [x86] fix FCOPYSIGN lowering to create constants instead of ConstantPool loads
This is similar to:
https://reviews.llvm.org/rL279958

By not prematurely lowering to loads, we should be able to more easily eliminate
the 'or' with zero instructions seen in copysign-constant-magnitude.ll.

We should also be able to extend this code to handle vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 23:17:29 +00:00
Rui Ueyama
200a529492 Add StringSwitch::Cases functions that takes 6 to 10 arguments.
Differential Revision: https://reviews.llvm.org/D24882

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 22:10:06 +00:00
Petr Hosek
2a09485a4b [MC] Support .ds directives in assembler parser
These directives are already supported by GNU assembler.

Differential Revision: https://reviews.llvm.org/D24740

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 21:53:36 +00:00
Matthias Braun
a92ff23987 llc: Add -start-before/-stop-before options
Differential Revision: https://reviews.llvm.org/D23089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282302 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 21:46:02 +00:00
Peter Collingbourne
91d99c6edf LTO: Simplify caching interface.
The NativeObjectOutput class has a design problem: it mixes up the caching
policy with the interface for output streams, which makes the client-side
code hard to follow and would for example make it harder to replace the
cache implementation in an arbitrary client.

This change separates the two aspects by moving the caching policy
to a separate field in Config, replacing NativeObjectOutput with a
NativeObjectStream class which only deals with streams and does not need to
be overridden by most clients and introducing an AddFile callback for adding
files (e.g. from the cache) to the link.

Differential Revision: https://reviews.llvm.org/D24622

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 21:33:43 +00:00
Valery Pykhtin
dc7e3f0651 [AMDGPU] Fix for bz30427: wrong MTBUF encoding on VI
Differential revision: https://reviews.llvm.org/D24875

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 21:21:21 +00:00
Kostya Serebryany
b5dbd9f60f [libFuzzer] first steps in adding a proper automated test suite based on real-life code: add a script to build RE2 at a revision that has known bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 20:43:22 +00:00
Teresa Johnson
468ae9f703 [gold] Split plugin options controlling ThinLTO and codegen parallelism.
Summary:
As suggested in D24826, use different options for ThinLTO backend
parallelism from the option controlling regular LTO code gen
parallelism. They are already split in the LTO API, and this enables
controlling them with different clang options.

Reviewers: pcc, mehdi_amini

Subscribers: dexonsmith, llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D24873

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 20:35:19 +00:00
Vedant Kumar
5438741694 [Coverage] Clarify a function contract (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 20:13:44 +00:00
Vedant Kumar
3de4fb3563 [llvm-cov] Factor out logic to remove unmapped inputs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 20:13:41 +00:00
Kostya Serebryany
a6754db00d [libFuzzer] reset Counters (trace-pc-guard) before every run
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 20:04:13 +00:00
Petr Hosek
85fa8188e0 [MC] Support .dcb directives in assembler parser
These directives are already supported by GNU assembler.

Differential Revision: https://reviews.llvm.org/D24741

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 19:25:15 +00:00
Vedant Kumar
daacf3c8ba [llvm-cov] Filter away source files that aren't in the coverage mapping
... so that they don't show up in the index. This came up because polly
contains a .git directory and some other unmapped input in its source
dir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:35 +00:00
Vedant Kumar
fd066351a5 [llvm-cov] Get rid of all invalid filename references
We used to append filenames into a vector of std::string, and then
append a reference to each string into a separate vector. This made it
easier to work with the getUniqueSourceFiles API. But it's buggy.

std::string has a small-string optimization, so you can't expect to
capture a reference to one if you're copying it into a growing vector.
Add a test that triggers this invalid reference to std::string scenario,
and kill the issue with fire by just using ArrayRef<std::string>
everywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:32 +00:00
Vedant Kumar
c36f315edc [llvm-cov] Minor cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:27 +00:00
Sanjay Patel
c5ddf50801 [TLI] isdigit / isascii / toascii param type should match return type (PR30484)
We crash in LibCallSimplifier if we don't check the validity of the function signature properly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:44:09 +00:00
Quentin Colombet
f8e3a5168e [ResetMachineFunction] Populate the comments in the header of the file.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282276 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:38:15 +00:00
Quentin Colombet
76cc1a9a56 [ResetMachineFunction] Add statistic on the number of reset functions.
As the development of GlobalISel move forward, this statistic should
strictly decrease until it reaches zero. At this point, it would mean
GlobalISel can replace SDISel (at least on the tested inputs :P).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:38:13 +00:00
Quentin Colombet
c81278e2a4 [RegisterBankInfo] Add statistics for dynamic partial mappings.
Collect statistics about the number of partial mappings dynamically
allocated and accessed. Ultimately, when the whole TableGen
infrastructure is set, those numbers should be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:38:06 +00:00
Matthias Braun
abd02b3ad6 ScheduleDAG: Match enum names when printing sdep kinds
It is less confusing to have the same names in the debug print as the
enum members.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:28:31 +00:00
Peter Collingbourne
5c7b0b134a BitcodeReader: Deduplicate code. NFC.
Differential Revision: https://reviews.llvm.org/D24852

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:27:42 +00:00
Quentin Colombet
4151a976fe [RegBankSelect] Use DEBUG_TYPE instead of repeating the name of the pass
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 17:50:06 +00:00
Quentin Colombet
f8d0897068 [RegisterBank] Mark the dump method with LLVM_DUMP_METHOD.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 17:50:03 +00:00
Jun Bum Lim
32ed609373 Enhance calcColdCallHeuristics for InvokeInst
Summary: When identifying cold blocks, consider only the edge to the normal destination if the terminator is InvokeInst and let calcInvokeHeuristics() decide edge weights for the InvokeInst.

Reviewers: mcrosier, hfinkel, davidxl

Subscribers: mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D24868

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 17:26:14 +00:00
James Molloy
3b62127542 Revert "[ARM] Promote small global constants to constant pools"
This reverts commit r282241. It caused http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/19882.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 13:35:43 +00:00
Nemanja Ivanovic
a04f9019ef [Power9] Exploit move and splat instructions for build_vector improvement
This patch corresponds to review:
https://reviews.llvm.org/D21135

This patch exploits the following instructions:
mtvsrws
lxvwsx
mtvsrdd
mfvsrld

In order to improve some build_vector and extractelement patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 13:25:31 +00:00
James Molloy
e2c1cbe138 [ARM] Promote small global constants to constant pools
If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:

      ldr r0, .CPI0
      bl printf
      bx lr
    .CPI0: &format_string
    format_string: .asciz "hello, world!\n"

We can emit:

      adr r0, .CPI0
      bl printf
      bx lr
    .CPI0: .asciz "hello, world!\n"

This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).

This recommit contains fixes for a nasty bug related to fast-isel fallback - because
fast-isel doesn't know about this optimization, if it runs and emits references to
a string that we inline (because fast-isel fell back to SDAG) we will end up
with an inlined string and also an out-of-line string, and we won't emit the
out-of-line string, causing backend failures.

It also contains fixes for emitting .text relocations which made the sanitizer
bots unhappy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 12:15:58 +00:00
Michal Gorny
91fdd2b663 cmake: Support overriding Sphinx HTML doc install directory
Provide ${PROJECT}_INSTALL_SPHINX_HTML_DIR variables (e.g.
LLVM_INSTALL_SPHINX_HTML_DIR) to override Sphinx HTML doc install
directory.

Bug: https://llvm.org/bugs/show_bug.cgi?id=23780

Differential Revision: https://reviews.llvm.org/D23757

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 11:09:33 +00:00