OSDN Git Service
Gor Nishanov [Mon, 26 Sep 2016 15:49:28 +0000 (15:49 +0000)]
[Coroutines] Part14: Handle coroutines with no suspend points.
Summary:
If coroutine has no suspend points, remove heap allocation and turn a coroutine into a normal function.
Also, if a pattern is detected that coroutine resumes or destroys itself prior to coro.suspend call, turn the suspend point into a simple jump to resume or cleanup label. This pattern occurs when coroutines are used to propagate errors in functions that return expected<T>.
Reviewers: majnemer
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D24408
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282414
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Mon, 26 Sep 2016 15:34:47 +0000 (15:34 +0000)]
[AArch64] Improve add/sub/cmp isel of uxtw forms.
Don't match the UXTW extended reg forms of ADD/ADDS/SUB/SUBS if the
32-bit to 64-bit zero-extend can be done for free by taking advantage
of the 32-bit defining instruction zeroing the upper 32-bits of the X
register destination. This enables better instruction selection in a
few cases, such as:
sub x0, xzr, x8
instead of:
mov x8, xzr
sub x0, x8, w9, uxtw
madd x0, x1, x1, x8
instead of:
mul x9, x1, x1
add x0, x9, w8, uxtw
cmp x2, x8
instead of:
sub x8, x2, w8, uxtw
cmp x8, #0
add x0, x8, x1, lsl #3
instead of:
lsl x9, x1, #3
add x0, x9, w8, uxtw
Reviewers: t.p.northover, jmolloy
Subscribers: mcrosier, aemerson, llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D24747
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282413
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Mon, 26 Sep 2016 15:32:33 +0000 (15:32 +0000)]
Add support to optionally limit the size of jump tables.
Many high-performance processors have a dedicated branch predictor for
indirect branches, commonly used with jump tables. As sophisticated as such
branch predictors are, they tend to have well defined limits beyond which
their effectiveness is hampered or even nullified. One such limit is the
number of possible destinations for a given indirect branches that such
branch predictors can handle.
This patch considers a limit that a target may set to the number of
destination addresses in a jump table.
Patch by: Evandro Menezes <e.menezes@samsung.com>, Aditya Kumar
<aditya.k7@samsung.com>, Sebastian Pop <s.pop@samsung.com>.
Differential revision: https://reviews.llvm.org/D21940
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282412
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Mon, 26 Sep 2016 13:18:59 +0000 (13:18 +0000)]
[InstCombine] Fixed bug introduced in r282237
The index of the new insertelement instruction was evaluated in the
wrong way, it was considered as the index of the inserted value instead
of index of the position, where the value should be inserted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282401
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 26 Sep 2016 12:38:03 +0000 (12:38 +0000)]
Fix typo in comment, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282399
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Mon, 26 Sep 2016 12:07:23 +0000 (12:07 +0000)]
[InstCombine] Teach the udiv folding logic how to handle constant expressions.
This patch fixes PR30366.
Function foldUDivShl() worked under the assumption that one of the values
in input to the function was always an instance of llvm::Instruction.
However, function visitUDivOperand() (the only user of foldUDivShl) was
clearly violating that precondition; internally, visitUDivOperand() uses pattern
matches to check the operands of a udiv. Pattern matchers for binary operators
know how to handle both Instruction and ConstantExpr values.
This patch fixes the problem in foldUDivShl(). Now we use pattern matchers
instead of explicit casts to Instruction. The reduced test case from PR30366
has been added to test file InstCombine/udiv-simplify.ll.
Differential Revision: https://reviews.llvm.org/D24565
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282398
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Mon, 26 Sep 2016 11:35:32 +0000 (11:35 +0000)]
[AVR] Add AVRMCExpr
Summary: This adds the AVRMCExpr headers and implementation.
Reviewers: arsenm, ruiu, grosbach, kparzysz
Subscribers: wdng, beanz, mgorny, kparzysz, jtbandes, llvm-commits
Differential Revision: https://reviews.llvm.org/D20503
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282397
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Kolton [Mon, 26 Sep 2016 11:29:03 +0000 (11:29 +0000)]
Revert "[AMDGPU] Disassembler: print label names in branch instructions"
This reverts commit
6c6dbe625263ec9fcf8de0df27263cf147cde550.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282396
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Kolton [Mon, 26 Sep 2016 10:05:50 +0000 (10:05 +0000)]
[AMDGPU] Disassembler: print label names in branch instructions
Summary: Add AMDGPUSymbolizer for finding names for labels from ELF symbol table.
Reviewers: vpykhtin, artem.tamazov, tstellarAMD
Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye
Differential Revision: https://reviews.llvm.org/D24802
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282394
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Mon, 26 Sep 2016 07:26:24 +0000 (07:26 +0000)]
[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@282387
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Mon, 26 Sep 2016 06:42:07 +0000 (06:42 +0000)]
[X86] Optimization for replacing LEA with MOV at frame index elimination time
Summary:
Replace a LEA instruction of the form 'lea (%esp), %ebx' --> 'mov %esp, %ebx'
MOV is preferable over LEA because usually there are more issue-slots available to execute MOVs than LEAs. Latest processors also support zero-latency MOVs.
Fixes pr29022.
Reviewers: hfinkel, delena, igorb, myatsina, mkuper
Differential Revision: https://reviews.llvm.org/D24705
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282385
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 26 Sep 2016 06:29:21 +0000 (06:29 +0000)]
[PM] Refactor this unittest a bit to remove duplicated code. This was
suggested at one point during code review and I deferred it to
a follow-up commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282383
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayman Musa [Mon, 26 Sep 2016 06:22:08 +0000 (06:22 +0000)]
[X86][avx512] Fix bug in masked compress store.
Differential Revision: https://reviews.llvm.org/D23984
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282381
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 26 Sep 2016 04:49:58 +0000 (04:49 +0000)]
[SCEV] Fix the order of members in the initializer list.
Noticed due to the warning on this line. Sanjoy is on
a less-than-awesome internet connection, so committing on his behalf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282380
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 26 Sep 2016 04:17:12 +0000 (04:17 +0000)]
[PM] Add a unittest covering the invalidation of a Module analysis from
a function pass nested inside of a CGSCC pass manager.
This is very similar to the previous unittest but makes sure the
invalidation logic works across all the layers here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282378
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 26 Sep 2016 04:01:55 +0000 (04:01 +0000)]
[PM] Add a unittest for invalidating module analyses with an SCC pass.
This reinstates r280447. Original commit log:
This wasn't really well explicitly tested with a nice unittest before.
It seems good to have reasonably broken out unittests for this kind of
functionality as I'm workin go other invalidation features to make sure
none of the existing ones regress.
This still has too much duplicated code, I plan to factor that out in
a subsequent commit to use common helpers for repeated parts of this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282377
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 02:44:10 +0000 (02:44 +0000)]
[SCEV] Assign LoopPropertiesCache in the move constructor
In a previous change I collapsed two different caches into one. When
doing that I noticed that ScalarEvolution's move constructor was not
moving those caches.
To keep the previous change simple, I've moved that bugfix into this
separate change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282376
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 02:44:07 +0000 (02:44 +0000)]
[SCEV] Combine two predicates into one; NFC
Both `loopHasNoSideEffects` and `loopHasNoAbnormalExits` involve walking
the loop and maintaining similar sorts of caches. This commit changes
SCEV to compute both the predicates via a single walk, and maintain a
single cache instead of two.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282375
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 01:10:27 +0000 (01:10 +0000)]
[SCEV] Make it obvious BackedgeTakenInfo's constructor steals storage
Specifically, it moves SCEVUnionPredicates from its input into its own
storage. Make this obvious at the type level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282374
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 01:10:25 +0000 (01:10 +0000)]
[SCEV] Further isolate incidental data structure; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282373
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 01:10:22 +0000 (01:10 +0000)]
[SCEV] Simplify BackedgeTakenInfo::getMax; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282372
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 00:22:18 +0000 (00:22 +0000)]
Appease MSVC
... by not default move constructors and operator= s. Defaulting these
works in clang, but not in MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282370
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 26 Sep 2016 00:00:51 +0000 (00:00 +0000)]
Attempt to appease MSVC
... by explicitly deleting the copy constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282369
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:12:08 +0000 (23:12 +0000)]
[SCEV] Reserve space in SmallVector; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282368
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:12:06 +0000 (23:12 +0000)]
[SCEV] Document a gotcha; NFC
We should re-consider the design decision that led to this gotcah, but
for now just document it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282367
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:12:04 +0000 (23:12 +0000)]
[SCEV] Have ExitNotTakenInfo keep a pointer to its predicate; NFC
SCEVUnionPredicate is a "heavyweight" structure, so it is beneficial to
store the (optional) data out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282366
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:12:00 +0000 (23:12 +0000)]
[SCEV] Simplify tracking ExitNotTakenInfo instances; NFC
This change simplifies a data structure optimization in the
`BackedgeTakenInfo` class for loops with exactly one computable exit.
I've sanity checked that this does not regress compile time performance,
using sqlite3's amalgamated build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282365
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:11:57 +0000 (23:11 +0000)]
[SCEV] Rename a couple of fields; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282364
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:11:55 +0000 (23:11 +0000)]
[SCEV] Remove incidental data structure; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282363
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Sep 2016 23:11:51 +0000 (23:11 +0000)]
[SCEV] Clang format most of the SCEV header; NFC
The indentation for the declared classes was not as per LLVM coding
style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282362
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:34:11 +0000 (16:34 +0000)]
[X86] Remove what appears to be leftover MMX code involving (v1i64 scalar_to_vector).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282361
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:34:09 +0000 (16:34 +0000)]
[X86] Remove patterns for scalar_to_vector from FR32/FR64 to 256-bit vectors. Lowering explicitly avoids creating this pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282360
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:34:06 +0000 (16:34 +0000)]
[AVX-512] Replace get512BitSuperRegister with calls to TargetRegisterInfo::getMatchingSuperReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282359
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:34:02 +0000 (16:34 +0000)]
[AVX-512] Fix some patterns predicates to properly enforce priority for various versions of CVTDQ2PD instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282358
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:33:59 +0000 (16:33 +0000)]
[AVX-512] Add rounding versions of instructions to hasUndefRegUpdate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282357
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:33:57 +0000 (16:33 +0000)]
[AVX-512] Add the scalar unsigned integer to fp conversion instructions to hasUndefRegUpdate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282356
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Sep 2016 16:33:53 +0000 (16:33 +0000)]
[AVX-512] Remove duplicate instructions for converting integer to scalar floating point. We can use patterns to point to the other instructions instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282355
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 25 Sep 2016 04:06:39 +0000 (04:06 +0000)]
Add a comment on StringRef::contains(char)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282350
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 25 Sep 2016 03:57:34 +0000 (03:57 +0000)]
Fix signed / unsigned comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282348
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 25 Sep 2016 03:27:29 +0000 (03:27 +0000)]
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
Craig Topper [Sun, 25 Sep 2016 01:03:10 +0000 (01:03 +0000)]
[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
Craig Topper [Sat, 24 Sep 2016 21:42:49 +0000 (21:42 +0000)]
[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
Craig Topper [Sat, 24 Sep 2016 21:42:47 +0000 (21:42 +0000)]
[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
Craig Topper [Sat, 24 Sep 2016 21:42:43 +0000 (21:42 +0000)]
[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
Duncan P. N. Exon Smith [Sat, 24 Sep 2016 21:01:20 +0000 (21:01 +0000)]
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
Duncan P. N. Exon Smith [Sat, 24 Sep 2016 20:42:02 +0000 (20:42 +0000)]
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
Sanjay Patel [Sat, 24 Sep 2016 20:24:06 +0000 (20:24 +0000)]
[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
Duncan P. N. Exon Smith [Sat, 24 Sep 2016 20:00:38 +0000 (20:00 +0000)]
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
Duncan P. N. Exon Smith [Sat, 24 Sep 2016 19:39:47 +0000 (19:39 +0000)]
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
Dylan McKay [Sat, 24 Sep 2016 11:38:08 +0000 (11:38 +0000)]
[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
Quentin Colombet [Sat, 24 Sep 2016 04:54:03 +0000 (04:54 +0000)]
[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
Quentin Colombet [Sat, 24 Sep 2016 04:53:58 +0000 (04:53 +0000)]
[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
Quentin Colombet [Sat, 24 Sep 2016 04:53:55 +0000 (04:53 +0000)]
[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
Quentin Colombet [Sat, 24 Sep 2016 04:53:52 +0000 (04:53 +0000)]
[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
Quentin Colombet [Sat, 24 Sep 2016 04:53:48 +0000 (04:53 +0000)]
[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
Kostya Serebryany [Sat, 24 Sep 2016 04:00:00 +0000 (04:00 +0000)]
[libFuzzer] add a standalone build script
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282321
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 24 Sep 2016 02:30:11 +0000 (02:30 +0000)]
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
Kostya Serebryany [Fri, 23 Sep 2016 23:51:58 +0000 (23:51 +0000)]
[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
Peter Collingbourne [Fri, 23 Sep 2016 23:23:23 +0000 (23:23 +0000)]
Add qualification to fix MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282313
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 23 Sep 2016 23:17:29 +0000 (23:17 +0000)]
[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
Rui Ueyama [Fri, 23 Sep 2016 22:10:06 +0000 (22:10 +0000)]
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
Petr Hosek [Fri, 23 Sep 2016 21:53:36 +0000 (21:53 +0000)]
[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
Matthias Braun [Fri, 23 Sep 2016 21:46:02 +0000 (21:46 +0000)]
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
Peter Collingbourne [Fri, 23 Sep 2016 21:33:43 +0000 (21:33 +0000)]
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
Valery Pykhtin [Fri, 23 Sep 2016 21:21:21 +0000 (21:21 +0000)]
[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
Kostya Serebryany [Fri, 23 Sep 2016 20:43:22 +0000 (20:43 +0000)]
[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
Teresa Johnson [Fri, 23 Sep 2016 20:35:19 +0000 (20:35 +0000)]
[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
Vedant Kumar [Fri, 23 Sep 2016 20:13:44 +0000 (20:13 +0000)]
[Coverage] Clarify a function contract (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282287
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Fri, 23 Sep 2016 20:13:41 +0000 (20:13 +0000)]
[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
Kostya Serebryany [Fri, 23 Sep 2016 20:04:13 +0000 (20:04 +0000)]
[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
Petr Hosek [Fri, 23 Sep 2016 19:25:15 +0000 (19:25 +0000)]
[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
Vedant Kumar [Fri, 23 Sep 2016 18:57:35 +0000 (18:57 +0000)]
[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
Vedant Kumar [Fri, 23 Sep 2016 18:57:32 +0000 (18:57 +0000)]
[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
Vedant Kumar [Fri, 23 Sep 2016 18:57:27 +0000 (18:57 +0000)]
[llvm-cov] Minor cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282280
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 23 Sep 2016 18:44:09 +0000 (18:44 +0000)]
[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
Quentin Colombet [Fri, 23 Sep 2016 18:38:15 +0000 (18:38 +0000)]
[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
Quentin Colombet [Fri, 23 Sep 2016 18:38:13 +0000 (18:38 +0000)]
[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
Quentin Colombet [Fri, 23 Sep 2016 18:38:06 +0000 (18:38 +0000)]
[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
Matthias Braun [Fri, 23 Sep 2016 18:28:31 +0000 (18:28 +0000)]
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
Peter Collingbourne [Fri, 23 Sep 2016 18:27:42 +0000 (18:27 +0000)]
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
Quentin Colombet [Fri, 23 Sep 2016 17:50:06 +0000 (17:50 +0000)]
[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
Quentin Colombet [Fri, 23 Sep 2016 17:50:03 +0000 (17:50 +0000)]
[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
Jun Bum Lim [Fri, 23 Sep 2016 17:26:14 +0000 (17:26 +0000)]
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
James Molloy [Fri, 23 Sep 2016 13:35:43 +0000 (13:35 +0000)]
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
Nemanja Ivanovic [Fri, 23 Sep 2016 13:25:31 +0000 (13:25 +0000)]
[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
James Molloy [Fri, 23 Sep 2016 12:15:58 +0000 (12:15 +0000)]
[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
Michal Gorny [Fri, 23 Sep 2016 11:09:33 +0000 (11:09 +0000)]
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
George Rimar [Fri, 23 Sep 2016 11:01:53 +0000 (11:01 +0000)]
Revert r282238 "Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section.""
Build bot issues (http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15856/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dump-gdbindex.test)
should be fixed in that version. Issue was that MSVS does not support "%zu". Though it works fine on MSCS 2015,
Bot looks running MSVS 2013 that does not like it. MSDN also says that "z" prefix is not supported: https://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx
I had to use PRId64 instead.
Original commit message:
[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section.
gold linker's --gdb-index option currently is able to create the .gdb_index section that allows GDB to locate and read the .dwo files as it needs them,
this helps reduce the total size of the object files processed by the linker.
More info about that:
https://gcc.gnu.org/wiki/DebugFission
https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html
Patch teaches dwarfdump tool to dump this section.
Differential revision: https://reviews.llvm.org/D21503
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282239
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Fri, 23 Sep 2016 10:12:56 +0000 (10:12 +0000)]
Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section."
It broke BB:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15856
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282238
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Fri, 23 Sep 2016 09:14:08 +0000 (09:14 +0000)]
[InstCombine] Fix for PR29124: reduce insertelements to shufflevector
If inserting more than one constant into a vector:
define <4 x float> @foo(<4 x float> %x) {
%ins1 = insertelement <4 x float> %x, float 1.0, i32 1
%ins2 = insertelement <4 x float> %ins1, float 2.0, i32 2
ret <4 x float> %ins2
}
InstCombine could reduce that to a shufflevector:
define <4 x float> @goo(<4 x float> %x) {
%shuf = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.0, float 2.0, float undef>, <4 x i32><i32 0, i32 5, i32 6, i32 3>
ret <4 x float> %shuf
}
Also, InstCombine tries to convert shuffle instruction to single insertelement, if one of the vectors is a constant vector and only a single element from this constant should be used in shuffle, i.e.
shufflevector <4 x float> %v, <4 x float> <float undef, float 1.0, float
undef, float undef>, <4 x i32> <i32 0, i32 5, i32 undef, i32 undef> ->
insertelement <4 x float> %v, float 1.0, 1
Differential Revision: https://reviews.llvm.org/D24182
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282237
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Fri, 23 Sep 2016 09:09:26 +0000 (09:09 +0000)]
[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section.
gold linker's --gdb-index option currently is able to create the .gdb_index section that allows GDB to locate and read the .dwo files as it needs them,
this helps reduce the total size of the object files processed by the linker.
More info about that:
https://gcc.gnu.org/wiki/DebugFission
https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html
Patch teaches dwarfdump tool to dump this section.
Differential revision: https://reviews.llvm.org/D21503
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282235
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Fri, 23 Sep 2016 09:08:07 +0000 (09:08 +0000)]
[AMDGPU] Refactor VOP1 and VOP2 instruction TD definitions
Differential revision: https://reviews.llvm.org/D24738
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282234
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 23 Sep 2016 06:24:43 +0000 (06:24 +0000)]
[AVX-512] Split X86ISD::VFPROUND and X86ISD::VFPEXT into separate opcodes for each type constraint.
This revealed that scalar intrinsics could create nodes with a rounding mode of FROUND_CUR_DIRECTION, but the patterns didn't check for it. It just worked because isel doesn't check operand count and we had a pattern without the rounding mode argument at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282231
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 23 Sep 2016 06:24:39 +0000 (06:24 +0000)]
[AVX-512] Add separate ISD opcodes for each form of CVT instructions. Don't reuse non-X86 ISD opcodes with extra X86 specific arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282230
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 23 Sep 2016 06:24:35 +0000 (06:24 +0000)]
[AVX-512] Use different ISD opcodes for some of the scalar intrinsic lowering. Isel is not very robust against using the same ISD opcode with different number of operands so its better to separate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282229
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 23 Sep 2016 02:18:59 +0000 (02:18 +0000)]
[libFuzzer] be more precise about what we reset in TracePC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282225
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 23 Sep 2016 01:58:51 +0000 (01:58 +0000)]
[libFuzzer] fix merging with trace-pc-guard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282224
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 23 Sep 2016 01:33:26 +0000 (01:33 +0000)]
AMDGPU/SI: Include implicit arguments in kernarg_segment_byte_size
Reviewers: arsenm
Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye
Differential Revision: https://reviews.llvm.org/D24835
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282223
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 23 Sep 2016 01:20:07 +0000 (01:20 +0000)]
[libFuzzer] simplify the TracePC logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282222
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 23 Sep 2016 00:59:12 +0000 (00:59 +0000)]
[RegisterBankInfo] Mark the dump methods with LLVM_DUMP_METHOD.
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282221
91177308-0d34-0410-b5e6-
96231b3b80d8