aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms
AgeCommit message (Collapse)Author
2009-09-08Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08Fix PR4909, patch by Jakub Staszak.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08remove an extremely dubious instcombine transformation ofChris Lattner
extractelement(load). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08Trim unnecessary declarations.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08Change these tests to feed the assembly files to opt directly, insteadDan Gohman
of using llvm-as, now that opt supports this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08Re-apply r80926, with fixes: keep the domtree informed of new blocksDan Gohman
that get created during loop unswitching, and fix SplitBlockPredecessors' LCSSA updating code to create new PHIs instead of trying to just move existing ones. Also, optimize Loop::verifyLoop, since it gets called a lot. Use searches on a sorted list of blocks instead of calling the "contains" function, as is done in other places in the Loop class, since "contains" does a linear search. Also, don't call verifyLoop from LoopSimplify or LCSSA, as the PassManager is already calling verifyLoop as part of LoopInfo's verifyAnalysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08instcombine transforms vector loads that are only used byChris Lattner
extractelement operations into a bitcast of the pointer, then a gep, then a scalar load. Disable this when the vector only has one element, because it leads to infinite loops in instcombine (PR4908). This transformation seems like a really bad idea to me, as it will likely disable CSE of vector load/stores etc and can be better done in the code generator when profitable. This goes all the way back to the first days of packed types, r25299 specifically. I'll let those people who care about the performance of vector code decide what to do with this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08Fix PR4882, by making MemCpyOpt not dereference removed stores to get theChris Lattner
context for the newly created operations. Patch by Jakub Staszak! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08fix ComputeMaskedBits handling of zext/sext/trunc to work with vectors.Chris Lattner
This fixes PR4905 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07Add a testcase for the GlobalOpt inbounds fix.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07Add inbounds to these getelementptrs, now that GlobalOpt requires this,Dan Gohman
to preserve the meaning of these tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07tighten test.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07tweak test, add PR#Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07Don't depend on Tcl behavior of redirecting stderr for all commands in aDaniel Dunbar
pipeline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06Revert r80926. It causes loop unswitch assertion and slow down some JIT ↵Evan Cheng
tests significantly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-05Quote another '%S' in a test.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-05Eliminate uses of %prcontext.Daniel Dunbar
- I'd appreciate it if someone else eyeballs my changes to make sure I captured the intent of the test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-05Eliminate some Tclisms.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04While replacing an MDNode elment, properly update MDNode's operand list. Devang Patel
MDNode's operand list does not include all elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03Change PHINode::hasConstantValue to have a DominatorTree argumentDan Gohman
instead of a bool argument, and to do the dominator check itself. This makes it eaiser to use when DominatorTree information is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03In C++, code is not allowed to call main. In C it is, thisChris Lattner
simplifylibcalls optimization is thus valid for C++ but not C. It's not important enough to worry about for C++ apps, so just remove it. rdar://7191924 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02Fix month.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80769 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02fix PR4815: some cases where DeleteDeadInstruction can deleteChris Lattner
the instruction BBI points to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02fix PR4848 an infinite loop when indexing down through a recursive gepChris Lattner
and we get the original pointer type. This doesn't mean that we're at the first pointer being indexed. Correct the predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02fix PR4837, some bugs folding vector compares. TheseChris Lattner
return a vector of i1, not i1 itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01enhance memcpy opt to turn memmoves into memcpy when the src/destChris Lattner
don't alias. Remove an old and poorly reduced testcase that fails with this transform for reasons unrelated to the original test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01testcase for PR3601Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01Change CallGraphNode to maintain it's Function as an AssertingVHChris Lattner
for sanity. This didn't turn up any bugs. Change CallGraphNode to maintain its "callsite" information in the call edges list as a WeakVH instead of as an instruction*. This fixes a broad class of dangling pointer bugs, and makes CallGraph have a number of useful invariants again. This fixes the class of problem indicated by PR4029 and PR3601. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31fix a crash building SPASS by tolerating a callsite that doesn't existChris Lattner
in the callgraph, see the big comment at the top of the testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31fix a bug I introduced with my 'instcombine builder' refactoring Chris Lattner
changes: SimplifyDemandedBits can't use the builder yet because it has the wrong insertion point. This fixes a crash building MultiSource/Benchmarks/PAQ8p git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31Fix PR4834, a tricky case where the inliner would resolve anChris Lattner
indirect function pointer, inline it, then go to delete the body. The problem is that the callgraph had other references to the function, though the inliner had no way to know it, so we got a dangling pointer and an invalid iterator out of the deal. The fix to this is pretty simple: stop the inliner from deleting the function by knowing that there are references to it. Do this by making CallGraphNodes contain a refcount. This requires moving deletion of available_externally functions to the module-level cleanup sweep where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30rename testChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30merge all sinking tests into one and convert them to filecheck.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30convert scalar_promote to filecheck style and merge ↵Chris Lattner
2003-12-13-VolatilePromote.ll into it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30suck a bunch more gep tests into getelementptr.ll and filecheckize them all.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30consolodate various GEP tests into getelementptr.ll using filecheck.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30another huge testcase, this time from 'gs' in llvm-test.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30remove another poorly-reduced testcase which came from ldecod in llvm-test.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30this testcase is 500 lines long and is distilled from bzip2, justChris Lattner
remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30convert to filecheckChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30Fix PR4748: don't fold gep(bitcast(x)) into bitcast(gep) when x Chris Lattner
is itself a bitcast. Since we have gep(bitcast(bitcast(y))) in this case, just wait for the two bitcasts to get zapped. This prevents instcombine from confusing some aliasing stuff, and allows it to directly eliminate the load in the testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28Reapply 79977.Devang Patel
Use MDNodes to encode debug info in llvm IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28Fix PR3913, patch by Jakub Staszak!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27Implement a new optimization in the inliner: if inlining multipleChris Lattner
calls into a function and if the calls bring in arrays, try to merge them together to reduce stack size. For example, in the testcase we'd previously end up with 4 allocas, now we end up with 2 allocas. As described in the comments, this is not really the ideal solution to this problem, but it is surprisingly effective. For example, on 176.gcc, we end up eliminating 67 arrays at "gccas" time and another 24 at "llvm-ld" time. One piece of concern that I didn't look into: at -O0 -g with forced inlining this will almost certainly result in worse debug info. I think this is acceptable though given that this is a case of "debugging optimized code", and we don't want debug info to prevent the optimizer from doing things anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27the inliner shouldn't crash on this.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80214 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25Special-case static allocas in IndVarSimplify's loop invariantDan Gohman
sinking code, since they are special. If the loop preheader happens to be the entry block of a function, don't sink static allocas out of it. This fixes PR4775. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25Remove obsolete -f flags.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25Update DebugInfo interface to use metadata, instead of special named ↵Devang Patel
llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well. This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-21Change getelementptr folding to use APInt instead of uint64_t forDan Gohman
offset computations. This fixes a truncation bug on targets that don't have 64-bit pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79639 91177308-0d34-0410-b5e6-96231b3b80d8