summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verifyDan Gohman2009-09-037-131/+196
| | | | | | | | | that these passes are properly preserved. Fix several transformation passes that claimed to preserve LoopSimplify form but weren't. llvm-svn: 80926
* Change PHINode::hasConstantValue to have a DominatorTree argumentDan Gohman2009-09-034-28/+21
| | | | | | | | instead of a bool argument, and to do the dominator check itself. This makes it eaiser to use when DominatorTree information is available. llvm-svn: 80920
* Keep track of how many memmove calls were turned intoDuncan Sands2009-09-031-1/+4
| | | | | | memcpy calls. llvm-svn: 80915
* Code Cleanup.Andreas Neustifter2009-09-033-18/+14
| | | | | | | Removed inverted flag form MaximumSpanningTree, also do not handle so much information to MaximumSpanningTree. llvm-svn: 80911
* Remove VISIBILITY_HIDDEN from this file.Nick Lewycky2009-09-031-4/+3
| | | | llvm-svn: 80903
* In C++, code is not allowed to call main. In C it is, thisChris Lattner2009-09-031-57/+4
| | | | | | | | | | 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 llvm-svn: 80887
* back out my recent commit (r80858), it seems to break self-hosting ↵Gabor Greif2009-09-034-7/+7
| | | | | | buildbot's stage 2 configure llvm-svn: 80871
* re-commit r66920 (which has been backed out in r66953) I may have more luck ↵Gabor Greif2009-09-034-7/+7
| | | | | | this time. I'll back out if needed... llvm-svn: 80858
* Sort edges in MaximumSpanningTree more stable in case of equal weight.Andreas Neustifter2009-09-021-2/+6
| | | | | | (See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090824/085890.html) llvm-svn: 80789
* Changed set of BlocksToInstrument to set of InsertedBlocks that do not have toAndreas Neustifter2009-09-021-9/+9
| | | | | | be instrumented. llvm-svn: 80788
* Code cleanups and added comments.Andreas Neustifter2009-09-021-17/+45
| | | | llvm-svn: 80781
* fix PR4815: some cases where DeleteDeadInstruction can deleteChris Lattner2009-09-021-3/+13
| | | | | | the instruction BBI points to. llvm-svn: 80768
* clean up this code a bit.Chris Lattner2009-09-021-64/+67
| | | | llvm-svn: 80767
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-0230-118/+82
| | | | llvm-svn: 80766
* fix PR4837, some bugs folding vector compares. TheseChris Lattner2009-09-021-7/+7
| | | | | | return a vector of i1, not i1 itself. llvm-svn: 80761
* OptimalEdgeProfiling: Creation of profiles.Andreas Neustifter2009-09-012-0/+187
| | | | | | This adds the instrumentation and runtime part of OptimalEdgeProfiling. llvm-svn: 80712
* remove CallGraphNode::replaceCallSite, it is redundant with other APIs.Chris Lattner2009-09-012-2/+6
| | | | llvm-svn: 80708
* cleanup/simplifyChris Lattner2009-09-011-17/+13
| | | | llvm-svn: 80706
* remove a bunch of explicit code previously needed to update theChris Lattner2009-09-011-27/+7
| | | | | | callgraph. This is now dead because RAUW does the job. llvm-svn: 80703
* enhance memcpy opt to turn memmoves into memcpy when the src/destChris Lattner2009-09-011-6/+41
| | | | | | | don't alias. Remove an old and poorly reduced testcase that fails with this transform for reasons unrelated to the original test. llvm-svn: 80693
* random code cleanups, no functionality change.Chris Lattner2009-09-011-63/+62
| | | | llvm-svn: 80682
* Update CMake files.Ted Kremenek2009-09-011-0/+1
| | | | llvm-svn: 80680
* Preparation for Optimal Edge Profiling:Andreas Neustifter2009-09-011-1/+9
| | | | | | | Add statistics for regular edge profiling, this enables the comparation of the number of edges inserted by regular and optimal edge profiling. llvm-svn: 80668
* Change CallGraphNode to maintain it's Function as an AssertingVHChris Lattner2009-09-012-8/+4
| | | | | | | | | | | | 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. llvm-svn: 80663
* fix some cases where instcombine would change hte IR but not return trueChris Lattner2009-08-311-8/+10
| | | | | | from runOnFunction llvm-svn: 80562
* comment and simplify some code.Chris Lattner2009-08-311-19/+14
| | | | llvm-svn: 80540
* add -debug outputChris Lattner2009-08-311-0/+4
| | | | llvm-svn: 80539
* improve -debug output, so that -debug is more likely to print whenChris Lattner2009-08-311-3/+6
| | | | | | instcombine is changing stuff. llvm-svn: 80538
* fix a bug I introduced with my 'instcombine builder' refactoring Chris Lattner2009-08-311-2/+6
| | | | | | | | changes: SimplifyDemandedBits can't use the builder yet because it has the wrong insertion point. This fixes a crash building MultiSource/Benchmarks/PAQ8p llvm-svn: 80537
* simplify some code by making the SCCNodes set contain Function*'sChris Lattner2009-08-311-12/+9
| | | | | | | | | | | | | | instead of CallGraphNode*'s. This also papers over a callgraph problem where a pass (in this case, MemCpyOpt) introduces a new function into the module (llvm.memset.i64) but doesn't add it to the call graph (nor should it, since it is a function pass). While it might be a good idea for MemCpyOpt to not synthesize functions in a runOnFunction(), there is no need for FunctionAttrs to be boneheaded, so fix it there. This fixes an assertion building 176.gcc. llvm-svn: 80535
* Fix PR4834, a tricky case where the inliner would resolve anChris Lattner2009-08-311-6/+9
| | | | | | | | | | | | | | | 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. llvm-svn: 80533
* Fix some nasty callgraph dangling pointer problems in Chris Lattner2009-08-315-54/+75
| | | | | | | | | | | | | | | | | | | | | | | | | argpromotion and structretpromote. Basically, when replacing a function, they used the 'changeFunction' api which changes the entry in the function map (and steals/reuses the callgraph node). This has some interesting effects: first, the problem is that it doesn't update the "callee" edges in any callees of the function in the call graph. Second, this covers for a major problem in all the CGSCC pass stuff, which is that it is completely broken when functions are deleted if they *don't* reuse a CGN. (there is a cute little fixme about this though :). This patch changes the protocol that CGSCC passes must obey: now the CGSCC pass manager copies the SCC and preincrements its iterator to avoid passes invalidating it. This allows CGSCC passes to mutate the current SCC. However multiple passes may be run on that SCC, so if passes do this, they are now required to *update* the SCC to be current when they return. Other less interesting parts of this patch are that it makes passes update the CG more directly, eliminates changeFunction, and requires clients of replaceCallSite to specify the new callee CGN if they are changing it. llvm-svn: 80527
* Fix PR4748: don't fold gep(bitcast(x)) into bitcast(gep) when x Chris Lattner2009-08-301-0/+7
| | | | | | | | | 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. llvm-svn: 80508
* misc cleanupChris Lattner2009-08-301-13/+13
| | | | llvm-svn: 80507
* add getPointerAddressSpace() to GEP instruction, use the methodChris Lattner2009-08-303-9/+6
| | | | | | in a few scalar xforms to simplify things. llvm-svn: 80506
* eliminate InsertCastBefore, use the builder instead.Chris Lattner2009-08-301-50/+19
| | | | llvm-svn: 80505
* eliminate InsertBitCastBefore, just use the builder instead.Chris Lattner2009-08-301-27/+24
| | | | llvm-svn: 80504
* convert a bunch more calls to InsertNewInstBefore to useChris Lattner2009-08-301-205/+137
| | | | | | the new Instcombine builder. llvm-svn: 80501
* fix typoChris Lattner2009-08-301-1/+1
| | | | llvm-svn: 80500
* give instcombine a custom IRBuilder that adds new instructions to theChris Lattner2009-08-301-304/+193
| | | | | | | | | | workslist and is set to insert new instructions before the current one. Convert a bunch of stuff that used to call InsertNewInstBefore over to use it, greatly simplifying code and making it more natural. There is still a lot more to go, but this is a good start. llvm-svn: 80492
* add a new InstCombineWorklist::AddValue method that works evenChris Lattner2009-08-301-16/+13
| | | | | | | | | if the operand is not an instruction. Simplify most uses of AddOperandsToWorkList to use AddValue and inline it into the one remaining callsite. llvm-svn: 80488
* move AddUsersToWorkList to the worklist processing class, make theChris Lattner2009-08-301-16/+16
| | | | | | argument stronger typed. llvm-svn: 80487
* rename AddUsesToWorkList -> AddOperandsToWorkList. The Chris Lattner2009-08-301-31/+13
| | | | | | | | | | former looks too much like AddUsersToWorkList and keeps confusing me. Remove AddSoonDeadInstToWorklist and change its two callers to do the same thing in a simpler way. llvm-svn: 80486
* inline the trivial AddToWorkList/RemoveFromWorkList methodsChris Lattner2009-08-301-104/+65
| | | | | | | | | | | | | into their callers. simplify ReplaceInstUsesWith. Make EraseInstFromFunction only add operands to the worklist if there aren't too many of them (this was a scalability win for crazy programs that was only infrequently enforced). Switch more code to using EraseInstFromFunction instead of duplicating it inline. Change some fcmp/icmp optimizations to modify fcmp/icmp in place instead of creating a new one and deleting the old one just to change the predicate. llvm-svn: 80483
* fix a bug I introduced in r80478 found by the build bot.Chris Lattner2009-08-301-1/+2
| | | | llvm-svn: 80482
* refactor instcombine's worklist processing stuff out to its own class.Chris Lattner2009-08-301-26/+58
| | | | llvm-svn: 80481
* more cleanups: remove some redundant code, and simplify someChris Lattner2009-08-301-49/+15
| | | | | | other places. llvm-svn: 80478
* eliminate the temporary SrcGEPOperands smallvector.Chris Lattner2009-08-301-18/+15
| | | | llvm-svn: 80477
* simplify/detangle some control flow.Chris Lattner2009-08-301-20/+15
| | | | llvm-svn: 80476
* simplify and cleanup some code, remove some code that just Chris Lattner2009-08-301-75/+29
| | | | | | | | | does constant folding of gep's: this is already handled in a more general way. No functionality change. llvm-svn: 80475
OpenPOWER on IntegriCloud