summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
* If we are extracting a block that has multiple successors that are the sameChris Lattner2004-08-131-2/+11
| | | | | | | | | block (common in a switch), make sure to remove extra edges in successor blocks. This fixes CodeExtractor/2004-08-12-BlockExtractPHI.ll and should be pulled into LLVM 1.3 (though the regression test need not be, as that would require pulling in the LoopExtract.cpp changes). llvm-svn: 15717
* When we code extract some stuff, leave the codeRepl block in the place whereChris Lattner2004-08-131-1/+1
| | | | | | the extracted code was, instead of putting it at the end of the function llvm-svn: 15716
* Add value mapper support for select constant exprs. This should fix a bugChris Lattner2004-08-131-0/+5
| | | | | | Nate ran into when bugpointing siod. This fix should go into LLVM 1.3 llvm-svn: 15712
* Fix code extraction of unwind blocks. This fixed bugs that bugpoint canChris Lattner2004-08-121-9/+12
| | | | | | run into. This should go into 1.3 llvm-svn: 15679
* Stop using getValues().Alkis Evlogimenos2004-08-041-14/+12
| | | | llvm-svn: 15487
* Expose this as a functionpassChris Lattner2004-07-311-1/+3
| | | | llvm-svn: 15369
* Fix #includes of i*.h => Instructions.h as per PR403.Misha Brukman2004-07-291-1/+0
| | | | llvm-svn: 15337
* Fix #includes of i*.h => Instructions.h as per PR403.Misha Brukman2004-07-295-7/+5
| | | | llvm-svn: 15334
* Merge i*.h headers into Instructions.h as part of bug403.Alkis Evlogimenos2004-07-291-2/+1
| | | | llvm-svn: 15325
* These files don't need to include <iostream> since they include ↵Brian Gaeke2004-07-212-2/+0
| | | | | | "Support/Debug.h". llvm-svn: 15089
* Fix a serious code pessimization problem. If an inlined function has a singleChris Lattner2004-07-201-5/+6
| | | | | | | return, clone the 'ret' BB code into the block AFTER the inlined call, not the other way around. llvm-svn: 15030
* Implement SimplifyCFG/BrUnwind.llChris Lattner2004-07-201-2/+9
| | | | llvm-svn: 15022
* Remove an if statement that would never be reached.Reid Spencer2004-07-181-3/+1
| | | | llvm-svn: 14968
* bug 122:Reid Spencer2004-07-181-3/+3
| | | | | | - Replace ConstantPointerRef usage with GlobalValue usage llvm-svn: 14953
* bug 122:Reid Spencer2004-07-181-2/+1
| | | | | | - Minimize redundant isa<GlobalValue> usage llvm-svn: 14948
* Progress on PR341Chris Lattner2004-07-153-9/+9
| | | | llvm-svn: 14840
* Add #include <iostream> since Value.h does not #include it any more.Reid Spencer2004-07-043-0/+5
| | | | llvm-svn: 14622
* Moved to lib/VMCoreMisha Brukman2004-06-231-927/+0
| | | | llvm-svn: 14348
* Use new IsNAN() wrapper.Brian Gaeke2004-06-231-15/+2
| | | | llvm-svn: 14340
* *FINALLY* Fix a really nasty nondeterministic bug that has been haunting usChris Lattner2004-06-211-6/+7
| | | | | | | | | | | since May 1st. In this code, the pred iterator was being invalidated sometimes causing the wrong entries to be added to PHI nodes. The fix for this is to defererence and safe the *PI value before we hack on branch instructions, which changes use/def chains, which SOMETIMES invalidates the iterator. llvm-svn: 14278
* Comment out the isnan stuff until we get a proper autoconf test for itChris Lattner2004-06-211-1/+7
| | | | | | breaking the build on sparc is not acceptable. llvm-svn: 14277
* Add some DEBUG output to the simplifycfg routinesChris Lattner2004-06-201-14/+13
| | | | | | | Fix another non-deterministic behavior, this one should actually speed up the code though as it was doing silly things. llvm-svn: 14258
* Change to use the StableBasicBlockNumbering classChris Lattner2004-06-191-15/+7
| | | | llvm-svn: 14247
* Do not let the numbering of PHI nodes placed in the function depend onChris Lattner2004-06-191-2/+36
| | | | | | | | | | | | | | | | | | | non-deterministic things like the ordering of blocks in the dominance frontier of a BB. Unfortunately, I don't know of a better way to solve this problem than to explicitly sort the BB's in function-order before processing them. This is guaranteed to slow the pass down a bit, but is absolutely necessary to get usable diffs between two different tools executing the mem2reg or scalarrepl pass. Before this, bazillions of spurious diff failures occurred all over the place due to the different order of processing PHIs: - %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.0, uint 0, uint 0 + %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.1, uint 0, uint 0 Now, the diffs match. llvm-svn: 14244
* Do not sort by the address of LLVM ConstantInt* objects. This producesChris Lattner2004-06-191-10/+21
| | | | | | | | | | | | | | | | | | | | | | nondeterministic results that depend on where these objects land in memory. Instead, sort by the value of the constant, which is stable. Before this patch, the -simplifycfg pass run from two different compilers could cause different code to be generated, though it was semantically the same: @@ -12258,8 +12258,8 @@ %s_addr.1 = phi sbyte* [ %s, %entry ], [ %inc.0, %no_exit ] ; <sbyte*> [#uses=5] %tmp.1 = load sbyte* %s_addr.1 ; <sbyte> [#uses=1] switch sbyte %tmp.1, label %no_exit [ - sbyte 0, label %loopexit sbyte 46, label %loopexit + sbyte 0, label %loopexit ] We need to stomp all of this stuff out. llvm-svn: 14243
* I love the smell of a freshly broken PowerPC build in the morning.Brian Gaeke2004-06-171-0/+1
| | | | llvm-svn: 14206
* Fix compilation problem on freebsd. Problem noted by Vladimir Merzliakov inChris Lattner2004-06-171-1/+1
| | | | | | PR371 llvm-svn: 14203
* Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()Chris Lattner2004-06-171-2/+2
| | | | llvm-svn: 14201
* Um, did someone make a typo or something?Brian Gaeke2004-06-151-1/+1
| | | | llvm-svn: 14192
* Remove support for the isnan intrinsicChris Lattner2004-06-151-3/+0
| | | | llvm-svn: 14186
* Quick hack to get this file compiling again on Mac OS X. The right thing to doBrian Gaeke2004-06-141-0/+8
| | | | | | | | is write an autoconf macro that checks whether __isnan or isnan actually works **using the C++ compiler after #include <cmath>**, instead of doing it the easy way with AC_CHECK_FUNCS(). llvm-svn: 14171
* Add constant folding capabilities to the isunordered intrinsic.Alkis Evlogimenos2004-06-131-1/+4
| | | | llvm-svn: 14168
* Constant fold the isnan intrinsicChris Lattner2004-06-111-1/+10
| | | | llvm-svn: 14150
* Implement constant folding of fmod, which is used a lot in povrayChris Lattner2004-05-271-2/+9
| | | | llvm-svn: 13823
* Restructure call constant folding code a bit to make it simplerChris Lattner2004-05-271-39/+40
| | | | | | | | Add support for acos/asin/atan. 188.ammp contains three calls to acos with constant arguments. Constant folding it allows elimination of those 3 calls and three FP divisions of the results. llvm-svn: 13821
* Do not pass a null pointer if this instruction is not prepended orAlkis Evlogimenos2004-05-261-2/+2
| | | | | | appended anywhere. llvm-svn: 13798
* Use one destination constructor for the unconditional branch.Alkis Evlogimenos2004-05-261-1/+1
| | | | llvm-svn: 13792
* Convert to SymbolTable's new iteration interface.Reid Spencer2004-05-251-5/+7
| | | | llvm-svn: 13754
* Convert to SymbolTable's new lookup and iteration interfaces.Reid Spencer2004-05-251-23/+23
| | | | llvm-svn: 13751
* Add CloneTraceInto(), which is based on (and has mostly the sameBrian Gaeke2004-05-191-0/+33
| | | | | | effects as) CloneFunctionInto(). llvm-svn: 13601
* Move RemapInstruction() to ValueMapper, so that it can be shared withBrian Gaeke2004-05-193-22/+26
| | | | | | | | CloneTrace, and because it is primarily an operation on ValueMaps. It is now a global (non-static) function which can be pulled in using ValueMapper.h. llvm-svn: 13600
* Do not pass in the same argument to the extracted function more than once, andChris Lattner2004-05-121-1/+8
| | | | | | give the extracted function a more useful name than just foo_code. llvm-svn: 13493
* Implement support for code extracting basic blocks that have a returnChris Lattner2004-05-121-2/+12
| | | | | | instruction in them. llvm-svn: 13490
* Implement splitting of PHI nodes, allowing block extraction of BB's that haveChris Lattner2004-05-121-7/+96
| | | | | | | | | | PHI node entries from multiple outside-the-region blocks. This also fixes extraction of the entry block in a function. Yaay. This has successfully block extracted all (but one) block from the score_move function in obsequi (out of 33). Hrm, I wonder which block the bug is in. :) llvm-svn: 13489
* * Pull some code out into the definedInRegion/definedInCaller methodsChris Lattner2004-05-121-78/+78
| | | | | | | | | | | | | | | | * Add a stub for the severSplitPHINodes which will allow us to bbextract bb's with PHI nodes in them soon. * Remove unused arguments from findInputsOutputs * Dramatically simplify the code in findInputsOutputs. In particular, nothing really cares whether or not a PHI node is using something. * Move moveCodeToFunction to after emitCallAndSwitchStatement as that's the order they get called. * Fix a bug where we would code extract a region that included a call to vastart. Like 'alloca', calls to vastart must stay in the function that they are defined in. * Add some comments. llvm-svn: 13482
* Generate substantially better code when there are a limited number of exitsChris Lattner2004-05-121-22/+61
| | | | | | | | | | | from the extracted region. If the return has 0 or 1 exit blocks, the new function returns void. If it has 2 exits, it returns bool, otherwise it returns a ushort as before. This allows us to use a conditional branch instruction when there are two exit blocks, as often happens during block extraction. llvm-svn: 13481
* Two minor improvements:Chris Lattner2004-05-121-18/+14
| | | | | | | | | | | | 1. Get rid of the silly abort block. When doing bb extraction, we get one abort block for every block extracted, which is kinda annoying. 2. If the switch ends up having a single destination, turn it into an unconditional branch. I would like to add support for conditional branches, but to do this we will want to have the function return a bool instead of a ushort. llvm-svn: 13478
* Do not clone arbitrary condition instructions.Chris Lattner2004-05-021-1/+1
| | | | llvm-svn: 13316
* Do not infinitely "unroll" single BB loops.Chris Lattner2004-05-021-5/+4
| | | | llvm-svn: 13315
* Dont' merge terminators that are needed to select PHI node values.Chris Lattner2004-05-021-1/+1
| | | | llvm-svn: 13312
OpenPOWER on IntegriCloud