summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
...
* [IR] Remove some unneeded includes from Operator.h and fix cpp files that ↵Craig Topper2017-03-203-2/+2
| | | | | | were transitively depending on it. NFC llvm-svn: 298235
* [IR] Add missing copyright header.Craig Topper2017-03-201-0/+13
| | | | llvm-svn: 298234
* [APInt] Don't initialize VAL to 0 in APInt constructors. Push it down to the ↵Craig Topper2017-03-202-4/+7
| | | | | | | | | | initSlowCase and other init methods. I'm not sure if zeroing VAL before writing pVal is really necessary, but at least one other place did it in code. But by taking the store out of line, this reduces the opt binary by about 20k on my local x86-64 build. llvm-svn: 298233
* Remove unnecessary IDom checkXin Tong2017-03-201-3/+4
| | | | | | | | | | | | | | Summary: This Idom check seems unnecessary. The immediate children of a node on the Dominator Tree should always be the IDom of its immediate children in this case. Reviewers: hfinkel, majnemer, dberlin Reviewed By: dberlin Subscribers: dberlin, davide, llvm-commits Differential Revision: https://reviews.llvm.org/D26954 llvm-svn: 298232
* [InstCombine] Remove duplicate code in SimplifyDemandedUseBits for URem. NFCCraig Topper2017-03-191-2/+0
| | | | llvm-svn: 298231
* [AVX-512] Handle kor/kand/kandn/kxor/kxnor/knot intrinsics at lowering time ↵Craig Topper2017-03-194-47/+61
| | | | | | | | | | | | | | | | | | | instead of isel Summary: Currently we handle these intrinsics at isel with special patterns. But as they just map to normal logic operations, we should just handle them at lowering. This will expose them to DAG combine optimizations. Right now the kor-sequence test generates a bunch of regclass copies between GR16 and VK16 that the peephole optimizer and/or register coallescing are removing to keep everything in the mask domain. By handling the logic op intrinsics earlier, these copies become bitcasts in the DAG and get removed by DAG combine which seems more robust. This should help enable my plan to stop copying between K registers and GR8/GR16. The peephole optimizer can't remove a chain of copies between K and GR32 with insert_subreg/extract_subreg present in the chain so the kor-sequence test break. But this patch should dodge the problem entirely. Reviewers: zvi, delena, RKSimon, igorb Reviewed By: igorb Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31056 llvm-svn: 298228
* [InstCombine] Use update_test_checks.py to regenerate a test. NFCCraig Topper2017-03-191-78/+78
| | | | llvm-svn: 298227
* Fix constant folding of fp2int to large integersSimon Pilgrim2017-03-194-21/+25
| | | | | | | | | | | | We make the assumption in most of our constant folding code that a fp2int will target an integer of 128-bits or less, calling the APFloat::convertToInteger with only uint64_t[2] of raw bits for the result. Fuzz testing (PR24662) showed that we don't handle other cases at all, resulting in stack overflows and all sorts of crashes. This patch uses the APSInt version of APFloat::convertToInteger instead to better handle such cases. Differential Revision: https://reviews.llvm.org/D31074 llvm-svn: 298226
* Fix MSVC warning: "switch statement contains 'default' but no 'case' ↵Simon Pilgrim2017-03-191-4/+1
| | | | | | labels". NFCI. llvm-svn: 298225
* [GlobalISel] Don't select trivially dead instructions.Ahmed Bougacha2017-03-1915-26/+166
| | | | | | | | | | | | | | Folding instructions when selecting can cause them to become dead. Don't select these dead instructions (if they don't have other side effects, and don't define physical registers). Preserve existing tests by adding COPYs. In some tests, the G_CONSTANT vregs never get constrained to a class: the only use of the vreg was folded into another instruction, so the G_CONSTANT, now dead, never gets selected. llvm-svn: 298224
* [GlobalISel][AArch64] Add DBG_VALUE select test. NFC.Ahmed Bougacha2017-03-191-0/+47
| | | | llvm-svn: 298223
* [GlobalISel][AArch64] Split out cast select tests. NFC.Ahmed Bougacha2017-03-195-405/+437
| | | | | | | | | | | | And remove some redundant bitcast tests. Also split the test functions themselves: it makes it obvious to see what's tested where and what isn't, it makes the tests much easier to read and manually update, and, most importantly, it makes them almost trivial to update using tooling. Yes, it's obnoxiously verbose, but said tooling helps upgrade to better MIR syntax whenever available. llvm-svn: 298222
* [GlobalISel] Move method definition to the proper file. NFC.Ahmed Bougacha2017-03-192-19/+21
| | | | llvm-svn: 298221
* [CodeGen] Update hasSideEffects comment. NFC.Ahmed Bougacha2017-03-191-5/+2
| | | | | | | We used to have 3 side effect flags, but as of r222809, we only have hasSideEffects. Change the comment to reflect that. llvm-svn: 298220
* Correct a rebase mistake.Xin Tong2017-03-191-2/+2
| | | | | | Left out AA in jumpthreading SimplifyPartiallyRedundantLoad llvm-svn: 298219
* Remove unused arguments. NFCIXin Tong2017-03-191-1/+1
| | | | llvm-svn: 298218
* [JumpThreading] Perform phi-translation in SimplifyPartiallyRedundantLoad.Xin Tong2017-03-192-18/+68
| | | | | | | | | | | | | | | | | | | Summary: In case we are loading on a phi-load in SimplifyPartiallyRedundantLoad. Try to phi translate it into incoming values in the predecessors before we search for available loads. This needs https://reviews.llvm.org/D30524 Reviewers: davide, sanjoy, efriedma, dberlin, rengolin Reviewed By: dberlin Subscribers: junbuml, llvm-commits Differential Revision: https://reviews.llvm.org/D30543 llvm-svn: 298217
* Extract FindAvailablePtrLoadStore out of FindAvailableLoadedValue. NFCIXin Tong2017-03-192-14/+46
| | | | | | | | | | | | | | | | | | | Summary: Extract FindAvailablePtrLoadStore out of FindAvailableLoadedValue. Prepare for upcoming change which will do phi-translation for load on phi pointer in jump threading SimplifyPartiallyRedundantLoad. This is in preparation for https://reviews.llvm.org/D30543 Reviewers: efriedma, sanjoy, davide, dberlin Reviewed By: davide Subscribers: junbuml, davide, llvm-commits Differential Revision: https://reviews.llvm.org/D30524 llvm-svn: 298216
* Enable stripping of multiple DILocation on !llvm.loop metadataTeresa Johnson2017-03-192-10/+57
| | | | | | | | | | | | | | | | | Summary: I found that stripDebugInfo was still leaving significant amounts of debug info due to !llvm.loop that contained DILocation after stripping. The support for stripping debug info on !llvm.loop added in r293377 only removes a single DILocation. Enhance that to remove all DILocation from !llvm.loop. Reviewers: hfinkel, aprantl, dsanders Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31117 llvm-svn: 298213
* [MIR] Test assumes x64 windows calling convention upon printing/parsing MIR ↵Oren Ben Simhon2017-03-191-2/+2
| | | | | | output/input. llvm-svn: 298212
* [MIR] Add triple to test that assumes it runs on windows.Benjamin Kramer2017-03-191-1/+1
| | | | llvm-svn: 298211
* CalleeSavedRegister was removed from MIR and is recalculated upon MIR parsing.Oren Ben Simhon2017-03-191-16/+0
| | | | llvm-svn: 298210
* Moving the test to x86 because other architectures do not suport regcall ↵Oren Ben Simhon2017-03-191-0/+0
| | | | | | calling convention. llvm-svn: 298209
* [MIR] Support Customed Register Mask and CSRsOren Ben Simhon2017-03-198-144/+127
| | | | | | | | | | | | | The MIR printer dumps a string that describe the register mask of a function. A static predefined list of register masks matches a static list of strings. However when the register mask is not from the static predefined list, there is no descriptor string and the printer fails. This patch adds support to custom register mask printing and dumping. Also the list of callee saved registers (describing the registers that must be preserved for the caller) might be dynamic. As such this data needs to be dumped and parsed back to the Machine Register Info. Differential Revision: https://reviews.llvm.org/D30971 llvm-svn: 298207
* [InstCombine] Use setHighBits/setLowBits/setBitsFrom in place of ↵Craig Topper2017-03-191-17/+14
| | | | | | getLowBitsSet/getHighBitsSet. llvm-svn: 298204
* [Analysis] bitreverse(undef) returns undefBrian Gesiak2017-03-192-1/+16
| | | | | | | | | | | | | | | | Summary: The reverse of an artbitrary bitpattern is also an arbitrary bitpattern. Reviewers: trentxintong, arsenm, majnemer Reviewed By: majnemer Subscribers: majnemer, wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D31118 llvm-svn: 298201
* NewGVN: Now that we have a better verifier, we can prove that we can erase ↵Daniel Berlin2017-03-191-1/+3
| | | | | | the predicateuser set each time we mark it touched llvm-svn: 298199
* NewGVN: Remove dead code (for now)Daniel Berlin2017-03-191-4/+0
| | | | llvm-svn: 298198
* [GVN] Fix accidental double storage of the function BasicBlock list in ↵Craig Topper2017-03-182-13/+8
| | | | | | | | | | | | | | | | | | | | | iterateOnFunction Summary: iterateOnFunction creates a ReversePostOrderTraversal object which does a post order traversal in its constructor and stores the results in an internal vector. Iteration over it just reads from the internal vector in reverse order. The GVN code seems to be unaware of this and iterates over ReversePostOrderTraversal object and makes a copy of the vector into a local vector. (I think at one point in time we used a DFS here instead which would have required the local vector). The net affect of this is that we have two vectors containing the basic block list. As I didn't want to expose the implementation detail of ReversePostOrderTraversal's constructor to GVN, I've changed the code to do an explicit post order traversal storing into the local vector and then reverse iterate over that. I've also removed the reserve(256) since the ReversePostOrderTraversal wasn't doing that. I can add it back if we thinks it important. Though it seemed weird that it wasn't based on the size of the function. Reviewers: davide, anemet, dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31084 llvm-svn: 298191
* [ValueTracking] Remove deadish code from computeKnownBitsAddSub.Craig Topper2017-03-181-24/+0
| | | | | | The code assigned to KnownZero, but later code unconditionally assigned over it. I'm pretty sure the later code can handle the same cases and more equally well. llvm-svn: 298190
* NewGVN: Greatly enhance the ability of the NewGVN verifier to detectDaniel Berlin2017-03-182-87/+151
| | | | | | issues, subsuming previous verifier. llvm-svn: 298188
* NewGVN: Fix PHI evaluation bug exposed by new verifier. We were checking ↵Daniel Berlin2017-03-182-4/+66
| | | | | | whether the incoming block was reachable instead of whether the specific edge was reachable llvm-svn: 298187
* DebugCounters: Add API for setting/unsetting programatically.Daniel Berlin2017-03-181-5/+26
| | | | | | | This is required so we can re-set the counter state for verifiers, etc. llvm-svn: 298186
* ExecutionDepsFix: Let targets specialize the pass; NFCMatthias Braun2017-03-185-221/+261
| | | | | | | | Let targets specialize the pass with the register class so we can get a parameterless default constructor and can put the pass into the pass registry to enable testing with -run-pass=. llvm-svn: 298184
* ExecutionDepsFix: Normalize names; NFCMatthias Braun2017-03-188-46/+44
| | | | | | | Normalize ExeDepsFix, execution-fix, ExecutionDependencyFix and ExecutionDepsFix to the last one. llvm-svn: 298183
* CodeGen.cpp: Sort alphabetically; NFCMatthias Braun2017-03-181-6/+6
| | | | llvm-svn: 298182
* InitializePasses.h: Cleanup; NFCMatthias Braun2017-03-181-58/+58
| | | | | | | - Sort alphabetically - Normalize spaces llvm-svn: 298181
* [ValueTracking] Add APInt::setSignBit and use it to replace ORing with ↵Craig Topper2017-03-182-6/+11
| | | | | | getSignBit which will malloc if the bit width is larger than 64. llvm-svn: 298180
* Make library calls sensitive to regparm module flag (Fixes PR3997).Nirav Dave2017-03-1825-123/+219
| | | | | | | | | | Reviewers: mkuper, rnk Subscribers: mehdi_amini, jyknight, aemerson, llvm-commits, rengolin Differential Revision: https://reviews.llvm.org/D27050 llvm-svn: 298179
* Capitalize ArgListEntry fields. NFC.Nirav Dave2017-03-1814-138/+145
| | | | llvm-svn: 298178
* [LockFileManager] Reduce lock timeoutBruno Cardoso Lopes2017-03-181-3/+3
| | | | | | | | | | Go back to behavior pre-r231309 and reduce the timeout from 8 to ~1.5 min now that we have (a) PCMCache mechanism (r298165) and (b) timeout that doesn't cause a failure, but actually build the module (r298175). rdar://problem/30297862 llvm-svn: 298176
* [AMDGPU] Add address space based alias analysis passStanislav Mekhanoshin2017-03-1710-11/+314
| | | | | | | | | This is direct port of HSAILAliasAnalysis pass, just cleaned for style and renamed. Differential Revision: https://reviews.llvm.org/D31103 llvm-svn: 298172
* [BuildLibCalls] emitPutChar should infer function attributes for putcharCraig Topper2017-03-171-0/+1
| | | | | | | | | | When InstCombine calls into SimplifyLibCalls and it createa putChar calls, we don't infer the attributes. And since SimplifyLibCalls doesn't use InstCombine's IRBuilder the calls doesn't end up in the worklist on this iteration of InstCombine. So it gets picked up on the next iteration where it causes an IR change. This of course causes InstCombine to run another iteration. So this patch just gets the attributes right the first time. We already did this for puts and some other libcalls. Differential Revision: https://reviews.llvm.org/D31094 llvm-svn: 298171
* [x86] regenerate checks; NFCSanjay Patel2017-03-171-89/+162
| | | | llvm-svn: 298166
* [x86] regenerate checks; NFCSanjay Patel2017-03-171-110/+198
| | | | llvm-svn: 298164
* Fix docs-llvm-html build.Evgeniy Stepanov2017-03-171-1/+2
| | | | llvm-svn: 298163
* [Outliner] Add outliner for AArch64Jessica Paquette2017-03-173-11/+346
| | | | | | | | | | | | | | | | | This commit adds the necessary target hooks for outlining in AArch64. It also refactors the switch statement used in `getMemOpBaseRegImmOfsWidth` into a more general function, `getMemOpInfo`. This allows the outliner to share that code without copying and pasting it. The AArch64 outliner can be run using -mllvm -enable-machine-outliner, as with the X86-64 outliner. The test for this pass verifies that the outliner does, in fact outline functions, fixes up the stack accesses properly, and can correctly generate a tail call. In the future, this test should be replaced with a MIR test, so that we can properly test immediate offset overflows in fixed-up instructions. llvm-svn: 298162
* [SCEV] Use const Loop *L instead of Loop *L. NFCEli Friedman2017-03-172-12/+14
| | | | | | | | Use const pointer in the trip count and trip multiple calculations. Patch by Huihui Zhang <huihuiz@codeaurora.org> llvm-svn: 298161
* [asan] Fix dead stripping of globals on Linux.Evgeniy Stepanov2017-03-177-57/+162
| | | | | | | | | | | | | | | | | | | | | Use a combination of !associated, comdat, @llvm.compiler.used and custom sections to allow dead stripping of globals and their asan metadata. Sometimes. Currently this works on LLD, which supports SHF_LINK_ORDER with sh_link pointing to the associated section. This also works on BFD, which seems to treat comdats as all-or-nothing with respect to linker GC. There is a weird quirk where the "first" global in each link is never GC-ed because of the section symbols. At this moment it does not work on Gold (as in the globals are never stripped). Differential Revision: https://reviews.llvm.org/D30121 llvm-svn: 298158
* Add !associated metadata.Evgeniy Stepanov2017-03-176-16/+119
| | | | | | | | | | | | | | | | This is an ELF-specific thing that adds SHF_LINK_ORDER to the global's section pointing to the metadata argument's section. The effect of that is a reverse dependency between sections for the linker GC. !associated does not change the behavior of global-dce. The global may also need to be added to llvm.compiler.used. Since SHF_LINK_ORDER is per-section, !associated effectively enables fdata-sections for the affected globals, the same as comdats do. Differential Revision: https://reviews.llvm.org/D29104 llvm-svn: 298157
OpenPOWER on IntegriCloud