summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Delete an unused function.Dan Gohman2010-09-271-2/+0
| | | | llvm-svn: 114841
* LoadPRE was not properly checking that the load it was PRE'ing ↵Owen Anderson2010-09-251-1/+7
| | | | | | | | | | | | | | post-dominated the block it was being hoisted to. Splitting critical edges at the merge point only addressed part of the issue; it is also possible for non-post-domination to occur when the path from the load to the merge has branches in it. Unfortunately, full anticipation analysis is time-consuming, so for now approximate it. This is strictly more conservative than real anticipation, so we will miss some cases that real PRE would allow, but we also no longer insert loads into paths where they didn't exist before. :-) This is a very slight net positive on SPEC for me (0.5% on average). Most of the benchmarks are largely unaffected, but when it pays off it pays off decently: 181.mcf improves by 4.5% on my machine. llvm-svn: 114785
* If we're changing the source of a memcpy we need to use the alignmentEric Christopher2010-09-251-3/+5
| | | | | | | | | of the source, not the original alignment since it may no longer be valid. Fixes rdar://8400094 llvm-svn: 114781
* Get rid of pop_macro warnings on MSVC.Michael J. Spencer2010-09-241-9/+10
| | | | llvm-svn: 114750
* Fix llvm-extract so that it changes the linkage of all GlobalValues toBob Wilson2010-09-231-16/+14
| | | | | | | "external" even when doing lazy bitcode loading. This was broken because a function that is not materialized fails the !isDeclaration() test. llvm-svn: 114666
* Disable codegen prepare critical edge splitting. Machine instruction passes nowEvan Cheng2010-09-231-1/+5
| | | | | | break critical edges on demand. llvm-svn: 114633
* When moving zext/sext to be folded with a load, ignore the issue of whetherBob Wilson2010-09-221-1/+2
| | | | | | | | truncates are free only in the case where the extended type is legal but the load type is not. If both types are illegal, such as when they are too big, the load may not be legalized into an extended load. llvm-svn: 114568
* Move a sign-extend or a zero-extend of a load to the same basic block as theBob Wilson2010-09-211-1/+2
| | | | | | | load when the type of the load is not legal, even if truncates are not free. The load is going to be legalized to an extending load anyway. llvm-svn: 114488
* Clarify a comment.Bob Wilson2010-09-211-1/+1
| | | | llvm-svn: 114487
* do not rely on the implicit-dereference semantics of dyn_cast_or_nullGabor Greif2010-09-181-1/+1
| | | | llvm-svn: 114278
* do not rely on the implicit-dereference semantics of dyn_cast_or_nullGabor Greif2010-09-181-4/+4
| | | | llvm-svn: 114277
* Use a depth-first iteratation in CorrelatedValuePropagation to avoid wasting ↵Owen Anderson2010-09-161-2/+6
| | | | | | | | time trying to optimize unreachable blocks. llvm-svn: 114105
* When substituting sunkaddrs into indirect arguments an asm, we wereDale Johannesen2010-09-161-2/+4
| | | | | | | | | walking the asm arguments once and stashing their Values. This is wrong because the same memory location can be in the list twice, and if the first one has a sunkaddr substituted, the stashed value for the second one will be wrong (use-after-free). PR 8154. llvm-svn: 114104
* fix PR8144, a bug where constant merge would merge globals markedChris Lattner2010-09-151-1/+27
| | | | | | attribute(used). llvm-svn: 113911
* Remove the option to disable LazyValueInfo in JumpThreading, as it is nowOwen Anderson2010-09-141-110/+37
| | | | | | on by default and has received significant testing. llvm-svn: 113852
* fix PR8102, a case where we'd copyValue from a value that we alreadyChris Lattner2010-09-141-11/+11
| | | | | | | | deleted. Fix this by doing the copyValue's before we delete stuff! The testcase only repros the problem on my system with valgrind. llvm-svn: 113820
* Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."Michael J. Spencer2010-09-135-34/+5
| | | | | | | | | | This reverts commit r113632 Conflicts: cmake/modules/AddLLVM.cmake llvm-svn: 113819
* Remove unused variable.Eric Christopher2010-09-131-1/+0
| | | | llvm-svn: 113769
* Added skeleton for inline asm multiple alternative constraint support.John Thompson2010-09-132-48/+9
| | | | llvm-svn: 113766
* Re-apply r113679, which was reverted in r113720, which added a paid of new ↵Owen Anderson2010-09-131-5/+31
| | | | | | | | | instcombine transforms to expose greater opportunities for store narrowing in codegen. This patch fixes a potential infinite loop in instcombine caused by one of the introduced transforms being overly aggressive. llvm-svn: 113763
* Revert 113679, it was causing an infinite loop in a testcase that I've sentEric Christopher2010-09-121-30/+5
| | | | | | on to Owen. llvm-svn: 113720
* Invert and-of-or into or-of-and when doing so would allow us to clear bits ↵Owen Anderson2010-09-111-5/+30
| | | | | | | | | | | | | | of the and's mask. This can result in increased opportunities for store narrowing in code generation. Update a number of tests for this change. This fixes <rdar://problem/8285027>. Additionally, because this inverts the order of ors and ands, some patterns for optimizing or-of-and-of-or no longer fire in instances where they did originally. Add a simple transform which recaptures most of these opportunities: if we have an or-of-constant-or and have failed to fold away the inner or, commute the order of the two ors, to give the non-constant or a chance for simplification instead. llvm-svn: 113679
* typoesGabor Greif2010-09-103-6/+6
| | | | llvm-svn: 113647
* CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.Michael J. Spencer2010-09-105-5/+34
| | | | llvm-svn: 113632
* This transform is also performed by InstructionSimplify, remove the duplicate.Benjamin Kramer2010-09-101-3/+0
| | | | llvm-svn: 113608
* Lower the unrolling theshold to 150. Empirical tests indicate that this is ↵Owen Anderson2010-09-101-1/+1
| | | | | | | | a sweet spot in the performance per code size increase curve. llvm-svn: 113595
* 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
OpenPOWER on IntegriCloud