summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Check to make sure types are sized before calling getTypeSize on them.Chris Lattner2004-07-061-13/+15
| | | | llvm-svn: 14649
* It doesn't matter what the 2nd operand is; if the GEP has 2 operands andBrian Gaeke2004-07-061-2/+1
| | | | | | the first is a zero, we should leave it alone. llvm-svn: 14648
* Add helper function.Brian Gaeke2004-07-061-2/+14
| | | | | | | Don't touch GEPs for which DecomposeArrayRef is not going to do anything special (e.g., < 2 indices, or 2 indices and the last one is a constant.) llvm-svn: 14647
* Implement rem.ll:test3Chris Lattner2004-07-061-0/+18
| | | | llvm-svn: 14640
* Fix a minor bug where we would go into infinite loops on some constantsChris Lattner2004-07-061-1/+2
| | | | llvm-svn: 14638
* Implement InstCombine/sub.ll:test15: X % -Y === X % YChris Lattner2004-07-061-2/+9
| | | | | | | Also, remove X % -1 = 0, because it's not true for unsigneds, and the signed case is superceeded by this new handling. llvm-svn: 14637
* Add #include <iostream> since Value.h does not #include it any more.Reid Spencer2004-07-0412-0/+15
| | | | llvm-svn: 14622
* Implement add.ll:test22, a common case in MSIL filesChris Lattner2004-07-031-0/+18
| | | | llvm-svn: 14587
* Do not call getTypeSize on a type that has no sizeChris Lattner2004-07-021-1/+2
| | | | llvm-svn: 14584
* Get rid of a dead variable, and fix a typo in a comment.Brian Gaeke2004-07-021-4/+1
| | | | llvm-svn: 14560
* Make this pass use a more specific debug message than "Processing:".Brian Gaeke2004-07-012-2/+2
| | | | llvm-svn: 14541
* Restoring this file.Vikram S. Adve2004-06-291-0/+76
| | | | llvm-svn: 14478
* Remove unused fileChris Lattner2004-06-281-495/+0
| | | | llvm-svn: 14460
* These passes are long dead/obsolete. They never worked in the first placeChris Lattner2004-06-281-188/+0
| | | | | | and are a maintenence burden. Nuke nuke nuke llvm-svn: 14457
* Implement InstCombine/add.ll:test21Chris Lattner2004-06-271-1/+6
| | | | llvm-svn: 14443
* New constant expression lowering pass to simplify your instruction selection ↵Chris Lattner2004-06-251-0/+171
| | | | | | | | needs. Contributed by Vladimir Prus! llvm-svn: 14399
* This file is unused, and duplicates functionality in TraceValues.cpp.Vikram S. Adve2004-06-241-76/+0
| | | | llvm-svn: 14369
* Two fixes. First, stop using the ugly shouldSubstituteIndVar method.Chris Lattner2004-06-241-1/+7
| | | | | | | Second, disable substitution of quadratic addrec expressions to avoid putting multiplies in loops! llvm-svn: 14358
* 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
* File depends on DSA, moved to lib/Analysis/DataStructureMisha Brukman2004-06-221-495/+0
| | | | llvm-svn: 14325
* *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
* Make order of argument addition deterministic. In particular, the layoutChris Lattner2004-06-211-10/+35
| | | | | | | of ConstantInt objects in memory used to determine which order arguments were added in in some cases. llvm-svn: 14276
* Make use of BinaryOperator::create* methods to shrinkify code.Chris Lattner2004-06-201-21/+14
| | | | llvm-svn: 14262
* Fix the inliner to be deterministic, not letting its output depend on theChris Lattner2004-06-201-4/+3
| | | | | | relative location of Function objects in memory. llvm-svn: 14260
* 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
* Now that dominator tree children are built in determinstic order, this ↵Chris Lattner2004-06-191-16/+2
| | | | | | | | horrible code can go away llvm-svn: 14254
* This will hopefully fix a heisenbug that Vladimir Merzliakov is runningChris Lattner2004-06-191-0/+1
| | | | | | into valiantly trying to compile stuff on freebsd. llvm-svn: 14251
* Fix a nasty bug, noticed by ReidChris Lattner2004-06-191-1/+1
| | | | llvm-svn: 14249
* Fix one source of nondeterminism in the -licm pass: the hoist passChris Lattner2004-06-191-2/+16
| | | | | | | was processing blocks in whatever order they happened to end up in the dominator tree data structure. Force an ordering. llvm-svn: 14248
* 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
OpenPOWER on IntegriCloud