summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* [DSE] Avoid iterator invalidation bugs.Chad Rosier2016-07-061-83/+0
| | | | | | | | | | The dse_with_dbg_value.ll test committed with r273141 is removed because this we no longer performs any type of back tracking, which is what was causing the codegen differences with and without debug information. Differential Revision: http://reviews.llvm.org/D21613 llvm-svn: 274660
* Work around PR28400 a bit harder.Sean Silva2016-07-061-0/+19
| | | | | | | | | | We were still crashing in the "no change" case because LVI was not getting invalidated. See the thread "Should analyses be able to hold AssertingVH to IR? (related to PR28400)" for more discussion. llvm-svn: 274656
* [TTI] The cost model should not assume vector casts get completely scalarizedMichael Kuperstein2016-07-061-3/+3
| | | | | | | | | | | | | | | | The cost model should not assume vector casts get completely scalarized, since on targets that have vector support, the common case is a partial split up to the legal vector size. So, when a vector cast gets split, the resulting casts end up legal and cheap. Instead of pessimistically assuming scalarization, base TTI can use the costs the concrete TTI provides for the split vector, plus a fudge factor to account for the cost of the split itself. This fudge factor is currently 1 by default, except on AMDGPU where inserts and extracts are considered free. Differential Revision: http://reviews.llvm.org/D21251 llvm-svn: 274642
* [LV] Don't widen trivial induction variablesMatthew Simpson2016-07-064-16/+198
| | | | | | | | | | | | | | | | | | | | We currently always vectorize induction variables. However, if an induction variable is only used for counting loop iterations or computing addresses with getelementptr instructions, we don't need to do this. Vectorizing these trivial induction variables can create vector code that is difficult to simplify later on. This is especially true when the unroll factor is greater than one, and we create vector arithmetic when computing step vectors. With this patch, we check if an induction variable is only used for counting iterations or computing addresses, and if so, scalarize the arithmetic when computing step vectors instead. This allows for greater simplification. This patch addresses the suboptimal pointer arithmetic sequence seen in PR27881. Reference: https://llvm.org/bugs/show_bug.cgi?id=27881 Differential Revision: http://reviews.llvm.org/D21620 llvm-svn: 274627
* Vector GEP test: renamed + some commentsElena Demikhovsky2016-07-061-1/+8
| | | | | | Differential revision: http://reviews.llvm.org/D21957 llvm-svn: 274611
* Fix handling of forward unreachable but reverse-reachable blocks in ↵Daniel Berlin2016-07-061-0/+23
| | | | | | MemorySSA construction llvm-svn: 274606
* [InstCombine] enable vector select of bools -> logic foldsSanjay Patel2016-07-031-8/+11
| | | | llvm-svn: 274465
* add vector bool select tests and regenerate checks for scalar bool select testsSanjay Patel2016-07-031-59/+139
| | | | llvm-svn: 274460
* Remove dead TLI arg of isKnownNonNull and propagate deadness. NFC.Sean Silva2016-07-022-2/+2
| | | | | | | | | | | | | | This actually uncovered a surprisingly large chain of ultimately unused TLI args. From what I can gather, this argument is a remnant of when isKnownNonNull would look at the TLI directly. The current approach seems to be that InferFunctionAttrs runs early in the pipeline and uses TLI to annotate the TLI-dependent non-null information as return attributes. This also removes the dependence of functionattrs on TLI altogether. llvm-svn: 274455
* [PM] Port ConstantHoisting to the new Pass ManagerMichael Kuperstein2016-07-021-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D21945 llvm-svn: 274411
* Address two correctness issues in LoadStoreVectorizerAlina Sbirlea2016-07-014-3/+56
| | | | | | | | | | | | | | Summary: GetBoundryInstruction returns the last instruction as the instruction which follows or end(). Otherwise the last instruction in the boundry set is not being tested by isVectorizable(). Partially solve reordering of instructions. More extensive solution to follow. Reviewers: tstellarAMD, llvm-commits, jlebar Subscribers: escha, arsenm, mzolotukhin Differential Revision: http://reviews.llvm.org/D21934 llvm-svn: 274389
* Revert "add tests for bugs fixed by the GVN hoist pass"Duncan P. N. Exon Smith2016-07-012-104/+0
| | | | | | | | | | This reverts commit r274327 since the tests fail. E.g.: http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/17240 It looks like this commit is building on r274305, but that commit caused a miscompile and was reverted in r274320. llvm-svn: 274332
* add tests for bugs fixed by the GVN hoist passSebastian Pop2016-07-012-0/+104
| | | | | | | https://llvm.org/bugs/show_bug.cgi?id=20242 https://llvm.org/bugs/show_bug.cgi?id=22005 llvm-svn: 274327
* LoadStoreVectorizer: Don't increase alignment with no align setMatt Arsenault2016-07-013-17/+60
| | | | | | | If no alignment was set on the load/stores, it would vectorize to the new type even though this increases the default alignment. llvm-svn: 274323
* LoadStoreVectorizer: Check TTI for vec reg bit widthMatt Arsenault2016-07-012-1/+53
| | | | llvm-svn: 274322
* LoadStoreVectorizer: Fix assert when merging pointer opsMatt Arsenault2016-07-011-0/+311
| | | | | | | This needs to use inttoptr/ptrtoint if combining an int and pointer load. If a pointer is used always do an integer load. llvm-svn: 274321
* Revert "code hoisting pass based on GVN"Duncan P. N. Exon Smith2016-07-011-650/+0
| | | | | | | | | | | | This reverts commit r274305, since it breaks self-hosting: http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/22349/ http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/17232 Note that the blamelist on lab.llvm.org:8011 is incorrect. The previous build was r274299, but somehow r274305 wasn't included in the blamelist: http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules llvm-svn: 274320
* LoadStoreVectorizer: Use AA metadataMatt Arsenault2016-07-011-0/+32
| | | | | | | This was not passing the full instruction with metadata to the alias query. llvm-svn: 274318
* LoadStoreVectorizer: if one element of a vector is integer, default toMatt Arsenault2016-07-011-1/+1
| | | | | | | | | | | | integer. Fixes issues on some architectures where we use arithmetic ops to build vectors, which can cause bad things to happen for loads/stores of mixed types. Patch by Fiona Glaser llvm-svn: 274307
* LoadStoreVectorizer: Fix crashes on sub-byte typesMatt Arsenault2016-07-011-0/+199
| | | | llvm-svn: 274306
* code hoisting pass based on GVNSebastian Pop2016-07-011-0/+650
| | | | | | | | | | | | | This pass hoists duplicated computations in the program. The primary goal of gvn-hoist is to reduce the size of functions before inline heuristics to reduce the total cost of function inlining. Pass written by Sebastian Pop, Aditya Kumar, Xiaoyu Hu, and Brian Rzycki. Important algorithmic contributions by Daniel Berlin under the form of reviews. Differential Revision: http://reviews.llvm.org/D19338 llvm-svn: 274305
* LoadStoreVectorizer: Check skipFunction first.Matt Arsenault2016-06-301-0/+10
| | | | | | Also add test I forgot to add to r274296. llvm-svn: 274299
* LoadStoreVectorizer: Skip optnone functionsMatt Arsenault2016-06-301-0/+12
| | | | llvm-svn: 274296
* Add LoadStoreVectorizer passMatt Arsenault2016-06-307-0/+989
| | | | | | | This was contributed by Apple, and I've been working on minimal cleanups and generalizing it. llvm-svn: 274293
* SLPVectorizer: Move propagateMetadata to VectorUtilsMatt Arsenault2016-06-301-0/+25
| | | | | | | | This will be re-used by the LoadStoreVectorizer. Fix handling of range metadata and testcase by Justin Lebar. llvm-svn: 274281
* Refine the set of UniformAfterVectorization instructions.Wei Mi2016-06-301-0/+50
| | | | | | | | | | Except the seed uniform instructions (conditional branch and consecutive ptr instructions), dependencies to be added into uniform set should only be used by existing uniform instructions or intructions outside of current loop. Differential Revision: http://reviews.llvm.org/D21755 llvm-svn: 274262
* [DSE] Fix bug in partial overwrite trackingJun Bum Lim2016-06-301-0/+39
| | | | | | | | | | | | | | Summary: Found cases where DSE incorrectly add partially-overwritten intervals. Please see the test case for details. Reviewers: mcrosier, eeckstein, hfinkel Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D21859 llvm-svn: 274237
* [InstCombine] shrink switch conditions better (PR24766)Sanjay Patel2016-06-302-40/+23
| | | | | | | | | | | | | | https://llvm.org/bugs/show_bug.cgi?id=24766#c2 This removes a hack that was added for the benefit of x86 codegen. It prevented shrinking the switch condition even to smaller legal (DataLayout) types. We have a safety mechanism in CGP after: http://reviews.llvm.org/rL251857 ...so we're free to use the optimal (smallest) IR type now. Differential Revision: http://reviews.llvm.org/D12965 llvm-svn: 274233
* [InstCombine] extend matchSelectFromAndOr() to work with i1 scalar typesSanjay Patel2016-06-301-19/+10
| | | | | | | | If the incoming types are i1, then we don't have to pattern match any sext ops. Differential Revision: http://reviews.llvm.org/D21740 llvm-svn: 274228
* add vector tests to show missing transformSanjay Patel2016-06-301-0/+38
| | | | llvm-svn: 274192
* regenerate checksSanjay Patel2016-06-291-27/+75
| | | | llvm-svn: 274188
* StackColoring for SafeStack.Evgeniy Stepanov2016-06-292-0/+526
| | | | | | | | | | | | | | | | This is a fix for PR27842. An IR-level implementation of stack coloring tailored to work with SafeStack. It is a bit weaker than the MI implementation in that it does not the "lifetime start at first access" logic. This can be improved in the future. This patch also replaces the naive implementation of stack frame layout with a greedy algorithm that can split existing stack slots and even fit small objects inside the alignment padding of other objects. llvm-svn: 274162
* [InstCombine] Simplify and correct folding fcmps with the same childrenTim Shen2016-06-292-476/+203
| | | | | | | | | | | | | | Summary: Take advantage of FCmpInst::Predicate's bit pattern and handle (fcmp *, x, y) | (fcmp *, x, y) and (fcmp *, x, y) & (fcmp *, x, y) more consistently. Also fold more FCmpInst::FCMP_FALSE and FCmpInst::FCMP_TRUE to constants. Currently InstCombine wrongly folds (fcmp ogt, x, y) | (fcmp ord, x, y) to (fcmp ogt, x, y); this patch also fixes that. Reviewers: spatel Subscribers: llvm-commits, iteratee, echristo Differential Revision: http://reviews.llvm.org/D21775 llvm-svn: 274156
* [InstCombine, NFC] Change the generated variable names by creating new ↵Tim Shen2016-06-291-24/+24
| | | | | | | | instructions This removes some noise for D21775's test changes. llvm-svn: 274155
* [InstCombine] Add full tests for FoldAndOfFCmps and FoldOrOfFCmpsTim Shen2016-06-292-104/+3156
| | | | | | | | | | | | Summary: This adds tests for covering all cases that FoldAndOfFCmps and FoldOrOfFCmps handle. Reviewers: spatel Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21844 llvm-svn: 274144
* Reverted patch 273864Elena Demikhovsky2016-06-292-44/+0
| | | | llvm-svn: 274115
* Revert "[ValueTracking] Teach computeKnownBits for PHI nodes to compute sign ↵Craig Topper2016-06-292-116/+1
| | | | | | | | bit for a recurrence with a NSW addition." This is breaking an optimizaton remark test in clang. I've identified a couple fixes for that, but want to understand it better before I commit to anything. llvm-svn: 274102
* [ValueTracking] Teach computeKnownBits for PHI nodes to compute sign bit for ↵Craig Topper2016-06-292-1/+116
| | | | | | | | | | | | a recurrence with a NSW addition. If a operation for a recurrence is an addition with no signed wrap and both input sign bits are 0, then the result sign bit must also be 0. Similar for the negative case. I found this deficiency while playing around with a loop in the x86 backend that contained a signed division that could be optimized into an unsigned division if we could prove both inputs were positive. One of them being the loop induction variable. With this patch we can perform the conversion for this case. One of the test cases here is a contrived variation of the loop I was looking at. Differential revision: http://reviews.llvm.org/D21493 llvm-svn: 274098
* Revert "[InstCombine] Avoid combining the bitcast of a var that is used as ↵Eric Christopher2016-06-292-113/+0
| | | | | | | | | | | | both address and result of load instructions" Revert "[InstCombine] Combine A->B->A BitCast" as this appears to cause PR27996 and as discussed in http://reviews.llvm.org/D20847 This reverts commits r270135 and r263734. llvm-svn: 274094
* [ARM] Fix 28282: cost computation for constant hoistingWeiming Zhao2016-06-281-0/+17
| | | | | | | | | | | | | | | | | Summary: This fixes bug: https://llvm.org/bugs/show_bug.cgi?id=28282 Currently the cost model of constant hoisting checks the bit width of the data type of the constants. However, the actual immediate value is small enough and not need to be hoisted. This patch checks for the actual bit width needed for the constant. Reviewers: t.p.northover, rengolin Subscribers: aemerson, rengolin, llvm-commits Differential Revision: http://reviews.llvm.org/D21668 llvm-svn: 274073
* minimize regression tests and update checksSanjay Patel2016-06-281-42/+40
| | | | llvm-svn: 274047
* minimize regression tests and update checksSanjay Patel2016-06-281-70/+74
| | | | llvm-svn: 274046
* Support arbitrary addrspace pointers in masked load/store intrinsicsArtur Pilipenko2016-06-283-42/+117
| | | | | | | | | | | | | | This is a resubmittion of 263158 change after fixing the existing problem with intrinsics mangling (see LTO and intrinsics mangling llvm-dev thread for details). This patch fixes the problem which occurs when loop-vectorize tries to use @llvm.masked.load/store intrinsic for a non-default addrspace pointer. It fails with "Calling a function with a bad signature!" assertion in CallInst constructor because it tries to pass a non-default addrspace pointer to the pointer argument which has default addrspace. The fix is to add pointer type as another overloaded type to @llvm.masked.load/store intrinsics. Reviewed By: reames Differential Revision: http://reviews.llvm.org/D17270 llvm-svn: 274043
* [LLE] Don't hoist conditionally executed loadsAdam Nemet2016-06-281-0/+42
| | | | | | | | If the load is conditional we can't hoist its 0-iteration instance to the preheader because that would make it unconditional. Thus we would access a memory location that the original loop did not access. llvm-svn: 273991
* Fix size computation of array allocation in inline cost analysisEaswaran Raman2016-06-271-0/+36
| | | | | | Differential revision: http://reviews.llvm.org/D21690 llvm-svn: 273952
* [InstCombine] shrink type of sdiv if dividend is sexted and constant divisor ↵Sanjay Patel2016-06-271-9/+21
| | | | | | | | | | | is small enough (PR28153) This should fix PR28153: https://llvm.org/bugs/show_bug.cgi?id=28153 Differential Revision: http://reviews.llvm.org/D21769 llvm-svn: 273951
* add tests for PR28153Sanjay Patel2016-06-271-0/+76
| | | | llvm-svn: 273936
* Fixed crash of SLP Vectorizer on KNLElena Demikhovsky2016-06-271-0/+17
| | | | | | | The bug is connected to vector GEPs. https://llvm.org/bugs/show_bug.cgi?id=28313 llvm-svn: 273919
* [InstCombine] use m_APInt for div --> ashr foldSanjay Patel2016-06-271-0/+9
| | | | | | The APInt matcher works with splat vectors, so we get this fold for vectors too. llvm-svn: 273897
* Revert -r273892 "Support arbitrary addrspace pointers in masked load/store ↵Artur Pilipenko2016-06-273-117/+42
| | | | | | intrinsics" since some of the clang tests don't expect to see the updated signatures. llvm-svn: 273895
OpenPOWER on IntegriCloud