summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the crash in this test. This is basically the sameDale Johannesen2009-06-151-2/+27
| | | | | | | | problem addressed in 31284, but the patch there only addressed the case where an invoke is the first thing in a block. llvm-svn: 73416
* Merge PartialInliner changes.Owen Anderson2009-06-151-0/+5
| | | | llvm-svn: 73412
* Make the EnableLoadPRE variable static.Dan Gohman2009-06-151-1/+1
| | | | llvm-svn: 73398
* Fix old-style type names in comments.Dan Gohman2009-06-144-11/+11
| | | | llvm-svn: 73362
* Convert several parts of the ScalarEvolution framework to useDan Gohman2009-06-141-8/+8
| | | | | | SmallVector instead of std::vector. llvm-svn: 73357
* Add another item to the list of things that indvars does.Dan Gohman2009-06-141-1/+4
| | | | llvm-svn: 73355
* Fix CMake build. Patch from Ingmar Vanhassel.Torok Edwin2009-06-141-0/+1
| | | | llvm-svn: 73342
* Add an early implementation of a partial inlining pass. The idea behind thisOwen Anderson2009-06-141-0/+171
| | | | | | | | | | is that, for functions whose bodies are entirely guarded by an if-statement, it can be profitable to pull the test out of the callee and into the caller. This code has had some cursory testing, but still has a number of known issues on the LLVM test suite. llvm-svn: 73338
* Unlike the other instructions, GEP really does need to look at the type of aNick Lewycky2009-06-131-0/+14
| | | | | | pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review! llvm-svn: 73299
* Teach SCEVExpander's visitAddRecExpr to reuse an existing canonicalDan Gohman2009-06-131-71/+24
| | | | | | | | | | | | | | | | | induction variable when the addrec to be expanded does not require a wider type. This eliminates the need for IndVarSimplify to micro-manage SCEV expansions, because SCEVExpander now automatically expands them in the form that IndVarSimplify considers to be canonical. (LSR still micro-manages its SCEV expansions, because it's optimizing for the target, rather than for other optimizations.) Also, this uses the new getAnyExtendExpr, which has more clever expression simplification logic than the IndVarSimplify code it replaces, and this cleans up some ugly expansions in code such as the included masked-iv.ll testcase. llvm-svn: 73294
* second half of fix for PR4366: don't zap store to null of Chris Lattner2009-06-121-3/+7
| | | | | | non-default addrspaces. llvm-svn: 73253
* Don't do (x - (y - z)) --> (x + (z - y)) on floating-point types, becauseDan Gohman2009-06-121-15/+0
| | | | | | it may round differently. This fixes PR4374. llvm-svn: 73243
* Give Instruction::isSameOperationAs a corresponding comment to noteDan Gohman2009-06-121-2/+3
| | | | | | | | | | | the relationship with MergeFunctions.cpp's isEquivalentOperation, and make a trivial code reordering so that the two functions are easier to compare. Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's isEquivalentOperation's comment, and fix a nearby 80-column violation. llvm-svn: 73241
* Keep callers of a weak function calling it, instead of the non-weak equivalent.Nick Lewycky2009-06-121-0/+1
| | | | llvm-svn: 73235
* Don't forget to match the calling convention when producing a thunk.Nick Lewycky2009-06-121-2/+2
| | | | llvm-svn: 73231
* Given two identical weak functions, produce one internal function and two weakNick Lewycky2009-06-121-4/+17
| | | | | | thunks. llvm-svn: 73230
* Add an "are types equivalent" operation that ignores the types that a pointerNick Lewycky2009-06-121-99/+354
| | | | | | | | | | | | | | | points to while analyzing all other fields. Use FoldingSetNodeID to produce a good hash. This dramatically decreases run times. Emit thunks. This means that it can look at all functions regardless of what the linkage is or if the address is taken, but unfortunately some small functions can be even shorter than the thunk because our backend doesn't yet realize it can just turn these into jumps. This means that this pass will pessimize code on average. llvm-svn: 73222
* Fix 4366: store to null in non-default addr space should not beChris Lattner2009-06-111-1/+2
| | | | | | turned into unreachable. llvm-svn: 73195
* Implement and use new method Function::hasAddressTaken().Jay Foad2009-06-103-38/+6
| | | | llvm-svn: 73164
* Remove an unused function SafeToDestroyConstant(). Rename an almostJay Foad2009-06-092-24/+9
| | | | | | | identical function ConstantIsDead() to SafeToDestroyConstant(), to emphasise the connection with Constant::destroyConstant(). llvm-svn: 73149
* Don't crash on multiple return value with no obvious inserted value.Nick Lewycky2009-06-061-2/+2
| | | | | | Fixes PR4314. llvm-svn: 73007
* PR4340: Run SimplifyDemandedVectorElts on insertelement instructions; Eli Friedman2009-06-061-0/+6
| | | | | | sometimes it can find simplifications that won't be found otherwise. llvm-svn: 73006
* Use cast<> instead of dyn_cast<> for things that are known to beJay Foad2009-06-064-23/+16
| | | | | | Instructions. llvm-svn: 73002
* Simplify.Devang Patel2009-06-051-15/+5
| | | | llvm-svn: 72965
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-047-64/+182
| | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt llvm-svn: 72897
* Don't do the X * 0.0 -> 0.0 transformation in instcombine, becauseDan Gohman2009-06-041-5/+5
| | | | | | | | instcombine doesn't know when it's safe. To partially compensate for this, introduce new code to do this transformation in dagcombine, which can use UnsafeFPMath. llvm-svn: 72872
* Don't attempt to simplify an non-affine IV expression if it can'tDan Gohman2009-06-031-12/+10
| | | | | | be simplified to a loop-invariant value. This fixes PR4315. llvm-svn: 72798
* Fix CodeGenPrepare's address-mode sinking to handle unusualDan Gohman2009-06-021-1/+4
| | | | | | | addresses, involving Base values which do not have Pointer type. This fixes PR4297. llvm-svn: 72739
* Avoid infinite looping in AllGlobalLoadUsesSimpleEnoughForHeapSRA(). This ↵Evan Cheng2009-06-021-6/+16
| | | | | | can happen when PHI uses are recursively dependent on each other. llvm-svn: 72710
* PR4286: Make RewriteLoadUserOfWholeAlloca and Eli Friedman2009-06-011-8/+13
| | | | | | | | RewriteStoreUserOfWholeAlloca deal with tail padding because isSafeUseOfBitCastedAllocation expects them to. Otherwise, we crash trying to erase the bitcast. llvm-svn: 72688
* Be more aggressive in doing LoadPRE by tracing backwards when a block only hasOwen Anderson2009-05-311-4/+39
| | | | | | | | a single predecessor. Patch by Jakub Staszak. llvm-svn: 72661
* fix PR4284, a bug in simplifylibcalls handling memcmp. Patch by Chris Lattner2009-05-301-1/+1
| | | | | | Benjamin Kramer! llvm-svn: 72625
* Give embedded metadata its own type instead of relying on EmptyStructTy.Nick Lewycky2009-05-301-1/+24
| | | | llvm-svn: 72610
* Enable GVN Load PRE.Bill Wendling2009-05-291-1/+1
| | | | llvm-svn: 72589
* just show the instruction, its not that slow.Torok Edwin2009-05-291-6/+1
| | | | llvm-svn: 72577
* for instructions with void type we have no choice but print the instruction asTorok Edwin2009-05-291-1/+4
| | | | | | is, otherwise we get a <badref>. llvm-svn: 72567
* Add a DEBUG() output to GVN that prints the instruction clobbering a load.Torok Edwin2009-05-291-1/+11
| | | | | | | This is useful when trying to figure out why GVN didn't eliminate redundant loads. llvm-svn: 72565
* Fix an issue where phiMap was not being updated properly when doing load PRE.Owen Anderson2009-05-291-0/+5
| | | | | | Diagnosis and patch thanks to Jakub Staszak. llvm-svn: 72562
* Use Operands.data() instead of &Operands[0] where Operands is a potentiallyNick Lewycky2009-05-281-1/+1
| | | | | | empty SmallVector. llvm-svn: 72512
* Revert 72493 and replace it with a more conservative fix, for now: don'tDan Gohman2009-05-271-7/+8
| | | | | | | | rewrite the comparison if there is any implicit extension or truncation on the induction variable. I'm planning for IVUsers to eventually take over some of the work of this code, and for it to be generalized. llvm-svn: 72496
* In ChangeCompareStride, when the stride to be reused is truncated toDan Gohman2009-05-271-2/+7
| | | | | | | a smaller type, promoted its offset back up to the type of the new comparison. This fixes PR4222. llvm-svn: 72493
* Change ScalarEvolution::getSCEVAtScope to always return the original valueDan Gohman2009-05-241-4/+2
| | | | | | | | in the case where a loop exit value cannot be computed, instead of only in some cases while using SCEVCouldNotCompute in others. This simplifies getSCEVAtScope's callers. llvm-svn: 72375
* Move Rewriter.clear() earlier, to avoid triggerring the AssertingVH byTorok Edwin2009-05-241-2/+8
| | | | | | | one of the RecursivelyDeleteTriviallyDeadInstructions. Add a comment explaining why the cache needs to be cleared. llvm-svn: 72372
* Instead of clearing the rewriter, don't attempt to rewrite dead phi nodes.Torok Edwin2009-05-241-2/+2
| | | | | | Also fix 80 column violation. llvm-svn: 72371
* When rewriting the loop exit test with the canonical induction variable,Dan Gohman2009-05-241-1/+6
| | | | | | | leave the original comparison in place if it has other uses, since the other uses won't be dominated by the new comparison instruction. llvm-svn: 72369
* When replacing a floating-point comparison with an integerDan Gohman2009-05-241-0/+1
| | | | | | comparison, use takeName to give the integer comparison a name. llvm-svn: 72367
* The rewriter may hold references to instructions that are deleted because ↵Torok Edwin2009-05-241-0/+2
| | | | | | | | | | | they are trivially dead. Fix by clearing the rewriter cache before deleting the trivially dead instructions. Also make InsertedExpressions use an AssertingVH to catch these bugs easier. llvm-svn: 72364
* available_externall linkage is not local, this was confusing the codegenerator,Torok Edwin2009-05-234-5/+8
| | | | | | | | | and it wasn't generating calls through @PLT for these functions. hasLocalLinkage() is now false for available_externally, I attempted to fix the inliner and dce to handle available_externally properly. It passed make check. llvm-svn: 72328
* Fix bug in FoldFCmp_IntToFP_Cst. If inttofp is a uintofp, use unsigned ↵Evan Cheng2009-05-221-61/+67
| | | | | | instead of signed integer constant. llvm-svn: 72300
* Teach IndVarSimplify's FixUsesBeforeDefs to handle InvokeInsts byDan Gohman2009-05-221-1/+5
| | | | | | | | | | | | | | | assuming that the use of the value is in a block dominated by the "normal" destination. LangRef.html and other documentation sources don't explicitly guarantee this, but it seems to be assumed in other places in LLVM at least. This fixes an assertion failure on the included testcase, which is derived from the Ada testsuite. FixUsesBeforeDefs is a temporary measure which I'm looking to replace with a more capable solution. llvm-svn: 72266
OpenPOWER on IntegriCloud