summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r166407 because it caused analyzer tests to crash and broke self-host ↵Argyrios Kyrtzidis2012-10-221-67/+56
| | | | | | bots. llvm-svn: 166424
* BBVectorize should ignore unreachable blocks.Hal Finkel2012-10-221-0/+13
| | | | | | | | | Unreachable blocks can have invalid instructions. For example, jump threading can produce self-referential instructions in unreachable blocks. Also, we should not be spending time optimizing unreachable code. Fixes PR14133. llvm-svn: 166423
* Rename a variable.Nadav Rotem2012-10-221-13/+13
| | | | llvm-svn: 166410
* Vectorizer: optimize the generation of selects. If the condition is uniform, ↵Nadav Rotem2012-10-221-6/+16
| | | | | | generate a scalar-cond select (i1 as selector). llvm-svn: 166409
* Update the loop vectorizer docs.Nadav Rotem2012-10-221-17/+38
| | | | llvm-svn: 166408
* Reapply r166405, teaching tailcallelim to be smarter about nocapture, with aNick Lewycky2012-10-221-56/+67
| | | | | | | | | | | | | | | very small but very important bugfix: bool shouldExplore(Use *U) { Value *V = U->get(); if (isa<CallInst>(V) || isa<InvokeInst>(V)) [...] should have read: bool shouldExplore(Use *U) { Value *V = U->getUser(); if (isa<CallInst>(V) || isa<InvokeInst>(V)) Fixes PR14143! llvm-svn: 166407
* Revert r166405, "Teach TailRecursionElimination to consider 'nocapture' when ↵NAKAMURA Takumi2012-10-221-67/+56
| | | | | | | | deciding whether" It broke selfhosting stage2 in several builders. llvm-svn: 166406
* Teach TailRecursionElimination to consider 'nocapture' when deciding whetherNick Lewycky2012-10-211-56/+67
| | | | | | calls can be marked tail. llvm-svn: 166405
* Revert r166390 "LoopIdiom: Replace custom dependence analysis with ↵Benjamin Kramer2012-10-211-26/+74
| | | | | | | | | | | | | LoopDependenceAnalysis." It passes all tests, produces better results than the old code but uses the wrong pass, LoopDependenceAnalysis, which is old and unmaintained. "Why is it still in tree?", you might ask. The answer is obviously: "To confuse developers." Just swapping in the new dependency pass sends the pass manager into an infinte loop, I'll try to figure out why tomorrow. llvm-svn: 166399
* Avoid an extra hash lookup when inserting a value into the widen map.Anders Carlsson2012-10-211-4/+4
| | | | llvm-svn: 166395
* Simplify code. No functionality change.Jakub Staszak2012-10-211-1/+1
| | | | llvm-svn: 166393
* Simplify code. No functionality change.Jakub Staszak2012-10-211-6/+5
| | | | llvm-svn: 166392
* LoopIdiom: Replace custom dependence analysis with LoopDependenceAnalysis.Benjamin Kramer2012-10-211-74/+26
| | | | | | | | | | Requires a lot less code and complexity on loop-idiom's side and the more precise analysis can catch more cases, like the one I included as a test case. This also fixes the edge-case miscompilation from PR9481. I'm not entirely sure that all cases are handled that the old checks handled but LDA will certainly become smarter in the future. llvm-svn: 166390
* Fix a bug in the vectorization of wide load/store operations.Nadav Rotem2012-10-211-4/+14
| | | | | | | | We used a SCEV to detect that A[X] is consecutive. We assumed that X was the induction variable. But X can be any expression that uses the induction for example: X = i + 2; llvm-svn: 166388
* Add support for reduction variables that do not start at zero.Nadav Rotem2012-10-211-51/+67
| | | | | | | | | | | | This is important for nested-loop reductions such as : In the innermost loop, the induction variable does not start with zero: for (i = 0 .. n) for (j = 0 .. m) sum += ... llvm-svn: 166387
* Document change. Describe the pass and some papers that inspired the design ↵Nadav Rotem2012-10-211-4/+18
| | | | | | of the pass. llvm-svn: 166386
* Vectorizer: fix a bug in the classification of induction/reduction phis.Nadav Rotem2012-10-211-0/+3
| | | | llvm-svn: 166384
* Fix an infinite loop in the loop-vectorizer.Nadav Rotem2012-10-201-0/+6
| | | | | | PR14134. llvm-svn: 166379
* SROA: Simplify code. No functionality change.Benjamin Kramer2012-10-201-9/+2
| | | | llvm-svn: 166375
* InstCombine: Fix an edge case where constant icmps could sneak into ↵Benjamin Kramer2012-10-201-0/+4
| | | | | | | | ConstantFoldInstOperands and crash. Have to refactor the ConstantFolder interface one day to define bugs like this away. Fixes PR14131. llvm-svn: 166374
* Vectorize: teach cavVectorizeMemory to distinguish between A[i]+=x and ↵Nadav Rotem2012-10-201-74/+137
| | | | | | | | | A[B[i]]+=x. If the pointer is consecutive then it is safe to read and write. If the pointer is non-loop-consecutive then it is unsafe to vectorize it because we may hit an ordering issue. llvm-svn: 166371
* Fix a typoNadav Rotem2012-10-201-1/+1
| | | | llvm-svn: 166367
* Vectorizer: refactor the memory checks to a new function. No functionality ↵Nadav Rotem2012-10-201-33/+51
| | | | | | change. llvm-svn: 166366
* LoopVectorize: Keep the IRBuilder on the stack.Nadav Rotem2012-10-191-40/+35
| | | | llvm-svn: 166354
* Vectorizer: Add support for loop reductions.Nadav Rotem2012-10-191-74/+392
| | | | | | | | | For example: for (i=0; i<n; i++) sum += A[i] + B[i] + i; llvm-svn: 166351
* revert r166264 because the LTO build is still failingNadav Rotem2012-10-192-88/+78
| | | | llvm-svn: 166340
* SimplifyLibcalls: The return value of ffsll is always i32, even when the ↵Benjamin Kramer2012-10-191-2/+2
| | | | | | | | input is zero. Fixes PR13028. llvm-svn: 166313
* Indvars: Don't recursively delete instruction during BB iteration.Benjamin Kramer2012-10-191-3/+5
| | | | | | | This can invalidate the iterators leading to use after frees and crashes. Fixes PR12536. llvm-svn: 166291
* [ASan] Support comments in ASan/TSan blacklist file as lines starting with #Alexey Samsonov2012-10-192-0/+5
| | | | llvm-svn: 166283
* Move SplitBlockAndInsertIfThen to BasicBlockUtils.Evgeniy Stepanov2012-10-192-35/+43
| | | | llvm-svn: 166278
* LoopVectorize: Keep the IRBuilder on the stack.Benjamin Kramer2012-10-191-41/+36
| | | | | | No functionality change. llvm-svn: 166274
* [asan] make sure asan erases old unused allocas after it created a new one. ↵Kostya Serebryany2012-10-191-0/+4
| | | | | | This became important after the recent move from ModulePass to FunctionPass because no cleanup is happening after asan pass any more. llvm-svn: 166267
* recommit the patch that makes LSR and LowerInvoke use the TargetTransform ↵Nadav Rotem2012-10-192-78/+88
| | | | | | interface. llvm-svn: 166264
* vectorizer: Add support for reading and writing from the same memory location.Nadav Rotem2012-10-191-2/+9
| | | | llvm-svn: 166255
* cleanup the comment.Nadav Rotem2012-10-181-1/+1
| | | | llvm-svn: 166247
* fix a naming typoNadav Rotem2012-10-181-6/+4
| | | | llvm-svn: 166232
* Avoid reconstructing the pointer set when searching for duplicated ↵Nadav Rotem2012-10-181-10/+7
| | | | | | read/write pointers. llvm-svn: 166205
* Cosmetic change -- move two simplifiers to the right commented statement group.Meador Inge2012-10-181-2/+2
| | | | llvm-svn: 166199
* instcombine: Migrate strcpy optimizationsMeador Inge2012-10-182-48/+50
| | | | | | | | | | | | This patch migrates the strcpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. Note also that StrCpyChkOpt has been updated with a few simplifications that were being done in the simplify-libcalls version of StrCpyOpt, but not in the migrated implementation of StrCpyOpt. There is no reason to overload StrCpyOpt with fortified and regular simplifications in the new model since there is already a dedicated simplifier for __strcpy_chk. llvm-svn: 166198
* When looking for a vector representation of a scalar, do a single lookup. ↵Nadav Rotem2012-10-181-7/+14
| | | | | | | | Also, cache the result of the broadcast instruction. No functionality change. llvm-svn: 166191
* Refactor insert and extract of sub-integers into static helpers thatChandler Carruth2012-10-181-68/+84
| | | | | | | | | | | | | operate purely on values. Sink the alloca loading and storing logic into the rewrite routines that are specific to alloca-integer-rewrite driving. This is just a refactoring here, but the subsequent step will be to reuse the insertion and extraction logic when rewriting integer loads and stores that have been split and decomposed into narrower loads and stores. No functionality changed other than different names for instructions. llvm-svn: 166176
* This FIXME was fixed some time ago. =]Chandler Carruth2012-10-181-3/+0
| | | | llvm-svn: 166175
* Introduce a BarrierNoop pass, a hack designed to allow *some* controlChandler Carruth2012-10-183-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | over the implicitly-formed-and-nesting CGSCC pass manager and function pass managers, especially when using them on the opt commandline or using extension points in the module builder. The '-barrier' opt flag (or the pass itself) will create a no-op module pass in the pipeline, resetting the pass manager stack, and allowing the creation of a new pipeline of function passes or CGSCC passes to be created that is independent from any previous pipelines. For example, this can be used to test running two CGSCC passes in independent CGSCC pass managers as opposed to in the same CGSCC pass manager. It also allows us to introduce a further hack into the PassManagerBuilder to separate the O0 pipeline extension passes from the always-inliner's CGSCC pass manager, which they likely do not want to participate in... At the very least none of the Sanitizer passes want this behavior. This fixes a bug with ASan at O0 currently, and I'll commit the ASan test which covers this pass. I'm happy to add a test case that this pass exists and works, but not sure how much time folks would like me to spend adding test cases for the details of its behavior of partition pass managers.... The whole thing is just vile, and mostly intended to unblock ASan, so I'm hoping to rip this all out in a brave new pass manager world. llvm-svn: 166172
* remove unused variable to fix a warning.Nadav Rotem2012-10-181-2/+1
| | | | llvm-svn: 166170
* Temporarily revert the TargetTransform changes.Bob Wilson2012-10-182-88/+78
| | | | | | | | | | | The TargetTransform changes are breaking LTO bootstraps of clang. I am working with Nadav to figure out the problem, but I am reverting it for now to get our buildbots working. This reverts svn commits: 165665 165669 165670 165786 165787 165997 and I have also reverted clang svn 165741 llvm-svn: 166168
* Remove the use of dominators and AA.Nadav Rotem2012-10-181-8/+0
| | | | llvm-svn: 166167
* Vectorizer: Add support for loops with an unknown count. For example:Nadav Rotem2012-10-181-68/+159
| | | | | | | | for (i=0; i<n; i++){ a[i] = b[i+1] + c[i+3]; } llvm-svn: 166165
* LoopVectorize.cpp: Fix a warning. [-Wunused-variable]NAKAMURA Takumi2012-10-171-2/+1
| | | | llvm-svn: 166153
* Remove redundant SetInsertPoint call.Jakub Staszak2012-10-171-1/+0
| | | | llvm-svn: 166138
* Fix some typos and wrong indenting.Roman Divacky2012-10-171-4/+4
| | | | llvm-svn: 166128
OpenPOWER on IntegriCloud