OSDN Git Service
Sanjay Patel [Tue, 26 Aug 2014 00:59:15 +0000 (00:59 +0000)]
fix typos in comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216424
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 26 Aug 2014 00:33:28 +0000 (00:33 +0000)]
Declare that musttail calls in variadic functions forward the ellipsis
Summary:
There is no functionality change here except in the way we assemble and
dump musttail calls in variadic functions. There's really no need to
separate out the bits for musttail and "is forwarding varargs" on call
instructions. A musttail call by definition has to forward the ellipsis
or it would fail verification.
Reviewers: chandlerc, nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4892
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216423
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 26 Aug 2014 00:24:23 +0000 (00:24 +0000)]
Fix Path unittests on Windows after raw_fd_ostream changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216422
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 25 Aug 2014 23:58:48 +0000 (23:58 +0000)]
ArgPromotion: Don't touch variadic functions
Adding, removing, or changing non-pack parameters can change the ABI
classification of pack parameters. Clang and other frontends encode the
classification in the IR of the call site, but the callee side
determines it dynamically based on the number of registers consumed so
far. Changing the prototype affects the number of registers consumed
would break such code.
Dead argument elimination performs a similar task and already has a
similar check to avoid this problem.
Patch by Thomas Jablin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216421
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 25 Aug 2014 23:33:48 +0000 (23:33 +0000)]
[MCJIT][SystemZ] Use a simpler expression for indirect relocation offsets.
The expressions 'Reloc.Addend - Addend' and 'Reloc.Offset' should always be
equal in this context. The latter is prefered - we want to remove the
RelocationValueRef::Addend field in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216418
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 Aug 2014 22:53:21 +0000 (22:53 +0000)]
Fix bug in llvm::sys::argumentsFitWithinSystemLimits().
This patch fixes a subtle bug in the UNIX implementation of
llvm::sys::argumentsFitWithinSystemLimits() regarding the misuse of a static
variable. This bug causes our cached number that stores the system command line
maximum length to be halved after each call to the function. With a sufficient
number of calls to this function, it will eventually report any given command
line string to be over system limits.
Patch by Rafael Auler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216415
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 25 Aug 2014 22:19:14 +0000 (22:19 +0000)]
[MCJIT] Dump section memory both before and after relocations are applied.
Also switch section memory dump format from 8 to 16 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216413
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 Aug 2014 22:15:06 +0000 (22:15 +0000)]
Refactor argument serialization logic when executing process. NFC.
This patch refactors the argument serialization logic used in the Execute
function, used to launch new Windows processes. There is a critical step that
joins char** arguments into a single string, building the command line used to
launch the new process, and the readability of this code is improved if this
part is refactored in its own helper function.
Patch by Rafael Auler!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216411
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Mon, 25 Aug 2014 19:58:05 +0000 (19:58 +0000)]
[FastISel][AArch64] Refactor float zero materialization. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216403
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 25 Aug 2014 18:37:38 +0000 (18:37 +0000)]
[MCJIT] Make RuntimeDyld dump section contents in -debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216400
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 25 Aug 2014 18:16:47 +0000 (18:16 +0000)]
Modernize raw_fd_ostream's constructor a bit.
Take a StringRef instead of a "const char *".
Take a "std::error_code &" instead of a "std::string &" for error.
A create static method would be even better, but this patch is already a bit too
big.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216393
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 25 Aug 2014 18:06:11 +0000 (18:06 +0000)]
[x86] Fix a bug in r216319 where I was missing a 'break'.
This actually was caught by existing tests but those tests were disabled
with an XFAIL because of PR20736. While working on fixing that,
I noticed the test failure, and tracked it down to this.
We even have a really nice Clang warning that would have caught this but
it isn't enabled in LLVM! =[ I may look at enabling it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216391
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Mon, 25 Aug 2014 17:51:14 +0000 (17:51 +0000)]
Remove dangling initializers in GlobalDCE
GlobalDCE deletes global vars and updates their initializers to nullptr
while leaving underlying constants to be cleaned up later by its uses.
The clean up may never happen, fix this by forcing it every time it's
safe to destroy constants.
Final patch by Rafael Espindola
http://reviews.llvm.org/D4931
<rdar://problem/
17523868>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216390
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Mon, 25 Aug 2014 17:51:04 +0000 (17:51 +0000)]
Rise from the dead and update personal info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216389
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 25 Aug 2014 16:56:33 +0000 (16:56 +0000)]
[AArch32] Add patterns for VCVT{A,N,P,M}.
Patterns for lowering libm calls to VCVT{A,N,P,M} are also included.
Phabricator Revision: http://reviews.llvm.org/D5033
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216388
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Mon, 25 Aug 2014 14:49:34 +0000 (14:49 +0000)]
[SKX] avx512_icmp_packed multiclass extension
Extended avx512_icmp_packed multiclass by masking versions.
Added avx512_icmp_packed_rmb multiclass for embedded broadcast versions.
Added corresponding _vl multiclasses.
Added encoding tests for CPCMP{EQ|GT}* instructions.
Add more fields for X86VectorVTInfo.
Added AVX512VLVectorVTInfo that include X86VectorVTInfo for 512/256/128-bit versions
Differential Revision: http://reviews.llvm.org/D5024
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216383
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Mon, 25 Aug 2014 08:22:46 +0000 (08:22 +0000)]
MergeFunctions, tiny refactoring:
cmpAPFloat has been renamed to cmpAPFloats (multiple form).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216376
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Mon, 25 Aug 2014 08:19:50 +0000 (08:19 +0000)]
MergeFunctions, tiny refactoring:
cmpAPInt has been renamed to cmpAPInts (multiple form).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216375
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Mon, 25 Aug 2014 08:16:39 +0000 (08:16 +0000)]
MergeFunctions, tiny refactoring:
cmpType has been renamed to cmpTypes (multiple form).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216374
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Mon, 25 Aug 2014 08:12:45 +0000 (08:12 +0000)]
MergeFunctions, tiny refactoring:
cmpGEP has been renamed to cmpGEPs (multiple form).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216373
91177308-0d34-0410-b5e6-
96231b3b80d8
Karthik Bhat [Mon, 25 Aug 2014 04:56:54 +0000 (04:56 +0000)]
Allow vectorization of division by uniform power of 2.
This patch adds support to recognize division by uniform power of 2 and modifies the cost table to vectorize division by uniform power of 2 whenever possible.
Updates Cost model for Loop and SLP Vectorizer.The cost table is currently only updated for X86 backend.
Thanks to Hal, Andrea, Sanjay for the review. (http://reviews.llvm.org/D4971)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216371
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 01:59:49 +0000 (01:59 +0000)]
CodeGen/LiveVariables: hoist out code in nested loops
This makes runOnMachineFunction vastly more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216368
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 01:59:42 +0000 (01:59 +0000)]
CodeGen/LiveVariables: switch to std::vector
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216367
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 01:59:38 +0000 (01:59 +0000)]
AArch64: unique_ptr-ify map structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216366
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 01:59:36 +0000 (01:59 +0000)]
AArch64: use std::vector for temp array
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216365
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 01:59:32 +0000 (01:59 +0000)]
NVPTX: remove another raw delete call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216364
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 01:59:29 +0000 (01:59 +0000)]
NVPTX: remove raw delete call
Also make members that are never accessed outside the class
private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216363
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:58:18 +0000 (00:58 +0000)]
ExecutionEngine: unique_ptr-ify
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216362
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:58:15 +0000 (00:58 +0000)]
EE/JIT: unique_ptr-ify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216361
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:58:13 +0000 (00:58 +0000)]
Support/Path: remove raw delete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216360
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:58:10 +0000 (00:58 +0000)]
Support/APFloat: unique_ptr-ify temp arrays
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216359
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:28:43 +0000 (00:28 +0000)]
Analysis: unique_ptr-ify DependenceAnalysis::collectCoeffInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216358
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:28:39 +0000 (00:28 +0000)]
Analysis: unique_ptr-ify DependenceAnalysis::depends
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216357
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:28:35 +0000 (00:28 +0000)]
Analysis: take a reference instead of pointer
This parameter is never null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216356
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:28:31 +0000 (00:28 +0000)]
CodeGen: switch raw array to std::vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216355
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Mon, 25 Aug 2014 00:28:27 +0000 (00:28 +0000)]
IR: remove dead code
This was added in r134994, to fix a memory leak;
three days later, r135248 switched
ContainedTys from being new-allocated to being allocated
via BumpPtrAllocator, and the earlier fix was never
reverted.
The destructor doesn't seem to ever actually be called
on Types anyway, so it's harmless, but if it were,
this'd be an invalid pointer.
This reverts r134994.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216354
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 24 Aug 2014 23:23:06 +0000 (23:23 +0000)]
Use range based for loops to avoid needing to re-mention SmallPtrSet size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216351
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Sun, 24 Aug 2014 19:10:57 +0000 (19:10 +0000)]
TableGen: unique_ptr-ify RecordKeeper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216350
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Sun, 24 Aug 2014 19:10:53 +0000 (19:10 +0000)]
TableGen: delete no-op code
This does nothing but remove the Record from the map, and
then re-add it, without actually changing it in between.
The Record's Name used to be changed before re-adding it
when the code was first committed in r137232, but the
name-changing lines were removed in r142510, and since
then this code seems to do nothing.
This was also the only caller of removeClass or removeDef,
so now RecordKeeper owns its Records unconditionally,
and could be unique_ptr-ified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216349
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Sun, 24 Aug 2014 19:10:49 +0000 (19:10 +0000)]
TableGen: use auto and for-range
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216348
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sun, 24 Aug 2014 13:25:16 +0000 (13:25 +0000)]
This code is from r216285, which did not go out to the mailing list for some reason.
The switch statement would never fire due to the preceding break statement. Also, the switch statement has a default label with no case labels. Simplified the code, and allow it to execute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216346
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Sun, 24 Aug 2014 09:19:56 +0000 (09:19 +0000)]
X86 intrinsics table - simplifies intrinsics lowering.
The tables are initialized when X86TargetLowering object is created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216345
91177308-0d34-0410-b5e6-
96231b3b80d8
Patrik Hagglund [Sun, 24 Aug 2014 09:12:33 +0000 (09:12 +0000)]
Silence gcc -Wpedantic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216344
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 24 Aug 2014 09:10:57 +0000 (09:10 +0000)]
InstCombine: Properly optimize or'ing bittests together
CFE, with -03, would turn:
bool f(unsigned x) {
bool a = x & 1;
bool b = x & 2;
return a | b;
}
into:
%1 = lshr i32 %x, 1
%2 = or i32 %1, %x
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
This sort of thing exposes a nasty pathology in GCC, ICC and LLVM.
Instead, we would rather want:
%1 = and i32 %x, 3
%2 = icmp ne i32 %1, 0
Things get a bit more interesting in the following case:
%1 = lshr i32 %x, %y
%2 = or i32 %1, %x
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
Replacing it with the following sequence is better:
%1 = shl nuw i32 1, %y
%2 = or i32 %1, 1
%3 = and i32 %2, %x
%4 = icmp ne i32 %3, 0
This sequence is preferable because %1 doesn't involve %x and could
potentially be hoisted out of loops if it is invariant; only perform
this transform in the non-constant case if we know we won't increase
register pressure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216343
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 23 Aug 2014 23:21:04 +0000 (23:21 +0000)]
[PowerPC] Add support for dcbtst and icbt (prefetch)
Adds code generation support for dcbtst (data cache prefetch for write) and
icbt (instruction cache prefetch for read - Book E cores only).
We still end up with a 'cannot select' error for the non-supported prefetch
intrinsic forms. This will be fixed in a later commit.
Fixes PR20692.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216339
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Sat, 23 Aug 2014 23:07:14 +0000 (23:07 +0000)]
Support: add llvm::unique_lock
Based on the STL class of the same name, it guards a mutex
while also allowing it to be unlocked conditionally before
destruction.
This eliminates the last naked usages of mutexes in LLVM and
clang.
It also uncovered and fixed a bug in callExternalFunction()
when compiled without USE_LIBFFI, where the mutex would never
be unlocked if the end of the function was reached.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216338
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Sat, 23 Aug 2014 22:49:22 +0000 (22:49 +0000)]
Support: make LLVM Mutexes STL-compatible
Use lock/unlock() convention instead of acquire/release().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216336
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Sat, 23 Aug 2014 22:49:17 +0000 (22:49 +0000)]
Support/Unix: use ScopedLock wherever possible
Only one function remains a bit too complicated
for a simple mutex guard. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216335
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Sat, 23 Aug 2014 21:10:58 +0000 (21:10 +0000)]
cmake: actually test -Wcomment
This test was testing nothing, as only -Werror was ever
being added to the compiler flags.
You can see the final nitty-gritty compiler invocation in
CMakeFiles/CMakeOutput.log (for successful tests) and
CMakeFiles/CMakeError.log (for failed tests).
Before:
Building C object CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o
/usr/bin/clang -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -DC_WCOMMENT_ALLOWS_LINE_WRAP -Werror -o CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o -c /home/nobled/code/llvm-b9/CMakeFiles/CMakeTmp/src.c
After:
Building C object CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o
/usr/bin/clang -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -DC_WCOMMENT_ALLOWS_LINE_WRAP -Werror -Wcomment -o CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o -c /home/nobled/code/llvm-b9/CMakeFiles/CMakeTmp/src.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216328
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan Noblesmith [Sat, 23 Aug 2014 21:10:56 +0000 (21:10 +0000)]
cmake: disable -Wnon-virtual-dtor when it gives false positives
clang has only been smart enough not to trigger -Wnon-virtual-dtor
warnings on final classes since r208449 (in clang 3.5). Building
with older versions is extremely noisy, so disable the warning
on those compilers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216327
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Sat, 23 Aug 2014 18:29:43 +0000 (18:29 +0000)]
Revert "ARM: improve RTABI 4.2 conformance on Linux"
This reverts commit r215862 due to nightly failures. Will work on getting a
reduced test case, but I wanted to get our bots green in the meantime.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216325
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Sat, 23 Aug 2014 18:29:40 +0000 (18:29 +0000)]
Revert "ARM: mark missing functions from RTABI"
This reverts commit r215863.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216324
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 23 Aug 2014 10:25:15 +0000 (10:25 +0000)]
[x86] Start fixing a really subtle and terrible form of miscompile in
these DAG combines.
The DAG auto-CSE thing is truly terrible. Due to it, when RAUW-ing
a node with its operand, you can cause its uses to CSE to itself, which
then causes their uses to become your uses which causes them to be
picked up by the RAUW. For nodes that are determined to be "no-ops",
this is "fine". But if the RAUW is one of several steps to enact
a transformation, this causes the DAG to really silently eat an discard
nodes that you would never expect. It took days for me to actually
pinpoint a test case triggering this and a really frustrating amount of
time to even comprehend the bug because I never even thought about the
ability of RAUW to iteratively consume nodes due to CSE-ing them into
itself.
To fix this, we have to build up a brand-new chain of operations any
time we are combining across (potentially) intervening nodes. But once
the logic is added to do this, another issue surfaces: CombineTo eagerly
deletes the one node combined, *but no others*. This is... really
frustrating. If deleting it makes its operands become dead, those
operand nodes often won't go onto the worklist in the
order you would want -- they're already on it and not near the top. That
means things higher on the worklist will get combined prior to these
dead nodes being GCed out of the worklist, and if the chain is long, the
immediate users won't be enough to re-detect where the root of the chain
is that became single-use again after deleting the dead nodes. The
better way to do this is to never immediately delete nodes, and instead
to just enqueue them so we can recursively delete them. The
combined-from node is typically not on the worklist anyways by virtue of
having been popped off.... But that in turn breaks other tests that
*require* CombineTo to delete unused nodes. :: sigh ::
Fortunately, there is a better way. This whole routine should have been
returning the replacement rather than using CombineTo which is quite
hacky. Switch to that, and all the pieces fall together.
I suspect the same kind of miscompile is possible in the half-shuffle
folding code, and potentially the recursive folding code. I'll be
switching those over to a pattern more like this one for safety's sake
even though I don't immediately have any test cases for them. Note that
the only way I got a test case for this instance was with *heavily* DAG
combined 256-bit shuffle sequences generated by my fuzzer. ;]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216319
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Sat, 23 Aug 2014 04:34:58 +0000 (04:34 +0000)]
ProgrammersManual: the flag is called -debug-only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216316
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Sat, 23 Aug 2014 00:47:24 +0000 (00:47 +0000)]
llvm-cov: test: add xfail for the big-endian buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216310
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 23 Aug 2014 00:45:03 +0000 (00:45 +0000)]
Revert r215611 because it caused the infinite loop in bug 20736. There is a reduced testcase in that bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216307
91177308-0d34-0410-b5e6-
96231b3b80d8
Yunzhong Gao [Fri, 22 Aug 2014 23:27:04 +0000 (23:27 +0000)]
Add a test case for SROA where the store size is bigger than slice size. The
test case was fixed in r216248.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216303
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 22 Aug 2014 23:26:10 +0000 (23:26 +0000)]
Add support for comdats to the gold plugin.
There are two parts to this. First, the plugin needs to tell gold the comdat by
setting comdat_key.
What gets things a bit more complicated is that gold only seems
symbols. In particular, if A is an alias to B, it only sees the symbols
A and B. It can then ask us to keep symbol A but drop symbol B. What
we have to do instead is to create an internal version of B and make A
an alias to that.
At some point some of this logic should be moved to lib/Linker so that
we don't map a Constant to an internal version just to have lib/Linker
map that again to the destination module.
The reason for implementing this in tools/gold for now is simplicity.
With it in place it should be possible to update clang to use comdats
for constructors and destructors on ELF without breaking the LTO
bootstrap. Once that is done I intend to come back and improve the
interface lib/Linker exposes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216302
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 22 Aug 2014 22:56:03 +0000 (22:56 +0000)]
llvm-cov: add code coverage tool that's based on coverage mapping format and clang's pgo.
This commit expands llvm-cov's functionality by adding support for a new code coverage
tool that uses LLVM's coverage mapping format and clang's instrumentation based profiling.
The gcov compatible tool can be invoked by supplying the 'gcov' command as the first argument,
or by modifying the tool's name to end with 'gcov'.
Differential Revision: http://reviews.llvm.org/D4445
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216300
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 22 Aug 2014 22:45:57 +0000 (22:45 +0000)]
[SROA] Fold a PHI node if all its incoming values are the same
Summary:
Fixes PR20425.
During slice building, if all of the incoming values of a PHI node are the same, replace the PHI node with the common value. This simplification makes alloca's used by PHI nodes easier to promote.
Test Plan: Added three more tests in phi-and-select.ll
Reviewers: nlewycky, eliben, meheff, chandlerc
Reviewed By: chandlerc
Subscribers: zinovy.nis, hfinkel, baldrick, llvm-commits
Differential Revision: http://reviews.llvm.org/D4659
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216299
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 22 Aug 2014 21:59:26 +0000 (21:59 +0000)]
ARM / x86_64 varargs: Don't save regparms in prologue without va_start
There's no need to do this if the user doesn't call va_start. In the
future, we're going to have thunks that forward these register
parameters with musttail calls, and they won't need these spills for
handling va_start.
Most of the test suite changes are adding va_start calls to existing
tests to keep things working.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216294
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 22 Aug 2014 21:57:38 +0000 (21:57 +0000)]
Clear the llvm release notes to make room for 3.6.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216292
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Fri, 22 Aug 2014 20:35:18 +0000 (20:35 +0000)]
Add the start of the support for llvm-objdump’s -private-headers for Mach-O files.
This adds the printing of the mach header. Load command printing will be next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216285
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Fri, 22 Aug 2014 20:34:31 +0000 (20:34 +0000)]
Add a few missing mach header flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216284
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 22 Aug 2014 19:29:17 +0000 (19:29 +0000)]
Fix PR17239 by changing the semantics of the RemainingArgsClass Option kind
This patch contains the LLVM side of the fix of PR17239.
This bug that happens because the /link (clang-cl.exe argument) is
marked as "consume all remaining arguments". However, when inside a
response file, /link should only consume all remaining arguments inside
the response file where it is located, not the entire command line after
expansion.
My patch will change the semantics of the RemainingArgsClass kind to
always consume only until the end of the response file when the option
originally came from a response file. There are only two options in this
class: dash dash (--) and /link.
Reviewed By: rnk
Differential Revision: http://reviews.llvm.org/D4899
Patch by Rafael Auler!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216280
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 22 Aug 2014 18:49:35 +0000 (18:49 +0000)]
R600/SI: Use READ2/WRITE2 instructions for 64-bit mem ops with 32-bit alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216279
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 22 Aug 2014 18:49:33 +0000 (18:49 +0000)]
R600/SI: Use a ComplexPattern for DS loads and stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216278
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 22 Aug 2014 18:49:31 +0000 (18:49 +0000)]
R600/SI: Wrap local memory pointer in AssertZExt on SI
These pointers are really just offsets and they will always be
less than 16-bits. Using AssertZExt allows us to use computeKnownBits
to prove that these values are positive. We will use this information
in a later commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216277
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 22 Aug 2014 18:49:28 +0000 (18:49 +0000)]
R600/SI: Use correct helper class for DS_WRITE2 instructions
DS_1A uses a single offset encoding, so offset1 wasn't being
encoded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216276
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 22 Aug 2014 18:05:22 +0000 (18:05 +0000)]
[ARM] Move the implementation of the target hooks related to copy-related
instruction from ARMInstrInfo to ARMBaseInstrInfo.
That way, thumb mode can also benefit from the advanced copy optimization.
<rdar://problem/
12702965>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216274
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 22 Aug 2014 17:11:04 +0000 (17:11 +0000)]
InstCombine: Don't unconditionally preserve 'nuw' when shrinking constants
Consider:
%add = add nuw i32 %a, -
16777216
%and = and i32 %add, 255
Regardless of whether or not we demand the sign bit of %add, we cannot
replace -
16777216 with
2130706432 without also removing 'nuw' from the
instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216273
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 22 Aug 2014 16:41:23 +0000 (16:41 +0000)]
InstCombine: sub nsw %x, C -> add nsw %x, -C if C isn't INT_MIN
We can preserve nsw during this transform if -C won't overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216269
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 22 Aug 2014 16:29:45 +0000 (16:29 +0000)]
[Support] Fix the overflow bug in ULEB128 decoding.
Differential Revision: http://reviews.llvm.org/D5029
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216268
91177308-0d34-0410-b5e6-
96231b3b80d8
Sasa Stankovic [Fri, 22 Aug 2014 09:23:22 +0000 (09:23 +0000)]
[mips] Don't use odd-numbered float registers for double arguments for fastcc
calling convention if FP is 64-bit and +nooddspreg is used.
Differential Revision: http://reviews.llvm.org/D4981.diff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216262
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 22 Aug 2014 07:56:32 +0000 (07:56 +0000)]
InstCombine: Don't unconditionally preserve 'nsw' when shrinking constants
Consider:
%add = add nsw i32 %a, -
16777216
%and = and i32 %add, 255
Regardless of whether or not we demand the sign bit of %add, we cannot
replace -
16777216 with
2130706432 without also removing 'nsw' from the
instruction.
This fixes PR20377.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216261
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Eckstein [Fri, 22 Aug 2014 01:18:39 +0000 (01:18 +0000)]
fix: SLPVectorizer crashes for unreachable blocks containing not schedulable instructions.
In unreachable blocks it's legal to have instructions like "%x = op %x".
Such instuctions are not schedulable. Therefore the SLPVectorizer has to check for
unreachable blocks and ignore them.
Fixes bug 20646.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216256
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 22 Aug 2014 01:18:18 +0000 (01:18 +0000)]
[dfsan] Fix non-determinism bug in non-zero label check annotator.
We now use a std::vector instead of a DenseSet to store the list of
label checks so that we can iterate over it deterministically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216255
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 22 Aug 2014 00:40:43 +0000 (00:40 +0000)]
ValueTracking: Figure out more bits when looking at add/sub
Given something like X01XX + X01XX, we know that the result must look
like X1XXX.
Adapted from a patch by Richard Smith, test-case written by me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216250
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 22 Aug 2014 00:09:56 +0000 (00:09 +0000)]
SROA: Handle a case of store size being smaller than allocation size
In this case, we are creating an x86_fp80 slice for a union from C where
the padding bytes may contain real data. An x86_fp80 alloca is 16 bytes,
and that's just fine. We can't, however, use regular loads and stores to
access the slice, because the store size is only 10 bytes / 80 bits.
Instead, use memcpy and memset.
Fixes PR18726.
Reviewed By: chandlerc
Differential Revision: http://reviews.llvm.org/D5012
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216248
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 21 Aug 2014 23:36:08 +0000 (23:36 +0000)]
Revert "X86: Align the stack on word boundaries in LowerFormalArguments()"
This (mostly) reverts commit r216119.
Somewhere during the review Reid committed r214980 which fixed this
another way, and I neglected to check that the testcase still failed
before committing.
I've left test/CodeGen/X86/aligned-variadic.ll around in case it adds
extra coverage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216246
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 21 Aug 2014 23:24:08 +0000 (23:24 +0000)]
Add an explicit move constructor to SrcBuffer
MSVC can't synthesize the explicit one. Instead it tries to emit a copy
ctor which would call the deleted copy ctor of unique_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216244
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 21 Aug 2014 23:06:07 +0000 (23:06 +0000)]
[FastISel][AArch64] Add support for variable shift.
This adds the missing variable shift support for value type i8, i16, and i32.
This fixes <rdar://problem/
18095685>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216242
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 21 Aug 2014 22:53:49 +0000 (22:53 +0000)]
Minor refactor to make applying patches from 'Add a "probe-stack" attribute' review thread out of order easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216241
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 21 Aug 2014 22:45:21 +0000 (22:45 +0000)]
Use DILexicalBlockFile, rather than DILexicalBlock, to track discriminator changes to ensure discriminator changes don't introduce new DWARF DW_TAG_lexical_blocks.
Somewhat unnoticed in the original implementation of discriminators, but
it could cause instructions to end up in new, small,
DW_TAG_lexical_blocks due to the use of DILexicalBlock to track
discriminator changes.
Instead, use DILexicalBlockFile which we already use to track file
changes without introducing new scopes, so it works well to track
discriminator changes in the same way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216239
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 21 Aug 2014 22:31:48 +0000 (22:31 +0000)]
name change: isPow2DivCheap -> isPow2SDivCheap
isPow2DivCheap
That name doesn't specify signed or unsigned.
Lazy as I am, I eventually read the function and variable comments. It turns out that this is strictly about signed div. But I discovered that the comments are wrong:
srl/add/sra
is not the general sequence for signed integer division by power-of-2. We need one more 'sra':
sra/srl/add/sra
That's the sequence produced in DAGCombiner. The first 'sra' may be removed when dividing by exactly '2', but that's a special case.
This patch corrects the comments, changes the name of the flag bit, and changes the name of the accessor methods.
No functional change intended.
Differential Revision: http://reviews.llvm.org/D5010
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216237
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 21 Aug 2014 22:23:52 +0000 (22:23 +0000)]
[PeepholeOptimizer] Enable the advanced copy optimization by default.
The advanced copy optimization does not yield any difference on the whole llvm
test-suite + SPECs, either in compile time or runtime (binaries are identical),
but has a big potential when data go back and forth between register files as
demonstrated with test/CodeGen/ARM/adv-copy-opt.ll.
Note: This was measured for both Os and O3 for armv7s, arm64, and x86_64.
<rdar://problem/
12702965>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216236
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 21 Aug 2014 22:19:16 +0000 (22:19 +0000)]
Whitespace change to reduce diff in future patch.
Patch 2 of 11 in 'Add a "probe-stack" attribute' review thread
Patch by: john.kare.alsaker@gmail.com
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216235
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 21 Aug 2014 22:15:20 +0000 (22:15 +0000)]
[X86] Split out the logic to select the stack probe function (NFC)
Patch 1 of 11 in 'Add a "probe-stack" attribute' review thread.
Patch by: <john.kare.alsaker@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216233
91177308-0d34-0410-b5e6-
96231b3b80d8
Robin Morisset [Thu, 21 Aug 2014 22:09:25 +0000 (22:09 +0000)]
Add hooks for emitLeading/TrailingFence
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216232
91177308-0d34-0410-b5e6-
96231b3b80d8
Robin Morisset [Thu, 21 Aug 2014 21:50:01 +0000 (21:50 +0000)]
Rename AtomicExpandLoadLinked into AtomicExpand
AtomicExpandLoadLinked is currently rather ARM-specific. This patch is the first of
a group that aim at making it more target-independent. See
http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/075873.html
for details
The command line option is "atomic-expand"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216231
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 21 Aug 2014 21:34:06 +0000 (21:34 +0000)]
[PeepholeOptimizer] Update the kill flags when extending the live-range of the
source of a copy.
<rdar://problem/
12702965>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216229
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 21 Aug 2014 21:09:24 +0000 (21:09 +0000)]
Fix a URL (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216228
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 21 Aug 2014 20:57:57 +0000 (20:57 +0000)]
[FastISel][AArch64] Use the correct register class to make the MI verifier happy.
This is mostly achieved by providing the correct register class manually,
because getRegClassFor always returns the GPR*AllRegClass for MVT::i32 and
MVT::i64.
Also cleanup the code to use the FastEmitInst_* method whenever possible. This
makes sure that the operands' register class is properly constrained. For all
the remaining cases this adds the missing constrainOperandRegClass calls for
each operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216225
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 21 Aug 2014 20:44:56 +0000 (20:44 +0000)]
Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using std::unique_ptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216223
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 21 Aug 2014 20:41:00 +0000 (20:41 +0000)]
R600/SI: Teach moveToVALU how to handle more S_LOAD_* instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216220
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 21 Aug 2014 20:40:58 +0000 (20:40 +0000)]
R600/SI: Make sure SCRATCH_WAVE_OFFSET is added as Live-In to the function
This fixes a crash in an ocl conformance test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216219
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 21 Aug 2014 20:40:56 +0000 (20:40 +0000)]
R600/SI: Remove unused SGPR spilling code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216218
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 21 Aug 2014 20:40:54 +0000 (20:40 +0000)]
R600/SI: Use eliminateFrameIndex() to expand SGPR spill pseudos
This will simplify the SGPR spilling and also allow us to use
MachineFrameInfo for calculating offsets, which should be more
reliable than our custom code.
This fixes a crash in some cases where a register would be spilled
in a branch such that the VGPR defined for spilling did not dominate
all the uses when restoring.
This fixes a crash in an ocl conformance test. The test requries
register spilling and is too big to include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216217
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 21 Aug 2014 20:40:50 +0000 (20:40 +0000)]
R600/SI: Handle VCC in SIRegisterInfo::getPhysRegSubReg()
This fixes a crash in an ocl conformance test. The test requries
register spilling and is too big to include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216216
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 21 Aug 2014 20:28:55 +0000 (20:28 +0000)]
Rewrite the gold plugin to fix pr19901.
There is a fundamental difference between how the gold API and lib/LTO view
the LTO process.
The gold API talks about a particular symbol in a particular file. The lib/LTO
API talks about a symbol in the merged module.
The merged module is then defined in terms of the IR semantics. In particular,
a linkonce_odr GV is only copied if it is used, since it is valid to drop
unused linkonce_odr GVs.
In the testcase in pr19901 both properties collide. What happens is that gold
asks us to keep a particular linkonce_odr symbol, but the IR linker doesn't
copy it to the merged module and we never have a chance to ask lib/LTO to keep
it.
This patch fixes it by having a more direct implementation of the gold API. If
it asks us to keep a symbol, we change the linkage so it is not linkonce. If it
says we can drop a symbol, we do so. All of this before we even send the module
to lib/Linker.
Since now we don't have to produce LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN,
during symbol resolution we can use a temporary LLVMContext and do lazy
module loading. This allows us to keep the minimum possible amount of
allocated memory around. This should also allow as much parallelism as
we want, since there is no shared context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216215
91177308-0d34-0410-b5e6-
96231b3b80d8