summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Do not loop over uses as we delete them. This causes iterators to beChris Lattner2004-06-191-3/+2
| | | | | | invalidated out from under us. This bug goes back to revision 1.1: scary. llvm-svn: 14242
* Implement Transforms/InstCombine/and.ll:test17, a common case thatChris Lattner2004-06-181-3/+15
| | | | | | occurs due to unordered comparison macros in math.h llvm-svn: 14221
* Do not function resolve intrinsics. This prevents warnings and possible badChris Lattner2004-06-181-1/+2
| | | | | | | | | things from happening due to declare bool %llvm.isunordered(double, double) declare bool %llvm.isunordered(float, float) llvm-svn: 14219
* 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-173-5/+5
| | | | llvm-svn: 14201
* Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()Chris Lattner2004-06-171-29/+5
| | | | | | Delete two functions that are now methods on the Type class llvm-svn: 14200
* Fix typo in DEBUG printout.Brian Gaeke2004-06-171-1/+1
| | | | llvm-svn: 14196
* 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
* Fix a bug in my checkin from last night that caused miscompilations ofChris Lattner2004-06-101-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 186.crafty, fhourstones and 132.ijpeg. Bugpoint makes really nasty miscompilations embarassingly easy to find. It narrowed it down to the instcombiner and this testcase (from fhourstones): bool %l7153_l4706_htstat_loopentry_2E_4_no_exit_2E_4(int* %i, [32 x int]* %works, int* %tmp.98.out) { newFuncRoot: %tmp.96 = load int* %i ; <int> [#uses=1] %tmp.97 = getelementptr [32 x int]* %works, long 0, int %tmp.96 ; <int*> [#uses=1] %tmp.98 = load int* %tmp.97 ; <int> [#uses=2] %tmp.99 = load int* %i ; <int> [#uses=1] %tmp.100 = and int %tmp.99, 7 ; <int> [#uses=1] %tmp.101 = seteq int %tmp.100, 7 ; <bool> [#uses=2] %tmp.102 = cast bool %tmp.101 to int ; <int> [#uses=0] br bool %tmp.101, label %codeRepl4.exitStub, label %codeRepl3.exitStub codeRepl4.exitStub: ; preds = %newFuncRoot store int %tmp.98, int* %tmp.98.out ret bool true codeRepl3.exitStub: ; preds = %newFuncRoot store int %tmp.98, int* %tmp.98.out ret bool false } ... which only has one combination performed on it: $ llvm-as < t.ll | opt -instcombine -debug | llvm-dis IC: Old = %tmp.101 = seteq int %tmp.100, 7 ; <bool> [#uses=1] New = setne int %tmp.100, 0 ; <bool>:<badref> [#uses=0] IC: MOD = br bool %tmp.101, label %codeRepl3.exitStub, label %codeRepl4.exitStub IC: MOD = %tmp.97 = getelementptr [32 x int]* %works, uint 0, int %tmp.96 ; <int*> [#uses=1] It doesn't get much better than this. :) llvm-svn: 14109
* More minor cleanupsChris Lattner2004-06-101-11/+8
| | | | llvm-svn: 14108
* Eliminate many occurrances of Instruction::Chris Lattner2004-06-101-134/+112
| | | | llvm-svn: 14107
* Implement InstCombine/select.ll:test15*Chris Lattner2004-06-091-40/+90
| | | | llvm-svn: 14095
* Be more careful about the order we put stuff onto the worklist. This allow ↵Chris Lattner2004-06-091-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | us to collapse this: bool %le(int %A, int %B) { %c1 = setgt int %A, %B %tmp = select bool %c1, int 1, int 0 %c2 = setlt int %A, %B %result = select bool %c2, int -1, int %tmp %c3 = setle int %result, 0 ret bool %c3 } into: bool %le(int %A, int %B) { %c3 = setle int %A, %B ; <bool> [#uses=1] ret bool %c3 } which is handy, because the Java FE makes these sequences all over the place. This is tested as: test/Regression/Transforms/InstCombine/JavaCompare.ll llvm-svn: 14086
* Implement select.ll:test14*Chris Lattner2004-06-091-35/+59
| | | | llvm-svn: 14083
* Expand head-of-file comment.Brian Gaeke2004-06-031-1/+3
| | | | llvm-svn: 13982
* Use new form of unconditional branch constructor.Brian Gaeke2004-06-011-1/+1
| | | | llvm-svn: 13930
* Fix one of the major things that is causing the C Backend to infinite loopChris Lattner2004-05-281-0/+1
| | | | llvm-svn: 13872
* Fix a bug in the -deadtypeelim pass. The SymbolTable re-write changed itJohn Criswell2004-05-271-1/+1
| | | | | | to eliminate the wrong type. llvm-svn: 13855
* Fix InstCombine/load.ll & PR347.Chris Lattner2004-05-271-12/+24
| | | | | | | | | | This code hadn't been updated after the "structs with more than 256 elements" related changes to the GEP instruction. Also it was not handling the ConstantAggregateZero class. Now it does! llvm-svn: 13834
* 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-253-32/+31
| | | | llvm-svn: 13754
* Convert to SymbolTable's new lookup and iteration interfaces.Reid Spencer2004-05-251-23/+23
| | | | llvm-svn: 13751
* Remove unused header file.Reid Spencer2004-05-251-1/+0
| | | | llvm-svn: 13750
* Make this pass simply invoke SymbolTable::strip().Reid Spencer2004-05-251-31/+2
| | | | llvm-svn: 13749
* Implement InstCombine:shift.ll:test16, which turns (X >> C1) & C2 != C3Chris Lattner2004-05-251-0/+35
| | | | | | | | | | into (X & (C2 << C1)) != (C3 << C1), where the shift may be either left or right and the compare may be any one. This triggers 1546 times in 176.gcc alone, as it is a common pattern that occurs for bitfield accesses. llvm-svn: 13740
* Implement instcombine/cast.ll:test16:Chris Lattner2004-05-251-0/+5
| | | | | | Canonicalize cast X to bool into a setne instruction llvm-svn: 13736
* Fix a bug in my previous checkinChris Lattner2004-05-241-0/+1
| | | | llvm-svn: 13717
* Spelling people's names right is kinda importantChris Lattner2004-05-231-1/+1
| | | | llvm-svn: 13702
* Fix cases where we missed inlining some more obvious candidates because theChris Lattner2004-05-231-79/+108
| | | | | | caller was in an SCC. llvm-svn: 13693
* Simplify the interface and remove an unneeded #includeChris Lattner2004-05-231-9/+1
| | | | llvm-svn: 13692
* Fairly substantial changes to update the alias analysis we are querying asChris Lattner2004-05-231-39/+92
| | | | | | | we make the transformation. This allows us to use interprocedural alias analyses successfully. llvm-svn: 13691
* Adjust to the changes in the AliasSetTracker interfaceChris Lattner2004-05-231-16/+14
| | | | llvm-svn: 13690
* Add support for replacement of formal arguments with simpler expressions.Chris Lattner2004-05-231-2/+23
| | | | llvm-svn: 13689
* Implement the -lowergc pass which is used by code generators (like the CBE)Chris Lattner2004-05-231-0/+326
| | | | | | that do not have builtin support for garbage collection. llvm-svn: 13688
* 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
* Clean up this pass somewhat:Brian Gaeke2004-05-141-42/+38
| | | | | | | | | | | | Add better comments, including a better head-of-file comment. Prune #includes. Fix a FIXME that Chris put here by using doInitialization(). Use DEBUG() to print out debug msgs. Give names to basic blocks inserted by this pass. Expand tabs. Use InsertProfilingInitCall() from ProfilingUtils to insert the initialize call. llvm-svn: 13581
* This was not meant to be committedChris Lattner2004-05-131-7/+0
| | | | llvm-svn: 13565
* Fix a nasty bug that caused us to unroll EXTREMELY large loops due to overflowChris Lattner2004-05-132-3/+10
| | | | | | | | | | | | | | | | | | | | in the size calculation. This is not something you want to see: Loop Unroll: F[main] Loop %no_exit Loop Size = 2 Trip Count = 2147483648 - UNROLLING! The problem was that 2*2147483648 == 0. Now we get: Loop Unroll: F[main] Loop %no_exit Loop Size = 2 Trip Count = 2147483648 - TOO LARGE: 4294967296>100 Thanks to some anonymous person playing with the demo page that repeatedly caused zion to go into swapping land. That's one way to ensure you'll get a quick bugfix. :) Testcase here: Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll llvm-svn: 13564
OpenPOWER on IntegriCloud