Commit Graph

443 Commits

Author SHA1 Message Date
Chris Lattner
9c07866ef8 When converting phi nodes into select instructions, we shouldn't promote PHI
nodes unless we KNOW that we are able to promote all of them.

This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16973 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-14 05:13:36 +00:00
Reid Spencer
d96cb6eaa0 Update to reflect changes in Makefile rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16950 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-13 11:46:52 +00:00
Reid Spencer
81f76b324e Initial version of automake Makefile.am file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16893 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-10 22:20:40 +00:00
Chris Lattner
0ed7f42c1b Do not insert trivially dead select instructions, which allows us to
potentially fold more in one pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16583 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-29 05:43:32 +00:00
Alkis Evlogimenos
200a360ec6 Pull assignment out of for loop conditional in order for this to
compile under windows. Patch contributed by Paolo Invernizzi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16534 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28 02:40:37 +00:00
Chris Lattner
4b50156049 Prototype these functions more accurately
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16432 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:43:15 +00:00
Chris Lattner
a744b77e11 Remove a whole bunch of horrible hacky code that was used to promote allocas
whose addresses where used by trivial phi nodes and select instructions.  This
is now performed by the instcombine pass, which is more powerful, is much
simpler, and is faster.  This allows the deletion of a bunch of code, two
FIXME's and two gotos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16406 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-19 18:51:51 +00:00
Chris Lattner
afbb1ccd2f Make sure to remove the Select instruction as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16389 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-18 00:32:40 +00:00
Reid Spencer
2da5c3dda6 Convert code to compile with vc7.1.
Patch contributed by Paolo Invernizzi. Thanks Paolo!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16368 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-15 17:06:42 +00:00
Chris Lattner
62e29b59f5 If given an AliasSetTracker object to update, update it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16347 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-15 01:02:54 +00:00
Alkis Evlogimenos
20aa474f8f Fixes to make LLVM compile with vc7.1.
Patch contributed by Paolo Invernizzi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16152 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-03 18:19:51 +00:00
Reid Spencer
551ccae044 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Chris Lattner
a670c684a6 If we are extracting a block that has multiple successors that are the same
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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15717 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 03:27:07 +00:00
Chris Lattner
337772832b When we code extract some stuff, leave the codeRepl block in the place where
the extracted code was, instead of putting it at the end of the function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15716 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 03:17:39 +00:00
Chris Lattner
eb6f18fe7c Add value mapper support for select constant exprs. This should fix a bug
Nate ran into when bugpointing siod.  This fix should go into LLVM 1.3


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15712 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-13 02:43:19 +00:00
Chris Lattner
b519efbafe Fix code extraction of unwind blocks. This fixed bugs that bugpoint can
run into.  This should go into 1.3


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15679 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-12 03:17:02 +00:00
Alkis Evlogimenos
15876bb28c Stop using getValues().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15487 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 08:44:43 +00:00
Chris Lattner
1e5fdf8ba0 Expose this as a functionpass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15369 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-31 10:01:58 +00:00
Misha Brukman
78c038d0cc Fix #includes of i*.h => Instructions.h as per PR403.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15337 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 17:30:57 +00:00
Misha Brukman
47b14a4a6a Fix #includes of i*.h => Instructions.h as per PR403.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15334 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 17:30:56 +00:00
Misha Brukman
d8e1eea678 Fix #includes of i*.h => Instructions.h as per PR403.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15328 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 17:05:13 +00:00
Alkis Evlogimenos
eb62bc77b6 Merge i*.h headers into Instructions.h as part of bug403.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15325 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 12:17:34 +00:00
Brian Gaeke
7848e68c16 These files don't need to include <iostream> since they include "Support/Debug.h".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15089 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 20:50:33 +00:00
Chris Lattner
adfd32f8ee Fix a serious code pessimization problem. If an inlined function has a single
return, clone the 'ret' BB code into the block AFTER the inlined call, not the
other way around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15030 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 05:45:24 +00:00
Chris Lattner
af17b1df84 Implement SimplifyCFG/BrUnwind.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15022 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-20 01:17:38 +00:00
Reid Spencer
e95ff9afa0 Remove an if statement that would never be reached.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14968 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 08:41:47 +00:00
Reid Spencer
518310cb0d bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:44:37 +00:00
Reid Spencer
460f16c625 bug 122:
- Minimize redundant isa<GlobalValue> usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14948 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:32:14 +00:00
Chris Lattner
fed22aac43 Fix PR404 try #2
This version takes about 1s longer than the previous one (down to 2.35s),
but on the positive side, it actually works :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14856 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 08:20:22 +00:00
Chris Lattner
de7aee760e Revert previous patch until I get a bug fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14853 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 05:36:31 +00:00
Chris Lattner
507e3d6dc3 Fix PR404: Loop simplify is really slow on 252.eon
This eliminates an N*N*logN algorithm from the loop simplify pass, replacing
it with a much simpler and faster alternative.  In a debug build, this reduces
gccas time on eon from 85s to 42s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14851 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 04:27:04 +00:00
Chris Lattner
30b4344767 Progress on PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14840 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 02:06:12 +00:00
Chris Lattner
8bfc2f11a4 Now that we codegen the portable "sizeof" efficiently, we can use it for
malloc lowering.  This means that lowerallocations doesn't need targetdata
anymore.  yaay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14835 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-15 01:08:08 +00:00
Reid Spencer
954da37bb4 Add #include <iostream> since Value.h does not #include it any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14622 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:19:56 +00:00
Misha Brukman
909db65e67 Moved to lib/VMCore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14348 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 17:21:17 +00:00
Brian Gaeke
1f2b892b4b Use new IsNAN() wrapper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14340 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 00:25:35 +00:00
Chris Lattner
2636c1be17 *FINALLY* Fix a really nasty nondeterministic bug that has been haunting us
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14278 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 07:19:01 +00:00
Chris Lattner
30c02f7eff Comment out the isnan stuff until we get a proper autoconf test for it
breaking the build on sparc is not acceptable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14277 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 06:17:21 +00:00
Chris Lattner
218a8223e6 Add some DEBUG output to the simplifycfg routines
Fix another non-deterministic behavior, this one should actually speed up the
code though as it was doing silly things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14258 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 01:13:18 +00:00
Chris Lattner
abc35bcad3 Change to use the StableBasicBlockNumbering class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14247 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 08:42:40 +00:00
Chris Lattner
63168d2244 Do not let the numbering of PHI nodes placed in the function depend on
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14244 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 07:40:14 +00:00
Chris Lattner
1654cff8e8 Do not sort by the address of LLVM ConstantInt* objects. This produces
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14243 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 07:02:14 +00:00
Brian Gaeke
afe16e1742 I love the smell of a freshly broken PowerPC build in the morning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14206 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:27:04 +00:00
Chris Lattner
5253f05709 Fix compilation problem on freebsd. Problem noted by Vladimir Merzliakov in
PR371


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14203 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 21:20:52 +00:00
Chris Lattner
f70c22b019 Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 18:19:28 +00:00
Brian Gaeke
83a7049270 Um, did someone make a typo or something?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14192 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 23:09:50 +00:00
Chris Lattner
c45ef6d395 Remove support for the isnan intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14186 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:37:54 +00:00
Brian Gaeke
fda2cce3bf Quick hack to get this file compiling again on Mac OS X. The right thing to do
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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14171 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-14 06:33:19 +00:00
Alkis Evlogimenos
df497317f1 Add constant folding capabilities to the isunordered intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14168 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-13 01:23:56 +00:00
Chris Lattner
cf11035a6f Constant fold the isnan intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14150 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 06:16:23 +00:00