summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* What the loop unroller cares about, rather than just not unrolling loops ↵Owen Anderson2010-09-091-5/+5
| | | | | | | | | | | with calls, is not unrolling loops that contain calls that would be better off getting inlined. This mostly comes up when an interleaved devirtualization pass has devirtualized a call which the inliner will inline on a future pass. Thus, rather than blocking all loops containing calls, add a metric for "inline candidate calls" and block loops containing those instead. llvm-svn: 113535
* Revert r113439, which relaxed the requirement that loops containing calls ↵Owen Anderson2010-09-091-4/+2
| | | | | | | | cannot be unrolled. After some discussion, there seems to be a better way to achieve the same effect. llvm-svn: 113528
* r113526 introduced an unintended change to the loop unrolling threshold. ↵Owen Anderson2010-09-091-1/+1
| | | | | | Revert it. llvm-svn: 113527
* Fix typo in code to cap the loop code size reduction calculation.Owen Anderson2010-09-091-2/+2
| | | | llvm-svn: 113526
* Use code-size reduction metrics to estimate the amount of savings we'll get ↵Owen Anderson2010-09-091-1/+24
| | | | | | | | when we unroll a loop. Next step is to recalculate the threshold values given this new heuristic. llvm-svn: 113525
* Relax the "don't unroll loops containing calls" rule. Instead, when a loop ↵Owen Anderson2010-09-081-2/+4
| | | | | | | | | contains a call, lower the unrolling threshold to the optimize-for-size threshold. Basically, for loops containing calls, unrolling can still be profitable as long as the loop is REALLY small. llvm-svn: 113439
* Generalize instcombine's support for combining multiple bit checks into a ↵Owen Anderson2010-09-081-32/+278
| | | | | | single test. Patch by Dirk Steinke! llvm-svn: 113423
* Add a separate unrolling threshold when the current function is being ↵Owen Anderson2010-09-071-4/+20
| | | | | | | | | | optimized for size. The threshold value of 50 is arbitrary, and I chose it simply by analogy to the inlining thresholds, where the baseline unrolling threshold is slightly smaller than the baseline inlining threshold. This could undoubtedly use some tuning. llvm-svn: 113306
* Fix a serious performance regression introduced by r108687 on linux:Chris Lattner2010-09-071-1/+6
| | | | | | | | turning (fptrunc (sqrt (fpext x))) -> (sqrtf x) is great, but we have to delete the original sqrt as well. Not doing so causes us to do two sqrt's when building with -fmath-errno (the default on linux). llvm-svn: 113260
* Fix major bug in thunk detection. Also verify the calling convention.Nick Lewycky2010-09-071-22/+39
| | | | | | | | | Switch from isWeakForLinker to mayBeOverridden which is more accurate. Add more statistics and debugging info. Add comments. Move static function outside anonymous namespace. llvm-svn: 113190
* fix PR8067, an over-aggressive assertion in LICM.Chris Lattner2010-09-061-4/+4
| | | | llvm-svn: 113146
* Teach loop rotate to hoist trivially invariant instructionsChris Lattner2010-09-061-10/+27
| | | | | | | | | | | | | | | in the duplicated block instead of duplicating them. Duplicating them into the end of the loop and the preheader means that we got a phi node in the header of the loop, which prevented LICM from hoisting them. GVN would usually come around later and merge the duplicated instructions so we'd get reasonable output... except that anything dependent on the shoulda-been-hoisted value can't be hoisted. In PR5319 (which this fixes), a memory value didn't get promoted. llvm-svn: 113134
* pull a simple method out of LICM into a new Chris Lattner2010-09-061-16/+1
| | | | | | | | | | Loop::hasLoopInvariantOperands method. Remove a useless and confusing Loop::isLoopInvariant(Instruction) method, which didn't do what you thought it did. No functionality change. llvm-svn: 113133
* more cleanupsChris Lattner2010-09-051-52/+38
| | | | llvm-svn: 113115
* Change lower atomic pass to use IntrinsicInst to simplify it a bit.Chris Lattner2010-09-052-41/+30
| | | | llvm-svn: 113114
* eliminate some non-obvious casts. UndefValue isa Constant.Chris Lattner2010-09-051-4/+4
| | | | llvm-svn: 113113
* Fix warning reported by MSVC++ builder.Nick Lewycky2010-09-051-2/+2
| | | | llvm-svn: 113106
* Switch FnSet to containing the ComparableFunction instead of a pointer to one.Nick Lewycky2010-09-051-36/+67
| | | | | | This reduces malloc traffic (yay!) and removes MergeFunctionsEqualityInfo. llvm-svn: 113105
* Fix many bugs when merging weak-strong and weak-weak pairs. We now merge allNick Lewycky2010-09-051-98/+183
| | | | | | | strong functions first to make sure they're the canonical definitions and then do a second pass looking only for weak functions. llvm-svn: 113104
* zap dead code.Chris Lattner2010-09-041-3/+2
| | | | llvm-svn: 113073
* Fix LoopSimplify to notify ScalarEvolution when splitting a loop backedgeDan Gohman2010-09-041-1/+10
| | | | | | | into an inner loop, as the new loop iteration may differ substantially. This fixes PR8078. llvm-svn: 113057
* fix a bug in my licm rewrite when a load from the promoted memoryChris Lattner2010-09-041-3/+29
| | | | | | | | location is being re-stored to the memory location. We would get a dangling pointer from the SSAUpdate data structure and miss a use. This fixes PR8068 llvm-svn: 113042
* Propagate non-local comparisons. Fixes PR1757.Owen Anderson2010-09-031-0/+48
| | | | llvm-svn: 113025
* Add support for simplifying a load from a computed value to a load from a ↵Owen Anderson2010-09-031-6/+34
| | | | | | | | global when it is provable that they're equivalent. This fixes PR4855. llvm-svn: 112994
* fix more AST updating bugs, correcting miscompilation in PR8041Chris Lattner2010-09-021-2/+4
| | | | llvm-svn: 112878
* Reapply commit 112699, speculatively reverted by echristo, sinceDuncan Sands2010-09-026-20/+18
| | | | | | | | | I'm sure it is harmless. Original commit message: If PrototypeValue is erased in the middle of using the SSAUpdator then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112810
* deepen my MMX/SRoA hack to avoid hurting non-x86 codegen.Chris Lattner2010-09-011-2/+8
| | | | llvm-svn: 112763
* Fix loop unswitching's assumption that a code path which eitherDan Gohman2010-09-011-9/+8
| | | | | | infinite loops or exits will eventually exit. This fixes PR5373. llvm-svn: 112745
* JumpThreading keeps LazyValueInfo up to date, so we don't need to rerun itOwen Anderson2010-09-011-1/+3
| | | | | | if we schedule another LVI-using pass afterwards. llvm-svn: 112722
* Speculatively revert 112699 and 112702, they seem to be causingEric Christopher2010-09-016-18/+20
| | | | | | self host errors on clang-x86-64. llvm-svn: 112719
* If PrototypeValue is erased in the middle of using the SSAUpdatorDuncan Sands2010-09-016-20/+18
| | | | | | | then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112699
* add a gross hack to work around a problem that Argiris reportedChris Lattner2010-09-011-6/+25
| | | | | | | | | | | | | on llvmdev: SRoA is introducing MMX datatypes like <1 x i64>, which then cause random problems because the X86 backend is producing mmx stuff without inserting proper emms calls. In the short term, force off MMX datatypes. In the long term, the X86 backend should not select generic vector types to MMX registers. This is being worked on, but won't be done in time for 2.8. rdar://8380055 llvm-svn: 112696
* Revert 112442 and 112440 until the compile time problems introducedDan Gohman2010-09-011-106/+50
| | | | | | by 112440 are resolved. llvm-svn: 112692
* licm is wasting time hoisting constant foldable operations,Chris Lattner2010-08-311-4/+16
| | | | | | | instead of hoisting them, just fold them away. This occurs in the testcase for PR8041, for example. llvm-svn: 112669
* tidy upChris Lattner2010-08-311-31/+32
| | | | llvm-svn: 112643
* More cleanups of my JumpThreading transforms, including extracting some ↵Owen Anderson2010-08-311-37/+26
| | | | | | duplicated code into a helper function. llvm-svn: 112634
* Add an RAII helper to make cleanup of the RecursionSet more fool-proof.Owen Anderson2010-08-311-18/+24
| | | | llvm-svn: 112628
* Only try to clean up the current block if we changed that block already.Owen Anderson2010-08-311-5/+11
| | | | llvm-svn: 112625
* Refactor my fix for PR5652 to terminate the predecessor lookups after the ↵Owen Anderson2010-08-311-25/+24
| | | | | | first failure. llvm-svn: 112620
* Fix an infinite loop; merging two functions will create a new function (if theNick Lewycky2010-08-311-31/+45
| | | | | | | | | two are weak, we make them thunks to a new strong function) so don't iterate through the function list as we're modifying it. Also add back the outermost loop which got removed during the cleanups. llvm-svn: 112595
* Don't perform an extra traversal of the function just to do cleanup. We can ↵Owen Anderson2010-08-311-5/+4
| | | | | | safely simplify instructions after each block has been processed without worrying about iterator invalidation. llvm-svn: 112594
* Rename ValuePropagation to a more descriptive CorrelatedValuePropagation.Owen Anderson2010-08-311-12/+12
| | | | llvm-svn: 112591
* Rename file to something more descriptive.Owen Anderson2010-08-312-1/+1
| | | | llvm-svn: 112590
* More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly ↵Owen Anderson2010-08-311-26/+64
| | | | | | | | | constant-fold undef, and be more careful with its return value. This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's handling of and/or of i1's), but never manifested before. This patch adds a tracking set to prevent this case. llvm-svn: 112589
* Switch to DenseSet, simplifying much more code. We now have a single iterationNick Lewycky2010-08-311-78/+83
| | | | | | | where we hash, compare and fold, instead of one iteration where we build up the hash buckets and a second one to fold. llvm-svn: 112582
* Remove r111665, which implemented store-narrowing in InstCombine. Chris ↵Owen Anderson2010-08-311-47/+0
| | | | | | | | discovered a miscompilation in it, and it's not easily fixable at the optimizer level. I'll investigate reimplementing it in DAGCombine. llvm-svn: 112575
* Fix a typo.Owen Anderson2010-08-301-1/+1
| | | | llvm-svn: 112560
* Cleanups suggested by Chris.Owen Anderson2010-08-301-20/+18
| | | | llvm-svn: 112553
* Re-apply r112539, being more careful to respect the return values of the ↵Owen Anderson2010-08-301-22/+25
| | | | | | | | constant folding methods. Additionally, use the ConstantExpr::get*() methods to simplify some constant folding. llvm-svn: 112550
* Add statistics to evaluate this pass.Owen Anderson2010-08-301-0/+8
| | | | llvm-svn: 112545
OpenPOWER on IntegriCloud