summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Remove more malloc thrashing, this speeds up IPSCCP on kimwitu another 6.7%.Chris Lattner2007-02-021-10/+10
| | | | llvm-svn: 33796
* Convert an std::set to SmallSet, this speeds up IPSCCP 17% on kimwitu.Chris Lattner2007-02-021-5/+5
| | | | llvm-svn: 33794
* eliminate a malloc/free for (almost) every GEP processed. This speeds upChris Lattner2007-02-021-2/+3
| | | | | | IPSCCP 3.3% on kimwitu. llvm-svn: 33793
* switch hash_map's over to DenseMap in SCCP. This speeds up SCCP by 30% inChris Lattner2007-02-021-19/+21
| | | | | | a release-assert build on kimwitu++. llvm-svn: 33792
* Remove dead code and fix indentation per Chris' review comments.Reid Spencer2007-02-021-31/+12
| | | | llvm-svn: 33785
* Use short form of binary operator create functions.Reid Spencer2007-02-022-25/+25
| | | | llvm-svn: 33783
* bugfix for reid's shift patch.Chris Lattner2007-02-021-2/+2
| | | | llvm-svn: 33779
* Changes to support making the shift instructions be true BinaryOperators.Reid Spencer2007-02-026-155/+169
| | | | | | | | | | | | This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. llvm-svn: 33776
* Fix Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll, a serious codeChris Lattner2007-02-011-0/+24
| | | | | | | pessimization where instcombine can sink a load (good for code size) that prevents an alloca from being promoted by mem2reg (bad for everything). llvm-svn: 33771
* Ensure that ConvertOperandToType generates a result conversion byReid Spencer2007-02-011-1/+3
| | | | | | | initializing the Res variable to 0 and asserting it is not zero after the result should have been created. llvm-svn: 33761
* Fix bugs in the inliner having to do with single-entry phi nodes and valuemapChris Lattner2007-02-011-12/+12
| | | | | | | | updating. These were exposed by Devang's recent passmgr changes (with non-default passorderings) because now the inliner can be interleved with the LCSSA pass. llvm-svn: 33760
* remove temporary vectors.Chris Lattner2007-01-313-13/+9
| | | | llvm-svn: 33715
* eliminate temporary vectorsChris Lattner2007-01-311-16/+13
| | | | llvm-svn: 33713
* eliminate temporary vectorsChris Lattner2007-01-312-12/+8
| | | | llvm-svn: 33712
* Revert another incorrectly applied chunk, which fixes ↵Chris Lattner2007-01-311-7/+0
| | | | | | InstCombine/vec_insert_to_shuffle.ll llvm-svn: 33705
* eliminate temporary vectorsChris Lattner2007-01-313-17/+25
| | | | llvm-svn: 33693
* Move symbolic constant folding code to libanalysis.Chris Lattner2007-01-311-106/+0
| | | | llvm-svn: 33688
* Adjust #includes to match movement of constant folding code from ↵Chris Lattner2007-01-3011-10/+14
| | | | | | transformutils to libanalysis. llvm-svn: 33680
* move a bunch of constant folding code f rom Transforms/Utils/Local.cpp intoChris Lattner2007-01-301-152/+0
| | | | | | libanalysis/ConstantFolding.cpp. llvm-svn: 33679
* remove now-dead code.Chris Lattner2007-01-301-14/+0
| | | | llvm-svn: 33678
* the inliner pass now passes targetdata down through the inliner api'sChris Lattner2007-01-302-3/+19
| | | | llvm-svn: 33677
* The inliner/cloner can now optionally take TargetData info, which can beChris Lattner2007-01-302-11/+14
| | | | | | used by constant folding. llvm-svn: 33676
* pass TD to constant folding apisChris Lattner2007-01-301-2/+2
| | | | llvm-svn: 33674
* use smallvector instead of vector to make constant folding a bit more efficientChris Lattner2007-01-301-2/+3
| | | | llvm-svn: 33672
* adjust to api changeChris Lattner2007-01-301-1/+2
| | | | llvm-svn: 33671
* Change constant folding APIs to take an optional TargetData, and changeChris Lattner2007-01-302-41/+18
| | | | | | | | | | | ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array of operands + size, instead of an std::vector. In some cases, switch to using a SmallVector instead of a vector. This allows us to get rid of some special case gross code that was there to avoid the cost of constructing a vector. llvm-svn: 33670
* remove some bits that are not yet meant to land.Chris Lattner2007-01-301-57/+0
| | | | llvm-svn: 33666
* Symbolically evaluate constant expressions like &A[123] - &A[4].f.Chris Lattner2007-01-301-2/+143
| | | | | | | | | | | | | | | | | | | | | | | This occurs in C++ code like: #include <iostream> #include <iterator> int a[] = { 1, 2, 3, 4, 5 }; int main() { using namespace std; copy(a, a + sizeof(a)/sizeof(a[0]), ostream_iterator<int>(cout, "\n")); return 0; } Before we would decide the loop trip count is: sdiv (i32 sub (i32 ptrtoint (i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) to i32), i32 ptrtoint ([5 x i32]* @a to i32)), i32 4) Now we decide it is "5". Amazing. This code will need to be refactored, but I'm doing that as a separate commit. llvm-svn: 33665
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-3021-47/+47
| | | | | | confusion with external linkage types. llvm-svn: 33663
* Simplify names of lattice values. SGTUNE becomes SGT, for example.Nick Lewycky2007-01-291-71/+127
| | | | | | | | | | | | | Fix initializeConstant, now initializeInt. Fixes major performance bottleneck. X == Y || X->DominatedBy(Y) is redundant. Remove the X == Y part. Fix crasher in makeEqual where getOrInsertNode would add a new constant, producing an NE relationship between the two members we're trying to make equal. This now allows us to mark more BBs as unreachable. llvm-svn: 33612
* Propagate changes from my local tree. This patch includes:Anton Korobeynikov2007-01-282-7/+29
| | | | | | | | | | | | | | | | | | | | | | 1. New parameter attribute called 'inreg'. It has meaning "place this parameter in registers, if possible". This is some generalization of gcc's regparm(n) attribute. It's currently used only in X86-32 backend. 2. Completely rewritten CC handling/lowering code inside X86 backend. Merged stdcall + c CCs and fastcall + fast CC. 3. Dropped CSRET CC. We cannot add struct return variant for each target-specific CC (e.g. stdcall + csretcc and so on). 4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in on first attribute has meaning 'This is hidden pointer to structure return. Handle it gently'. 5. Fixed small bug in llvm-extract + add new feature to FunctionExtraction pass, which relinks all internal-linkaged callees from deleted function to external linkage. This will allow further linking everything together. NOTEs: 1. Documentation will be updated soon. 2. llvm-upgrade should be improved to translate csret => sret. Before this, there will be some unexpected test fails. llvm-svn: 33597
* Fix test/Transforms/InstCombine/2007-01-27-AndICmp.ll, a miscompilation ofChris Lattner2007-01-271-1/+2
| | | | | | Mozilla that Anton tracked down. llvm-svn: 33591
* Change the MachineDebugInfo to MachineModuleInfo to better reflect usageJim Laskey2007-01-261-2/+2
| | | | | | for debugging and exception handling. llvm-svn: 33550
* For PR761:Reid Spencer2007-01-261-2/+1
| | | | | | | The Module::setEndianness and Module::setPointerSize methods have been removed. Instead you can get/set the DataLayout. Adjust thise accordingly. llvm-svn: 33530
* Inherit CallGraphSCCPass directly from Pass.Devang Patel2007-01-263-3/+3
| | | | llvm-svn: 33514
* Inherit BasicBlockPass directly from Pass.Devang Patel2007-01-252-2/+2
| | | | llvm-svn: 33511
* Make llvm-extract preserve the callingconv of prototypes in the extractedChris Lattner2007-01-251-0/+1
| | | | | | code. llvm-svn: 33500
* Cleanup checks in the load and store of casted pointer transforms. TwoReid Spencer2007-01-221-8/+7
| | | | | | | | changes: (1) don't special case for i1 any more, (2) use the new TargetData::getTypeSizeInBits method to ensure source and dest are the same bit width. llvm-svn: 33427
* For PR970:Reid Spencer2007-01-214-31/+28
| | | | | | | Clean up handling of isFloatingPoint() and dealing with PackedType. Patch by Gordon Henriksen! llvm-svn: 33415
* Revise the store V, (cast P) -> store (cast V) -> P transform.Reid Spencer2007-01-201-9/+4
| | | | | | | | | We only want to do this if the src and destination types have the same bit width. This patch uses TargetData::getTypeSizeInBits() instead of making a special case for integer types and avoiding the transform if they don't match. llvm-svn: 33414
* Teach TargetData to handle 'preferred' alignment for each target, and useChris Lattner2007-01-201-9/+15
| | | | | | these alignment amounts to align scalars when we can. Patch by Scott Michel! llvm-svn: 33409
* Correct a comment.Owen Anderson2007-01-201-1/+1
| | | | llvm-svn: 33397
* For this transform: store V, (cast P) -> store (cast V), PReid Spencer2007-01-191-3/+4
| | | | | | | don't allow the transform if V and the pointer's element type are different width integer types. llvm-svn: 33371
* For PR1043:Reid Spencer2007-01-196-40/+44
| | | | | | | | | | | | | | This is the final patch for this PR. It implements some minor cleanup in the use of IntegerType, to wit: 1. Type::getIntegerTypeMask -> IntegerType::getBitMask 2. Type::Int*Ty changed to IntegerType* from Type* 3. ConstantInt::getType() returns IntegerType* now, not Type* This also fixes PR1120. Patch by Sheng Zhou. llvm-svn: 33370
* Fix InstCombine/2007-01-18-VectorInfLoop.ll, a case where instcombineChris Lattner2007-01-181-3/+9
| | | | | | infinitely loops. llvm-svn: 33343
* Clean up some code around the store V, (cast P) -> store (cast V), PReid Spencer2007-01-181-8/+14
| | | | | | | | | transform. Change some variable names so it is clear what is source and what is dest of the cast. Also, add an assert to ensure that the integer to integer case is asserting if the bitwidths are different. This prevents illegal casts from being formed and catches bitwidth bugs sooner. llvm-svn: 33337
* For PR1094:Reid Spencer2007-01-171-4/+4
| | | | | | | Adjust the use of SetVector for changes in SetVector's interface. Patch by Gordon Henriksen. llvm-svn: 33280
* Fix a regression in my isIntegral patch that broke 471.omnetpp. This isChris Lattner2007-01-151-6/+8
| | | | | | | | because TargetData::getTypeSize() returns the same for i1 and i8. This fix is not right for the full generality of bitwise types, but it fixes the regression. llvm-svn: 33237
* Don't print address of ETNode. Print the DFSNumIn which uniquely identifiesNick Lewycky2007-01-151-34/+65
| | | | | | | | | | | | | | | the basic block and is stable across runs in gdb or valgrind. Make Node::update handle edges which dominate and are tighter than existing edges. Replace makeEqual's "squeeze theorem" code. Fixes miscompilation. Gate the calls to defToOps and opsToDef. Before this, we were getting IG edges about values which weren't even defined in the dominated area. This reduces the size of the IG by about half. llvm-svn: 33236
* Implement InstCombine/phi.ll:test7, deletion of trivial value loops forChris Lattner2007-01-151-2/+16
| | | | | | induction variables. llvm-svn: 33234
OpenPOWER on IntegriCloud