summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* 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-135-32/+38
| | | | 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-133-47/+61
| | | | | | | | | 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
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-115-48/+50
| | | | | | | | | 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-113-6/+9
| | | | | | 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-101-110/+132
| | | | llvm-svn: 75255
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-0914-168/+185
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* A little bit more LLVMContextification.Owen Anderson2009-07-091-2/+4
| | | | llvm-svn: 75159
* 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-081-3/+2
| | | | | | 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-081-1/+2
| | | | llvm-svn: 74985
* Change all SCEV* to SCEV *.Dan Gohman2009-07-073-116/+116
| | | | llvm-svn: 74918
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-067-41/+41
| | | | llvm-svn: 74878
* Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's ↵Owen Anderson2009-07-061-1/+1
| | | | | | through the ValueTracking API. llvm-svn: 74873
* Thread LLVMContext through the constant folding APIs, which touches a lot of ↵Owen Anderson2009-07-066-9/+12
| | | | | | files. llvm-svn: 74844
* More LLVMContext-ification.Owen Anderson2009-07-052-3/+3
| | | | llvm-svn: 74807
* Even more passes being LLVMContext'd.Owen Anderson2009-07-037-179/+232
| | | | llvm-svn: 74781
* 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
* 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
* More minor code simplifications.Dan Gohman2009-06-271-14/+9
| | | | llvm-svn: 74395
* When a value is used multiple times within a single PHI, instructionsDan Gohman2009-06-271-3/+15
| | | | | | | | inserted to replace that value must dominate all of of the basic blocks associated with the uses of the value in the PHI, not just one of them. llvm-svn: 74376
* Incorporate the insertion point into the key of SCEVExpander's CSE map.Dan Gohman2009-06-261-121/+43
| | | | | | | | | | | | | | This helps it avoid reusing an instruction that doesn't dominate all of the users, in cases where the original instruction was inserted before all of the users were known. This may result in redundant expansions of sub-expressions that depend on loop-unpredictable values in some cases, however this isn't very common, and it primarily impacts IndVarSimplify, so GVN can be expected to clean these up. This eliminates the need for IndVarSimplify's FixUsesBeforeDefs, which fixes several bugs. llvm-svn: 74352
* Constify this value.Owen Anderson2009-06-261-3/+2
| | | | llvm-svn: 74330
* Fix linking of llvm-ld and lli with CMake, from Xerxes RånbyDouglas Gregor2009-06-261-0/+2
| | | | llvm-svn: 74285
* Change this code to a form about which VC++ reportedly isn't unhappy.Dan Gohman2009-06-261-1/+2
| | | | llvm-svn: 74243
* Minor code simplification.Dan Gohman2009-06-261-7/+3
| | | | llvm-svn: 74240
* Reword a few comments.Dan Gohman2009-06-251-17/+17
| | | | llvm-svn: 74146
* When inserting code into a loop preheader, insert it before theDan Gohman2009-06-241-3/+6
| | | | | | | | terminator, instead of after the last phi. This fixes a bug exposed by ScalarEvolution analyzing more kinds of loops. This fixes PR4436. llvm-svn: 74072
* Extend ScalarEvolution's multiple-exit support to compute exactDan Gohman2009-06-242-37/+21
| | | | | | | | | | | | | | | trip counts in more cases. Generalize ScalarEvolution's isLoopGuardedByCond code to recognize And and Or conditions, splitting the code out into an isNecessaryCond helper function so that it can evaluate Ands and Ors recursively, and make SCEVExpander be much more aggressive about hoisting instructions out of loops. test/CodeGen/X86/pr3495.ll has an additional instruction now, but it appears to be due to an arbitrary register allocation difference. llvm-svn: 74048
* Don't emit a redundant BitCastInst if the value to be defined in theDan Gohman2009-06-241-1/+2
| | | | | | preheader is already an instruction. llvm-svn: 74031
* Fix a few minor issues that were exposed by the removal of SCEVHandle.Dan Gohman2009-06-221-1/+0
| | | | llvm-svn: 73910
* SCEVHandle is no more!Owen Anderson2009-06-223-117/+117
| | | | llvm-svn: 73906
* Fix this code to correctly handle loops with multiple exits. UntilDan Gohman2009-06-221-4/+4
| | | | | | | | now, this hasn't mattered, because ScalarEvolution hasn't been able to compute trip counts for loops with multiple exits. But it will soon. llvm-svn: 73864
* Rename a variable for consistency with the ExitBlock vs ExitingBlockDan Gohman2009-06-211-6/+6
| | | | | | terminology that LoopInfo uses. llvm-svn: 73863
* Fix a typo in a comment that Frits von Bommel noticed.Dan Gohman2009-06-191-1/+1
| | | | llvm-svn: 73796
* Re-apply r73718, now that the fix in r73787 is in, and add aDan Gohman2009-06-191-30/+36
| | | | | | | hand-crafted testcase which demonstrates the bug that was exposed in 254.gap. llvm-svn: 73793
* Fix LSR's OptimizeSMax to ignore max operators with more than 2 operands,Dan Gohman2009-06-191-0/+5
| | | | | | which it isn't prepared to handle. llvm-svn: 73787
* Revert 73718. It's breaking 254.gap.Evan Cheng2009-06-191-35/+29
| | | | llvm-svn: 73783
* make jump threading handle lexically identical compare instructionsChris Lattner2009-06-191-4/+17
| | | | | | | | as if they were multiple uses of the same instruction. This interacts well with the existing loadpre that j-t does to open up many new jump threads earlier. llvm-svn: 73768
OpenPOWER on IntegriCloud