OSDN Git Service
Andrew Kaylor [Thu, 21 Apr 2016 17:58:54 +0000 (17:58 +0000)]
Initial implementation of optimization bisect support.
This patch implements a optimization bisect feature, which will allow optimizations to be selectively disabled at compile time in order to track down test failures that are caused by incorrect optimizations.
The bisection is enabled using a new command line option (-opt-bisect-limit). Individual passes that may be skipped call the OptBisect object (via an LLVMContext) to see if they should be skipped based on the bisect limit. A finer level of control (disabling individual transformations) can be managed through an addition OptBisect method, but this is not yet used.
The skip checking in this implementation is based on (and replaces) the skipOptnoneFunction check. Where that check was being called, a new call has been inserted in its place which checks the bisect limit and the optnone attribute. A new function call has been added for module and SCC passes that behaves in a similar way.
Differential Revision: http://reviews.llvm.org/D19172
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267022
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 21 Apr 2016 17:48:02 +0000 (17:48 +0000)]
Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly
Summary:
IntrReadWriteArgMem simply becomes IntrArgMemOnly.
So there are fewer intrinsic properties that express their orthogonality
better, and correspond more closely to the corresponding IR attributes.
Suggested by: Philip Reames
Reviewers: joker.eph, reames, tstellarAMD
Subscribers: jholewinski, arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D19291
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267021
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 21 Apr 2016 17:45:05 +0000 (17:45 +0000)]
[unordered] unordered loads from null are still unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267019
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcin Koscielnicki [Thu, 21 Apr 2016 17:36:05 +0000 (17:36 +0000)]
[PowerPC] [SSP] Fix stack guard load for 32-bit.
r266809 incorrectly used LD to load the stack guard, it should be LWZ.
Differential Revision: http://reviews.llvm.org/D19358
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267017
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 21 Apr 2016 17:33:22 +0000 (17:33 +0000)]
[LoopUtils] Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267016
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 21 Apr 2016 17:33:20 +0000 (17:33 +0000)]
[LoopUtils] Add asserts to findStringMetadataForLoop. NFC
These ensure that operand array has at least one element and it is the
self-reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267015
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 21 Apr 2016 17:33:17 +0000 (17:33 +0000)]
[LoopUtils] Move def of findStringMetadataForLoop to LoopUtils.cpp. NFC
The decl is in LoopUtils.h. I think that this was added to
LoopVersioningLICM.cpp by mistake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267014
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 21 Apr 2016 17:33:12 +0000 (17:33 +0000)]
[LoopUtils] Rename {check->find}StringMetadata{Into->For}Loop. NFC
"Into" was misleading. I am also planning to use this helper to look
for loop metadata and return the argument, so find seems like a better
name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267013
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 21 Apr 2016 17:03:33 +0000 (17:03 +0000)]
[instcombine][unordered] Implement *-load forwarding for unordered atomics
This builds on 266999 which made FindAvailableValue do the right thing. Tests included show the newly enabled transforms and those which disabled either due to conservatism or correctness requirements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267006
91177308-0d34-0410-b5e6-
96231b3b80d8
Amjad Aboud [Thu, 21 Apr 2016 16:58:49 +0000 (16:58 +0000)]
Fixed Dwarf debug info emission to skip DILexicalBlockFile entries.
Before this fix, DILexicalBlockFile entries were skipped only in some cases and were not in other cases.
Differential Revision: http://reviews.llvm.org/D18724
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267004
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 21 Apr 2016 16:51:08 +0000 (16:51 +0000)]
[unordered] Add tests and conservative handling in support of future changes [NFCI]
This change adds a couple of test cases to make sure FindAvailableLoadedValue does the right thing. At the moment, the code added is dead, but separating it makes follow on changes far more obvious.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266999
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 21 Apr 2016 16:18:02 +0000 (16:18 +0000)]
Address Philip's post-commit feedback for r266987. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266998
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 21 Apr 2016 16:15:19 +0000 (16:15 +0000)]
Minor comment cleanup [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266997
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 21 Apr 2016 14:56:33 +0000 (14:56 +0000)]
Fix recursive -only-needed.
We were assuming that only linkonce_odr GVs were lazy linked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266995
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Thu, 21 Apr 2016 14:32:12 +0000 (14:32 +0000)]
[mips][microMIPS] Implement ldpc instruction
Differential Revision: http://reviews.llvm.org/D15009
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266990
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Thu, 21 Apr 2016 14:09:35 +0000 (14:09 +0000)]
[mips][microMIPS] Add R_MICROMIPS_PC19_S2 relocation
Differential Revision: http://reviews.llvm.org/D14915
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266988
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 21 Apr 2016 14:04:54 +0000 (14:04 +0000)]
Refactor implied condition logic from ValueTracking directly into CmpInst. NFC.
Differential Revision: http://reviews.llvm.org/D19330
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266987
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Thu, 21 Apr 2016 13:43:26 +0000 (13:43 +0000)]
[mips][microMIPS] Add R_MICROMIPS_PC26_S1 relocation
Differential Revision: http://reviews.llvm.org/D14822
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266985
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Kolton [Thu, 21 Apr 2016 13:14:24 +0000 (13:14 +0000)]
[AMDGPU] Assembler: prevent parseDPPCtrlOps from eating invalid tokens
Reviewers: nhaustov, tstellarAMD
Subscribers: arsenm
Differential Revision: http://reviews.llvm.org/D19317
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266984
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 21 Apr 2016 12:16:21 +0000 (12:16 +0000)]
Add a CachedHash structure.
A DenseMap doesn't store the hashes, so it needs to recompute them when
the table is resized.
In some applications the hashing cost is noticeable. That is the case
for example in lld for symbol names (StringRef).
This patch adds a templated structure that can wraps any value that can
go in a DenseMap and caches the hash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266981
91177308-0d34-0410-b5e6-
96231b3b80d8
Zlatko Buljan [Thu, 21 Apr 2016 11:32:40 +0000 (11:32 +0000)]
[mips][microMIPS] Implement TLBP, TLBR, TLBWI and TLBWR instructions
Differential Revision: http://reviews.llvm.org/D18855
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266980
91177308-0d34-0410-b5e6-
96231b3b80d8
Zlatko Buljan [Thu, 21 Apr 2016 11:01:51 +0000 (11:01 +0000)]
[mips][microMIPS] Implement LL, SC, MOVEP, ROTR, ROTRV and SYSCALL instructions and add tests for LWM32 and SWM32
Differential Revision: http://reviews.llvm.org/D19150
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266977
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeny Astigeevich [Thu, 21 Apr 2016 09:36:49 +0000 (09:36 +0000)]
Updated a test not to produce an empty s-file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266971
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeny Astigeevich [Thu, 21 Apr 2016 08:54:08 +0000 (08:54 +0000)]
[AArch64][CodeGen] Fix of PR27158: incorrect peephole optimization in AArch64InstrInfo::optimizeCompareInstr
AArch64InstrInfo::optimizeCompareInstr has bug PR27158 which causes generation of incorrect code.
A compare instruction is substituted with another instruction which does not
produce the same flags as the original compare instruction.
This patch contains:
1. Fix of the bug.
2. A regression test in MIR.
3. A new test to check that SUBS is replaced by SUB.
Differential Revision: http://reviews.llvm.org/D18838
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266969
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 07:30:06 +0000 (07:30 +0000)]
[AVX512] Add CTTZ support for v8i64 and v16i32 vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266968
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 07:30:03 +0000 (07:30 +0000)]
[X86] Fix vector-tzcnt-512 test to disable CDI while enabling BWI for one of the runs. Update check patterns accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266967
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 07:29:59 +0000 (07:29 +0000)]
Fix test command line to explicitly disable CDI instructions for one test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266966
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Thu, 21 Apr 2016 06:43:45 +0000 (06:43 +0000)]
CachePruning: early exit if no path supplied
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266965
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Thu, 21 Apr 2016 06:43:41 +0000 (06:43 +0000)]
ThinLTO: initialize variables
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266964
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 06:39:34 +0000 (06:39 +0000)]
[AVX512] Add support for lowering CTTZ v64i8 and v32i16 with BWI instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266963
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 06:39:32 +0000 (06:39 +0000)]
[X86] Remove redundant calls to setOperationAction for EXTRACT_VECTOR_ELT/INSERT_VECTOR_ELT from SSE41 block. They were already done in an earlier block. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266962
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 06:39:29 +0000 (06:39 +0000)]
[X86] Remove some operations from the default Expand all vector ops loop. Instead let them stay Legal and mark them Expand for specific types where needed. Reduces overall number of calls to setOperationAction. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266961
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 06:39:26 +0000 (06:39 +0000)]
[X86] Remove old leftover MMX code that sets various 64-bit vector operations to Expand. These vector types aren't legal so these operations would never make it far enough to need to expand. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266960
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Thu, 21 Apr 2016 05:54:23 +0000 (05:54 +0000)]
ThinLTO: add module caching handling.
Differential Revision: http://reviews.llvm.org/D18494
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266959
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Thu, 21 Apr 2016 05:47:17 +0000 (05:47 +0000)]
ThinLTO: Resolve linkonce_odr aliases just like functions
This help to streamline the process of handling importing since
we don't need to special case alias everywhere: just like
linkonce_odr function, make sure at least one alias is emitted
by turning it weak.
Differential Revision: http://reviews.llvm.org/D19308
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266958
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 21 Apr 2016 05:09:12 +0000 (05:09 +0000)]
[SimplifyCFG] Fold `llvm.guard(false)` to unreachable
Summary:
`llvm.guard(false)` always bails out of the current compilation unit, so
we can prune any control flow following it.
Reviewers: hfinkel, pcc, reames
Subscribers: majnemer, reames, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D19245
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266955
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 04:44:00 +0000 (04:44 +0000)]
[X86] Remove unnecessary setting of CTTZ_ZERO_UNDEF to Custom for vector types where we can't do any better than the Custom lowering of CTTZ. LegalizeVectorOps will expand to CTTZ since its marked Custom.
CTTZ_ZERO_UNDEF can be custom lowered specially if CTLZ is supported. Otherwise CTTZ and CTTZ_ZERO_UNDEF are handled the same way by using CTPOP and bitmath.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266952
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 04:43:57 +0000 (04:43 +0000)]
[SelectionDAG] Teach LegalizeVectorOps to directly Expand CTTZ_ZERO_UNDEF/CTLZ_ZERO_UNDEF to CTTZ/CTLZ directly if those ops are Legal/Custom instead of deferring it to LegalizeOps.
This is needed to support CTTZ/CTLZ Custom correctly since LegalizeOps would be too late to do the custom lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266951
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 21 Apr 2016 03:57:24 +0000 (03:57 +0000)]
[AVX512] Add support for popcount of v8i64 and v16i32 with and without BWI instructions.
Without BWI we have to split the vectors into 256-bit vectors so we can use AVX2 pshufb and then concatenate the results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266950
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 21 Apr 2016 02:34:36 +0000 (02:34 +0000)]
ValueMapper: Map uniqued nodes in post-order
The iteratitive algorithm from r265456 claimed but failed to create a
post-order traversal. It had the same error that was fixed in the
ValueEnumerator in r266947: now, instead of pushing all operands on the
worklist at once, we pause whenever an operand gets pushed in order to
go depth-first (I know, it sounds obvious).
Sadly, I have no idea how to observe this from outside the algorithm and
so I haven't written a test. The output should be the same; it should
just use fewer temporary nodes now. I've added some comments that I
hope make the current logic clear enough it's unlikely to regress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266949
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Thu, 21 Apr 2016 01:59:39 +0000 (01:59 +0000)]
ThinLTO/ModuleLinker: add a flag to not always pull-in linkonce when performing importing
Summary:
The function importer already decided what symbols need to be pulled
in. Also these magically added ones will not be in the export list
for the source module, which can confuse the internalizer for
instance.
Reviewers: tejohnson, rafael
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19096
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266948
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 21 Apr 2016 01:55:12 +0000 (01:55 +0000)]
BitcodeWriter: Emit metadata in post-order (again)
Emit metadata nodes in post-order. The iterative algorithm from r266709
failed to maintain this property. After understanding my mistake, it
wasn't too hard to write a test with llvm-bcanalyzer (and I've actually
made this change once before: see r220340).
This also reverts the "noisy" testcase change from r266709. That should
have been more of a red flag :/.
Note: The same bug crept into the ValueMapper in r265456. I'm still
working on the fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266947
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 21 Apr 2016 01:54:13 +0000 (01:54 +0000)]
MachineSched: Cleanup; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266946
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 21 Apr 2016 00:53:14 +0000 (00:53 +0000)]
Add optimization for 'icmp slt (or A, B), A' and some related idioms based on knowledge of the sign bit for A and B.
No matter what value you OR in to A, the result of (or A, B) is going to be UGE A. When A and B are positive, it's SGE too. If A is negative, OR'ing a value into it can't make it positive, but can increase its value closer to -1, therefore (or A, B) is SGE A. Working through all possible combinations produces this truth table:
```
A is
+, -, +/-
F F F + B is
T F ? -
? F ? +/-
```
The related optimizations are flipping the 'slt' for 'sge' which always NOTs the result (if the result is known), and swapping the LHS and RHS while swapping the comparison predicate.
There are more idioms left to implement (aren't there always!) but I've stopped here because any more would risk becoming unreasonable for reviewers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266939
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Wed, 20 Apr 2016 23:36:23 +0000 (23:36 +0000)]
Refine instruction weight annotation algorithm for sample profiler.
Summary:
This patch refined the instruction weight anootation algorithm:
1. Do not use dbg_value intrinsics for annotation.
2. Annotate cold calls if the call is inlined in profile, but not inlined before preparation. This indicates that the annotation preparation step found no sample for the inlined callsite, thus the call should be very cold.
Reviewers: dnovillo, davidxl
Subscribers: mgrang, llvm-commits
Differential Revision: http://reviews.llvm.org/D19286
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266936
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Wed, 20 Apr 2016 23:10:14 +0000 (23:10 +0000)]
Fix another compilation error from r266919 for clang-atom-d525-fedora-rel which
is another place that libObject’s getName() for symbols returns Expected<...>
that needed to be updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266933
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 20 Apr 2016 22:44:40 +0000 (22:44 +0000)]
Fix compilation error in r266919.
lib/Object/MachOObjectFile.cpp:53:44: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
return malformedError(Obj.getFileName(), std::move(Msg.str()), ECOverride);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266930
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Wed, 20 Apr 2016 22:24:01 +0000 (22:24 +0000)]
[test/PGOProfile] Make tests independent of the raw profile version (NFC)
Differential Revision: http://reviews.llvm.org/D19290
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266928
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Wed, 20 Apr 2016 21:24:34 +0000 (21:24 +0000)]
Thread Expected<...> up from libObject’s getName() for symbols to allow llvm-objdump to produce a good error message.
Produce another specific error message for a malformed Mach-O file when a symbol’s
string index is past the end of the string table. The existing test case in test/Object/macho-invalid.test
for macho-invalid-symbol-name-past-eof now reports the error with the message indicating
that a symbol at a specific index has a bad sting index and that bad string index value.
Again converting interfaces to Expected<> from ErrorOr<> does involve
touching a number of places. Where the existing code reported the error with a
string message or an error code it was converted to do the same. There is some
code for this that could be factored into a routine but I would like to leave that for
the code owners post-commit to do as they want for handling an llvm::Error. An
example of how this could be done is shown in the diff in
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h which had a Check() routine
already for std::error_code so I added one like it for llvm::Error .
Also there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values. So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comment:
“// TODO: Actually report errors helpfully” and a call something like
consumeError(NameOrErr.takeError()) so the buggy code will not crash
since needed to deal with the Error.
Note there fixes needed to lld that goes along with this that I will commit right after this.
So expect lld not to built after this commit and before the next one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266919
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 20 Apr 2016 21:17:40 +0000 (21:17 +0000)]
[Hexagon] Add -mv.. options to override CPU selection
This is for compatibility with scripts that use -mv5, etc. with the
assembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266918
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 20:14:09 +0000 (20:14 +0000)]
IR: Use SmallVector instead of std::vector of TrackingMDRef
Don't use std::vector<TrackingMDRef>, since (at least in some versions
of libc++) std::vector apparently copies values on grow operations
instead of moving them. Found this when I was temporarily deleting the
copy constructor for TrackingMDRef to investigate a performance
bottleneck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266909
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 20:03:59 +0000 (20:03 +0000)]
IR: Stop copying vectors of TrackingMDRef in DIBuilder
No real functionality change here, just avoiding an unnecessary copy of
std::vector<TrackingMDRef> for every subprogram with variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266907
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 20 Apr 2016 20:02:58 +0000 (20:02 +0000)]
Rename asan-check-lifetime into asan-stack-use-after-scope
Summary:
This is done for consistency with asan-use-after-return.
I see no other users than tests.
Reviewers: aizatsky, kcc
Differential Revision: http://reviews.llvm.org/D19306
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266906
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 20 Apr 2016 19:16:23 +0000 (19:16 +0000)]
Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266905
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 20 Apr 2016 19:15:26 +0000 (19:15 +0000)]
[ValueTracking] Make isImpliedCondition return an Optional<bool>. NFC.
Phabricator Revision: http://reviews.llvm.org/D19277
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266904
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Wed, 20 Apr 2016 19:09:26 +0000 (19:09 +0000)]
Replace a loop with a for-each loop. No behavior change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266903
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 19:05:59 +0000 (19:05 +0000)]
IR: Avoid mallocs in constructor of ModuleSlotTracker
A ModuleSlotTracker can be created without actually being used (e.g.,
r266889 added one to the Verifier). Create the SlotTracker within it
lazily on the first call to ModuleSlotTracker::getMachine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266902
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 20 Apr 2016 18:45:31 +0000 (18:45 +0000)]
[MC] Silence warning due to unused variable in !Debug builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266901
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 18:42:51 +0000 (18:42 +0000)]
Verifier: Add ModuleSlotTracker to printAsOperand call
I missed this site in r266889.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266900
91177308-0d34-0410-b5e6-
96231b3b80d8
Jacques Pienaar [Wed, 20 Apr 2016 18:28:55 +0000 (18:28 +0000)]
[lanai] Add subword scheduling itineraries.
Differentiate between word and subword memory operations as they take different
amount of cycles to complete. This just adds a basic model of the subword
latency to the scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266898
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 18:27:18 +0000 (18:27 +0000)]
Verifier: Prefer early continue over if-nesting, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266897
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 20 Apr 2016 17:53:21 +0000 (17:53 +0000)]
[MC] EmitNop: Make an assertion more useful.
Differential Revision: http://reviews.llvm.org/D19334
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266895
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 17:48:22 +0000 (17:48 +0000)]
LTO: Verify the input even if optimize() isn't called
Clients may call writeMergedModules before calling optimize, or call
compileOptimized without calling optimize. Make sure they don't sneak
past the verifier. This adds LTOCodeGenerator::verifyMergedModuleOnce,
and calls it from writeMergedModule, optimize, and codegenOptimized.
I couldn't find a good way to test this. I tried writing broken IR to
send into llvm-lto, but LTOCodeGenerator doesn't understand textual IR,
and assembler runs the verifier itself anyway. Checking in
valid-but-doesn't-verify bitcode here doesn't seem valuable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266894
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 20 Apr 2016 17:47:42 +0000 (17:47 +0000)]
ModuleLinker: only import what is in GlobalsToImport, regarless if it is a function or not.
The alias handling was specific to the old iterative inlining
mechanism, so that is dead now. The variable handling could make a
difference, since we were previously falling through to the normal
selection logic, but we don't observe changes in the validation
because no client seems to rely on it.
Differential Revision: http://reviews.llvm.org/D19307
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266893
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 17:27:44 +0000 (17:27 +0000)]
IR: Use a single ModuleSlotTracker in the Verifier
Speed up Verifier output by sharing a single ModuleSlotTracker for the
duration. There should be no functionality change here except for much
faster output when there's more than one statement.
Now the Verifier won't be traversing the full Metadata graph every time
it prints an error. The TypePrinter is still not shared, but that would
take some extra plumbing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266889
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 16:17:37 +0000 (16:17 +0000)]
IR: Don't use raw_null_ostream in Verifier
While using a raw_null_ostream meant that the Verifier didn't have to
think about whether to print, it's actually quite expensive to print out
IR. Only print if the output is going somewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266884
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 15:55:24 +0000 (15:55 +0000)]
IR: Use default member initialization in Verifier, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266883
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 20 Apr 2016 15:54:13 +0000 (15:54 +0000)]
[Hexagon] Fix handling of lcomm directive
Patch by Colin LeMahieu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266882
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Wed, 20 Apr 2016 15:16:57 +0000 (15:16 +0000)]
Re-enable "[gold-plugin] Disable name for values other than GlobalValue"
This restores r266871 with a fix for gold tests relying on the value
names, when using a release compiler, by adding a way to disable the
default discarding. Update affected tests to use the new mechanism so
that value names are preserved as expected, regardless of how the
compiler was built.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266881
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Wed, 20 Apr 2016 14:39:45 +0000 (14:39 +0000)]
[ThinLTO] Prevent importing of "llvm.used" values
Summary:
This patch prevents importing from (and therefore exporting from) any
module with a "llvm.used" local value. Local values need to be promoted
and renamed when importing, and their presense on the llvm.used variable
indicates that there are opaque uses that won't see the rename. One such
example is a use in inline assembly.
See also the discussion at:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098047.html
As part of this, move collectUsedGlobalVariables out of Transforms/Utils
and into IR/Module so that it can be used more widely. There are several
other places in LLVM that used copies of this code that can be cleaned
up as a follow on NFC patch.
Reviewers: joker.eph
Subscribers: pcc, llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18986
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266877
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 20 Apr 2016 14:33:23 +0000 (14:33 +0000)]
[RDF] Consider register as live if any alias is live
This only affects the recomputation of kill flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266875
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Wed, 20 Apr 2016 14:07:46 +0000 (14:07 +0000)]
[mips][microMIPS] Implement BGEC, BGEUC, BLTC, BLTUC, BEQC and BNEC instructions
Differential Revision: http://reviews.llvm.org/D14206
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266873
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Wed, 20 Apr 2016 13:18:47 +0000 (13:18 +0000)]
Revert "[gold-plugin] Disable name for values other than GlobalValue"
This reverts commit r266871. Setting the default based on the NDEBUG
flag is causing test failures. Need to figure out whether to change this
approach or update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266872
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Wed, 20 Apr 2016 13:01:37 +0000 (13:01 +0000)]
[gold-plugin] Disable name for values other than GlobalValue
Summary:
Applies Mehdi's optimization (r263086) to disable value names other than
for GlobalValues to LTO/ThinLTO performed via the gold-plugin, in the
same manner as it is applied in libLTO.
Reviewers: rafael, joker-eph
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19269
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266871
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikolay Haustov [Wed, 20 Apr 2016 09:34:48 +0000 (09:34 +0000)]
AMDGPU/SI: Assembler: improvements to support trap handlers.
Add ParseAMDGPURegister which can be invoked recursively for parsing lists.
Rename getRegForName to getSpecialRegForName.
Support legacy SP3 register list syntax: [s2,s3,s4,s5] or [flat_scratch_lo,flat_scratch_hi].
Add 64-bit registers TBA, TMA where missing.
Add some tests.
Differential Revision: http://reviews.llvm.org/D19163
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266865
91177308-0d34-0410-b5e6-
96231b3b80d8
Asaf Badouh [Wed, 20 Apr 2016 08:32:57 +0000 (08:32 +0000)]
[X86] enable PIE for functions
Call locally defined function directly for PIE/fPIE
Differential Revision: http://reviews.llvm.org/D19226
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266863
91177308-0d34-0410-b5e6-
96231b3b80d8
Hrvoje Varga [Wed, 20 Apr 2016 06:34:48 +0000 (06:34 +0000)]
[mips][microMIPS]Implement CFC*, CTC* and LDC* instructions
Differential Revision: http://reviews.llvm.org/D18640
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266861
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 Apr 2016 05:19:01 +0000 (05:19 +0000)]
[AVX512] Add avx512cd+vl runs to vector-tzcnt-128/256 tests to show using the vplzcntd/q instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266860
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 Apr 2016 05:18:58 +0000 (05:18 +0000)]
[AVX512] Update vector-tzcnt-512 test to show how bad v32i16 and v64i8 is with avx512bw enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266859
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 Apr 2016 05:18:55 +0000 (05:18 +0000)]
[AVX512] Add popcount support for v32i16 and v64i8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266858
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 20 Apr 2016 04:18:11 +0000 (04:18 +0000)]
ThinLTO: never promote as external weak
This linkage is *not* intended to express that a declaration refers
to a weak symbol, but that the symbol might not be present at link
time. I don't believe it was the intent.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266856
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 20 Apr 2016 04:17:36 +0000 (04:17 +0000)]
FunctionImport: make sure we always select the right callee in presence of alias
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266854
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 Apr 2016 01:57:44 +0000 (01:57 +0000)]
[X86] Mark some floating point operations that are always expanded for vector types as Expand in a floating point only loop instead of looping through all vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266850
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 Apr 2016 01:57:42 +0000 (01:57 +0000)]
[X86] Don't mark vector loads and shifts Expand in advance. Loads are always marked Legal or Promote for all the legal types later. Shifts are always marked custom. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266849
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 Apr 2016 01:57:40 +0000 (01:57 +0000)]
[X86] Merge the two different SSE2 blocks in the X86TargetLowering constructor. Also qualfiy the XOP block with !useSoftFloat to match the other vector blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266848
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 20 Apr 2016 01:57:38 +0000 (01:57 +0000)]
[X86] Don't set vector FADD,FSUB,FMUL,FDIV,FNEG,FSQRT to Expand early. For every legal FP type we either set them to Legal or Custom anyway. So let them stay defaulted to Legal and only change when they need to be Custom.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266847
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 20 Apr 2016 01:04:26 +0000 (01:04 +0000)]
llvm-lto: run the module verifier when doing IR level work
It seems it was only running during CodeGen previously.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266846
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 20 Apr 2016 01:04:20 +0000 (01:04 +0000)]
ThinLTO: Move alias importing decision on the summary
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266845
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcin Koscielnicki [Wed, 20 Apr 2016 01:03:48 +0000 (01:03 +0000)]
[SystemZ] Add support for llvm.thread.pointer intrinsic.
Differential Revision: http://reviews.llvm.org/D19054
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266844
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Wed, 20 Apr 2016 01:02:12 +0000 (01:02 +0000)]
Add LLVMGetAttrKindID in the C API in order to facilitate migration away from LLVMAttribute
Summary:
LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values.
See D18749 for reference.
Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19081
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266842
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 20 Apr 2016 00:55:38 +0000 (00:55 +0000)]
MipsAsmParser::loadImmediate(): Prune an obsolete \param in r266602. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266841
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 20 Apr 2016 00:29:48 +0000 (00:29 +0000)]
IR: Use HANDLE_METADATA_LEAF to define MetadataKind enum, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266839
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 20 Apr 2016 00:24:21 +0000 (00:24 +0000)]
[libFuzzer] added -detect_leaks flag (0 by default for now). When enabled, it will help finding leaks while fuzzing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266838
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 20 Apr 2016 00:21:24 +0000 (00:21 +0000)]
ScoreboardHazardRecognizer: unbreak TSAN by moving a static mutated variable to a member
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266837
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 19 Apr 2016 23:59:13 +0000 (23:59 +0000)]
IR: Use std::vector instead of SmallPtrSet for distinct nodes, NFC
We never use the set-ness of SmallPtrSet for distinct nodes. Eventually
we may start garbage-collecting or reference-counting nodes (in which
cases we'd want to remove things from this collection, and a fast erase
would be valuable), but in the meantime a vector is sufficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266835
91177308-0d34-0410-b5e6-
96231b3b80d8
Mandeep Singh Grang [Tue, 19 Apr 2016 23:51:52 +0000 (23:51 +0000)]
[LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC.
Summary: Removed unwanted --check-prefix=CHECK from numerous unit tests.
Reviewers: t.p.northover, dblaikie, uweigand, MatzeB, tstellarAMD, mcrosier
Subscribers: mcrosier, dsanders
Differential Revision: http://reviews.llvm.org/D19279
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266834
91177308-0d34-0410-b5e6-
96231b3b80d8
Marcin Koscielnicki [Tue, 19 Apr 2016 23:46:59 +0000 (23:46 +0000)]
[Mips] [MSan] VarArgMIPS64Helper: Use target's endian, not host's.
Ugh.
Differential Revision: http://reviews.llvm.org/D19292
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266833
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 19 Apr 2016 22:37:44 +0000 (22:37 +0000)]
[libFuzzer] more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266830
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 19 Apr 2016 22:25:02 +0000 (22:25 +0000)]
ARM: fix assertion failure on -O0 cmpxchg.
Because lowering of CMP_SWAP_64 occurs during type legalization, there can be
i64 types produced by more than just a BUILD_PAIR or similar. My initial tests
used just incoming function args.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266828
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Tue, 19 Apr 2016 21:58:33 +0000 (21:58 +0000)]
Add IntrWrite[Arg]Mem intrinsic property
Summary:
This property is used to mark an intrinsic that only writes to memory, but
neither reads from memory nor has other side effects.
An example where this is useful is the llvm.amdgcn.buffer.store.format.*
intrinsic, which corresponds to a store instruction that goes through a special
buffer descriptor rather than through a plain pointer.
With this property, the intrinsic should still be handled as having side
effects at the LLVM IR level, but machine scheduling can make smarter
decisions.
Reviewers: tstellarAMD, arsenm, joker.eph, reames
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18291
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266826
91177308-0d34-0410-b5e6-
96231b3b80d8