summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Fix a case where instcombine was stripping metadata (and alignment)Dan Gohman2010-10-251-0/+21
| | | | | | from stores when folding in bitcasts. llvm-svn: 117265
* Fix PR8445: a block with no predecessors may be the entry block, in which caseDuncan Sands2010-10-241-0/+6
| | | | | | | | | it isn't unreachable and should not be zapped. The check for the entry block was missing in one case: a block containing a unwind instruction. While there, do some small cleanups: "M" is not a great name for a Function* (it would be more appropriate for a Module*), change it to "Fn"; use Fn in more places. llvm-svn: 117224
* Teach instcombine to set the alignment arguments for NEON load/store intrinsics.Bob Wilson2010-10-221-0/+25
| | | | llvm-svn: 117154
* GlobalOpt: EvaluateFunction() must not evaluate stores to weak_odr globals.Mikhail Glushenkov2010-10-191-0/+16
| | | | | | Fixes PR8389. llvm-svn: 116812
* Make BasicAliasAnalysis a normal AliasAnalysis implementation whichDan Gohman2010-10-1842-44/+44
| | | | | | | | | | | | does normal initialization and normal chaining. Change the default AliasAnalysis implementation to NoAlias. Update StandardCompileOpts.h and friends to explicitly request BasicAliasAnalysis. Update tests to explicitly request -basicaa. llvm-svn: 116720
* Generalize MemCpyOpt's handling of call slot forwarding to function properly ↵Owen Anderson2010-10-151-0/+25
| | | | | | | | when the call slot forwarding is implemented with a load/store pair rather than a memcpy. llvm-svn: 116637
* fix a bug I introduced, no idea how this didn't repro right.Chris Lattner2010-10-141-2/+1
| | | | llvm-svn: 116462
* hack to unbreak buildbotsChris Lattner2010-10-141-1/+2
| | | | llvm-svn: 116461
* add uadd_ov/usub_ov to apint, consolidate constant foldingChris Lattner2010-10-141-0/+11
| | | | | | | | | logic to use the new APInt methods. Among other things this implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold which comes from "clang -ftrapv", originally brought to my attention from PR8221. llvm-svn: 116457
* Now using a variant of the existing inlining heuristics to decide whether to ↵Kenneth Uildriks2010-10-091-0/+49
| | | | | | create a given specialization of a function in PartialSpecialization. If the total performance bonus across all callsites passing the same constant exceeds the specialization cost, we create the specialization. llvm-svn: 116158
* Remove LoopIndexSplit pass. It is neither maintained nor used by anyone.Devang Patel2010-10-0737-2372/+0
| | | | llvm-svn: 116004
* Now that the profitable bits of EnableFullLoadPRE have been enabled by ↵Owen Anderson2010-10-011-1/+1
| | | | | | | | | default, rip out the remainder. Anyone interested in more general PRE would be better served by implementing it separately, to get real anticipation calculation, etc. llvm-svn: 115337
* fix PR8267 - Instcombine shouldn't optimizer away volatile memcpy's.Chris Lattner2010-10-011-3/+12
| | | | llvm-svn: 115296
* upgrade this test.Chris Lattner2010-10-011-2/+2
| | | | llvm-svn: 115295
* We do want to allow LoadPRE to perform LICM-like transformations: we already ↵Owen Anderson2010-09-301-0/+39
| | | | | | | | | consider PHI nodes to be negligible for code size (making this transform code size neutral), and it allows us to hoist values out of loops, which is always a good thing. llvm-svn: 115205
* Add constant folding for strspn and strcspn to SimplifyLibCalls.Benjamin Kramer2010-09-301-0/+41
| | | | llvm-svn: 115116
* Add strpbrk folding to SimplifyLibCalls.Benjamin Kramer2010-09-291-0/+25
| | | | llvm-svn: 115111
* Simplify the loop in StrChrOptimizer. FileCheckize test.Benjamin Kramer2010-09-291-14/+14
| | | | llvm-svn: 115095
* Teach SimplifyLibCalls how to optimize strrchr.Benjamin Kramer2010-09-291-0/+23
| | | | llvm-svn: 115091
* Fix PR8247: JumpThreading can cause a block to become unreachable while ↵Owen Anderson2010-09-291-0/+27
| | | | | | | | | | still having predecessor, if it is part of a self-loop. Because of this, we cannot use the Simplify* APIs, as they can assert-fail on unreachable code. Since it's not easy to determine if a given threading will cause a block to become unreachable, simply defer simplifying simplification to later InstCombine and/or DCE passes. llvm-svn: 115082
* Don't try to constant fold libm functions with non-finite arguments.Jakob Stoklund Olesen2010-09-271-5/+0
| | | | | | | | Usually we wouldn't do this anyway because llvm_fenv_testexcept would return an exception, but we have seen some cases where neither errno nor fenv detect an exception on arm-linux. llvm-svn: 114893
* LoadPRE was not properly checking that the load it was PRE'ing ↵Owen Anderson2010-09-251-1/+13
| | | | | | | | | | | | | | 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
* Be more precise when trying to XFAIL this tester: ↵Jakob Stoklund Olesen2010-09-241-3/+4
| | | | | | http://google1.osuosl.org:8011/builders/llvm-arm-linux llvm-svn: 114755
* Attempt to XFAIL this test on arm-linux, which is inexplicably failing.Dan Gohman2010-09-181-0/+4
| | | | llvm-svn: 114241
* Fix this test to avoid an "inexact" fold.Dan Gohman2010-09-171-1/+1
| | | | llvm-svn: 114202
* Fix this test so that folding doesn't depend on a potentiallyDan Gohman2010-09-171-2/+2
| | | | | | "inexact" result. llvm-svn: 114198
* Fix the folding of floating-point math library calls, like sin(infinity),Dan Gohman2010-09-171-0/+19
| | | | | | | so that it detects errors on platforms where libm doesn't set errno. It's still subject to host libm details though. llvm-svn: 114148
* Add missing RUN line to this test.Owen Anderson2010-09-161-3/+1
| | | | llvm-svn: 114106
* It is possible, under specific circumstances involving ptrtoint ↵Owen Anderson2010-09-161-0/+84
| | | | | | | | | | | | ConstantExpr's, for LVI to end up trying to merge a Constant into a ConstantRange. Handle this conservatively for now, rather than asserting. The testcase is more complex that I would like, but the manifestation of the problem is sensitive to iteration orders and the state of the LVI cache, and I have not been able to reproduce it with manually constructed or simplified cases. Fixes PR8162. llvm-svn: 114103
* Fix PR8161, in which an unreachable loop causes recursive instruction ↵Owen Anderson2010-09-161-0/+20
| | | | | | | | simplification to try to replace an instruction with itself. Add a predicate to the simplifier to prevent this case. llvm-svn: 114097
* fix PR8144, a bug where constant merge would merge globals markedChris Lattner2010-09-151-0/+14
| | | | | | attribute(used). llvm-svn: 113911
* Remove dead option from tests.Owen Anderson2010-09-143-3/+3
| | | | llvm-svn: 113855
* fix PR8102, a case where we'd copyValue from a value that we alreadyChris Lattner2010-09-141-0/+20
| | | | | | | | 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
* Add a reduced testcase for the infinite loop fixed in r113763.Owen Anderson2010-09-131-0/+33
| | | | llvm-svn: 113770
* Re-apply r113679, which was reverted in r113720, which added a paid of new ↵Owen Anderson2010-09-133-17/+26
| | | | | | | | | 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-124-39/+17
| | | | | | 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-114-17/+39
| | | | | | | | | | | | | | 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
* Teach InstructionSimplify to fold (A & B) & A -> A & B and (A | B) | A -> A | B.Benjamin Kramer2010-09-102-0/+35
| | | | | | Reassociate does this but it doesn't catch all cases (e.g. if the operands are i1). llvm-svn: 113651
* Revert r113439, which relaxed the requirement that loops containing calls ↵Owen Anderson2010-09-091-51/+0
| | | | | | | | cannot be unrolled. After some discussion, there seems to be a better way to achieve the same effect. llvm-svn: 113528
* Relax the "don't unroll loops containing calls" rule. Instead, when a loop ↵Owen Anderson2010-09-081-0/+51
| | | | | | | | | 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-1/+347
| | | | | | single test. Patch by Dirk Steinke! llvm-svn: 113423
* Fix a serious performance regression introduced by r108687 on linux:Chris Lattner2010-09-071-3/+19
| | | | | | | | 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
* rename test.Chris Lattner2010-09-071-0/+0
| | | | llvm-svn: 113257
* fix PR8067, an over-aggressive assertion in LICM.Chris Lattner2010-09-061-0/+14
| | | | llvm-svn: 113146
* Teach loop rotate to hoist trivially invariant instructionsChris Lattner2010-09-061-0/+35
| | | | | | | | | | | | | | | 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
* fix PR8063, a crash in globalopt in the malloc analysis code.Chris Lattner2010-09-051-0/+15
| | | | llvm-svn: 113109
* Fix LoopSimplify to notify ScalarEvolution when splitting a loop backedgeDan Gohman2010-09-041-0/+50
| | | | | | | 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-0/+27
| | | | | | | | 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/+24
| | | | llvm-svn: 113025
* Add support for simplifying a load from a computed value to a load from a ↵Owen Anderson2010-09-031-0/+18
| | | | | | | | global when it is provable that they're equivalent. This fixes PR4855. llvm-svn: 112994
OpenPOWER on IntegriCloud