summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Update LoopSimplify and LoopUnswitch to use the new makeLoopInvariantDan Gohman2009-07-142-15/+15
| | | | | | function. llvm-svn: 75584
* Fix indvars to not assume that a loop with a single unique exitDan Gohman2009-07-141-7/+5
| | | | | | block has a single unique exiting block. llvm-svn: 75579
* Don't delete asm's just because their inputs are undefined;Dale Johannesen2009-07-141-8/+17
| | | | | | xor R, R is a common and valid idiom for zeroing a register, for example. llvm-svn: 75571
* PR4548: optimize zext+udiv+trunc to udiv.Eli Friedman2009-07-131-1/+20
| | | | llvm-svn: 75539
* Canonicalize boolean +/- a constant to a select.Eli Friedman2009-07-131-6/+8
| | | | | | | | (I think it's reasonably clear that we want to have a canonical form for constructs like this; if anyone thinks that a select is not the best canonical form, please tell me.) llvm-svn: 75531
* These don't really need contexts either.Owen Anderson2009-07-132-10/+10
| | | | llvm-svn: 75528
* Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,Dan Gohman2009-07-131-1/+1
| | | | | | | | | | using the Curiously Recurring Template Pattern with LoopBase. This will help further refactoring, and future functionality for Loop. Also, Headers can now foward-declare Loop, instead of pulling in LoopInfo.h or doing tricks. llvm-svn: 75519
* Misc simplifications to InstCombiner::commonIntCastTransforms. Most of Eli Friedman2009-07-131-60/+17
| | | | | | | | the changes are allowed by not calling this function for bitcasts. The Instruction::AShr case is dead because SimplifyDemandedInstructionBits handles that case. llvm-svn: 75514
* Fix comment.Eli Friedman2009-07-131-3/+2
| | | | llvm-svn: 75499
* Move more functionality over to LLVMContext.Owen Anderson2009-07-137-36/+43
| | | | llvm-svn: 75497
* Don't bother to call commonIntCastTransforms for bitcasts; int->int Eli Friedman2009-07-131-7/+3
| | | | | | bitcasts will always be eliminated anyway. llvm-svn: 75495
* Begin the painful process of tearing apart the rat'ss nest that is ↵Owen Anderson2009-07-134-53/+67
| | | | | | | | | Constants.cpp and ConstantFold.cpp. This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's the only way I could figure out to make this process vaguely incremental. llvm-svn: 75445
* Remove check which is duplicated in Eli Friedman2009-07-121-20/+0
| | | | | | InstCombiner::visitSelectInstWithICmp. llvm-svn: 75409
* silence a vc++ warning.Chris Lattner2009-07-111-1/+1
| | | | llvm-svn: 75393
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-1110-59/+66
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-115-9/+14
| | | | | | and abort()/exit() -> llvm_report_error(). llvm-svn: 75363
* Move a method that creates constant ranges relative to another constant rangeNick Lewycky2009-07-111-54/+5
| | | | | | | | | | per icmp predicate out of predsimplify and into ConstantRange. Add another utility method that determines whether one range is a subset of another. Combine with the former to determine whether icmp pred range, range is known to be true or not. llvm-svn: 75357
* Push LLVMContext through the PatternMatch API.Owen Anderson2009-07-102-111/+134
| | | | llvm-svn: 75255
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-0923-206/+225
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* A little bit more LLVMContextification.Owen Anderson2009-07-091-2/+4
| | | | llvm-svn: 75159
* There's no need to consider PHI nodes in the same block as the instructionNick Lewycky2009-07-091-0/+4
| | | | | | we're inserting sigma/phi functions for. Patch by Andre Tavares. llvm-svn: 75138
* Add some statistics to SSI so we can see what it's up to.Nick Lewycky2009-07-091-0/+43
| | | | | | Add an -ssi-everything pass which calls createSSI on everything in the function. llvm-svn: 75135
* Push LLVMContext _back_ through IRBuilder.Owen Anderson2009-07-081-1/+1
| | | | llvm-svn: 75040
* Tell ScalarEvolution to forget a loop before starting to delete it.Dan Gohman2009-07-081-6/+6
| | | | | | | This way ScalarEvolution can examine the loop to determine what state it needs to update, if it chooses. llvm-svn: 75029
* Switch GlobalVariable ctors to a sane API, where *either* a context or a ↵Owen Anderson2009-07-088-48/+37
| | | | | | module is required. llvm-svn: 75025
* Remove the vicmp and vfcmp instructions. Because we never had a release withNick Lewycky2009-07-081-20/+20
| | | | | | | these instructions, no autoupgrade or backwards compatibility support is provided. llvm-svn: 74991
* Push LLVMContext through GlobalVariables and IRBuilder.Owen Anderson2009-07-088-20/+33
| | | | llvm-svn: 74985
* Change all SCEV* to SCEV *.Dan Gohman2009-07-073-116/+116
| | | | llvm-svn: 74918
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-0616-78/+78
| | | | llvm-svn: 74878
* Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's ↵Owen Anderson2009-07-062-2/+2
| | | | | | through the ValueTracking API. llvm-svn: 74873
* Thread LLVMContext through the constant folding APIs, which touches a lot of ↵Owen Anderson2009-07-0614-68/+92
| | | | | | files. llvm-svn: 74844
* More LLVMContext-ification.Owen Anderson2009-07-0611-135/+181
| | | | llvm-svn: 74811
* More LLVMContext-ification.Owen Anderson2009-07-0517-93/+135
| | | | llvm-svn: 74807
* Fix build.Mike Stump2009-07-031-0/+1
| | | | llvm-svn: 74782
* Even more passes being LLVMContext'd.Owen Anderson2009-07-037-179/+232
| | | | llvm-svn: 74781
* Add Static Single Information construction pass written by André Tavares!Nick Lewycky2009-07-031-0/+390
| | | | | | | Use it by requiring it through the pass manager, then calling its createSSI method on the variables that you want in SSI form. llvm-svn: 74780
* Add newline at end of file.Duncan Sands2009-07-031-1/+1
| | | | llvm-svn: 74773
* Second batch of passes using LLVMContext.Owen Anderson2009-07-035-37/+46
| | | | llvm-svn: 74753
* Convert the first batch of passes to use LLVMContext.Owen Anderson2009-07-034-625/+711
| | | | llvm-svn: 74748
* fix inverted logic pointed out by John McCall, noticed by inspection.Chris Lattner2009-07-021-1/+1
| | | | | | | This was considering vector intrinsics to have cost 2, but non-vector intrinsics to have cost 1, which is backward. llvm-svn: 74698
* Fix a bunch of other places that used operator[] to test whetherDan Gohman2009-07-022-11/+19
| | | | | | a key is present in a std::map or DenseMap to use find instead. llvm-svn: 74676
* Request LCSSA after LoopSimplify. This fixes a problem in which theDan Gohman2009-07-011-1/+1
| | | | | | | PassManager was scheduling LCSSA before LoopSimplify, which does not preserve LCSSA. llvm-svn: 74661
* Fix an instcombine abort on a scalar-to-vector bitcast. This fixes PR4487.Dan Gohman2009-07-011-1/+15
| | | | llvm-svn: 74646
* Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson2009-07-011-1/+1
| | | | | | | | | | LLVMContext through a lot of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools. Patches for Clang and LLVM-GCC to follow. llvm-svn: 74614
* improve the APIs for creating struct and function types with no ↵Chris Lattner2009-07-013-9/+5
| | | | | | | | arguments/elements to not have to create a temporary vector (in the API at least). Patch by Jay Foad! llvm-svn: 74584
* Minor code simplification.Dan Gohman2009-06-301-3/+2
| | | | llvm-svn: 74491
* Don't try to split a loop when the controlling icmp instructionDan Gohman2009-06-271-0/+3
| | | | | | doesn't have an IV-based operand. This fixes PR4471. llvm-svn: 74399
* Remove the block from the LoopInfo, rather than just the Loop.Dan Gohman2009-06-271-1/+1
| | | | | | | LoopInfo will handle removing it from the Loop, as well as updating its own tables. llvm-svn: 74398
* Teach LoopSimplify how to merge multiple loop exits into a single exit,Dan Gohman2009-06-272-1/+76
| | | | | | | | | | | | | | | | when one of them can be converted to a trivial icmp and conditional branch. This addresses what is essentially a phase ordering problem. SimplifyCFG knows how to do this transformation, but it doesn't do so if the primary block has any instructions in it other than an icmp and a branch. In the given testcase, the block contains other instructions, however they are loop-invariant and can be hoisted. SimplifyCFG doesn't have LoopInfo though, so it can't hoist them. And, it's important that the blocks be merged before LoopRotation, as it doesn't support multiple-exit loops. llvm-svn: 74396
* More minor code simplifications.Dan Gohman2009-06-271-14/+9
| | | | llvm-svn: 74395
OpenPOWER on IntegriCloud