Commit Graph

1561 Commits

Author SHA1 Message Date
Chris Lattner f11216d24f Fix a bug in the previous checkin that broke 255.vortex
llvm-svn: 16355
2004-09-15 02:34:40 +00:00
Chris Lattner a346578d92 Make sure to update alias analysis information as we transform the function.
This fixes PR420 and Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx

llvm-svn: 16348
2004-09-15 01:04:07 +00:00
Chris Lattner 9b9932bd94 If given an AliasSetTracker object to update, update it.
llvm-svn: 16347
2004-09-15 01:02:54 +00:00
Chris Lattner f41b80a05f Remove a long-dead pass. Actually, this pass was never used at all.
llvm-svn: 16337
2004-09-14 16:33:01 +00:00
Alkis Evlogimenos a5c04ee50f Fixes to make LLVM compile with vc7.1.
Patch contributed by Paolo Invernizzi!

llvm-svn: 16152
2004-09-03 18:19:51 +00:00
Reid Spencer 7c16caa336 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/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer f39f66e3ef Initial checkin of a pass to lower packed operations to scalars operations.
This also registers the pass with opt with a -lower-packed command line
option.

Patch contributed by Brad Jones.

llvm-svn: 15987
2004-08-21 21:39:24 +00:00
Chris Lattner 14c198d09a If we are linking two global variables and they have the same size, do not
spew warnings, even if the types don't match.

llvm-svn: 15933
2004-08-20 00:30:39 +00:00
Chris Lattner 6139134715 Implement test/Regression/Transforms/GlobalConstifier/phi-select.llx
This allows more globals to be marked constant, particularly global arrays.

llvm-svn: 15735
2004-08-14 20:57:17 +00:00
Chris Lattner 56273827b1 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).

llvm-svn: 15717
2004-08-13 03:27:07 +00:00
Chris Lattner f06b043204 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

llvm-svn: 15716
2004-08-13 03:17:39 +00:00
Chris Lattner 7386e6333d "extract" the block extractor pass from bugpoint (haha)
llvm-svn: 15714
2004-08-13 03:05:17 +00:00
Chris Lattner 889d346e6e 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

llvm-svn: 15712
2004-08-13 02:43:19 +00:00
Chris Lattner cde351ee30 This patch makes the inliner refuse to inline functions that have alloca
instructions in the body of the function (not the entry block).  This fixes
test/Programs/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c
and test/Programs/External/SPEC/CINT2000/176.gcc on zion.

This should obviously be pulled into 1.3.

llvm-svn: 15684
2004-08-12 05:45:09 +00:00
Chris Lattner 7f1c7ede5b Fix code extraction of unwind blocks. This fixed bugs that bugpoint can
run into.  This should go into 1.3

llvm-svn: 15679
2004-08-12 03:17:02 +00:00
Chris Lattner a7ba90e672 Hrm, this pass didn't compile. This bugfix should go into 1.3!
llvm-svn: 15676
2004-08-12 02:44:23 +00:00
Chris Lattner 4456da6a4c Fix InstCombine/2004-08-10-BoolSetCC.ll, a bug that is miscompiling
176.gcc.  Note that this is apparently not the only bug miscompiling gcc
though. :(

llvm-svn: 15639
2004-08-11 00:50:51 +00:00
Chris Lattner 8e7260652b Fix InstCombine/2004-08-09-RemInfLoop.llx
This should go into the 1.3 branch

llvm-svn: 15593
2004-08-09 21:05:48 +00:00
Chris Lattner 4956a32c9e Fix another really nasty regression that Anshu pointed out. In cases where
dangling constant users were removed from a function, causing it to be dead,
we never removed the call graph edge from the external node to the function.

In most cases, this didn't cause a problem (by luck).  This should definitely
go into 1.3

llvm-svn: 15570
2004-08-08 03:29:50 +00:00
Chris Lattner 92b9906199 Two fixes:
1. Fix a REALLY nasty cyclic replacement issue that Anshu discovered, causing
   nondeterminstic crashes and memory corruption.
2. For performance, don't go inserting constantexpr casts of GV pointers.

This should definitely go into 1.3

llvm-svn: 15568
2004-08-08 01:30:07 +00:00
Chris Lattner 6a93462144 This DEBUG is buggy. comment it out because it's not worth fixing. This
should go into 1.3

llvm-svn: 15567
2004-08-08 01:27:56 +00:00
Alkis Evlogimenos 832437255d Stop using getValues().
llvm-svn: 15487
2004-08-04 08:44:43 +00:00
Chris Lattner 7aa2d4747a Fix a regression in InstCombine/xor.ll
llvm-svn: 15410
2004-08-01 19:42:59 +00:00
Chris Lattner 7471b96a05 Expose this as a functionpass
llvm-svn: 15369
2004-07-31 10:01:58 +00:00
Misha Brukman 9c003d8f65 Fix De Morgan's name.
llvm-svn: 15343
2004-07-30 12:50:08 +00:00
Chris Lattner d4252a7c64 Start using the PatternMatcher a bit.
llvm-svn: 15342
2004-07-30 07:50:03 +00:00
Misha Brukman f4a410f907 Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15337
2004-07-29 17:30:57 +00:00
Misha Brukman 63b38bd2ed Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15334
2004-07-29 17:30:56 +00:00
Misha Brukman 2b3387a6d9 Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15328
2004-07-29 17:05:13 +00:00
Alkis Evlogimenos fd7a2d4477 Merge i*.h headers into Instructions.h as part of bug403.
llvm-svn: 15325
2004-07-29 12:17:34 +00:00
Robert Bocchino 7b5b86cd0f This change fixed a bug in the function visitMul. The prior version
assumed that a constant on the RHS of a multiplication was either an
IntConstant or an FPConstant.  It checked for an IntConstant and then,
if it did not find one, did a hard cast to an FPConstant.  That code
would crash if the RHS were a ConstantExpr that was neither an
IntConstant nor an FPConstant.  This version replaces the hard cast
with a dyn_cast.  It performs the same way for IntConstants and
FPConstants but does nothing, instead of crashing, for constant
expressions.

The regression test for this change is 2004-07-27-ConstantExprMul.ll.

llvm-svn: 15291
2004-07-27 21:02:21 +00:00
Brian Gaeke 38b79e8fbc Make the create...() functions for some of these passes return a FunctionPass *.
llvm-svn: 15276
2004-07-27 17:43:21 +00:00
Chris Lattner 50eb771d37 Fix hoisting of void typed values, e.g. calls
llvm-svn: 15263
2004-07-27 07:38:32 +00:00
Chris Lattner f29807169a Implement DeadStoreElim/alloca.llx by observing that allocas are dead at the
end of the function (either return or unwind)

llvm-svn: 15232
2004-07-26 06:14:11 +00:00
Chris Lattner e5ad26dbb3 Throttle back indvar substitution from creating multiplies in loops. This is bad bad bad.
llvm-svn: 15227
2004-07-26 02:47:12 +00:00
Chris Lattner 7b25bcdf52 * Substantially simplify how free instructions are handled (potentially fixing
a bug in DSE).
* Delete dead operand uses iteratively instead of recursively, using a
  SetVector.
* Defer deletion of dead operand uses until the end of processing, which means
  we don't have to bother with updating the AliasSetTracker.  This speeds up
  DSE substantially.

llvm-svn: 15204
2004-07-25 11:09:56 +00:00
Chris Lattner 4c1c1ac7e4 Free instructions kill values too. This implements DeadStoreElim/free.llx
llvm-svn: 15199
2004-07-25 07:58:38 +00:00
Chris Lattner bad6478b00 obvious fix
llvm-svn: 15162
2004-07-24 07:51:27 +00:00
Chris Lattner 3844c300de This is a trivial dead store elimination pass. It very very simple and
can be improved in many ways.  But: stop laughing, even with -basicaa it
deletes 15% of the stores in 252.eon :)

llvm-svn: 15101
2004-07-22 08:00:28 +00:00
Chris Lattner 51f7c9e56d Update GC intrinsics to take a pointer to the object as well as a pointer
to the field being updated.  Patch contributed by Tobias Nurmiranta

llvm-svn: 15097
2004-07-22 05:51:13 +00:00
Brian Gaeke 902dcf0729 These files don't need to include <iostream> since they include "Support/Debug.h".
llvm-svn: 15089
2004-07-21 20:50:33 +00:00
Chris Lattner d8f5e2ccac * Further cleanup.
* Test for whether bits are shifted out during the optzn.

If so, the fold is illegal, though it can be handled explicitly for setne/seteq

This fixes the miscompilation of 254.gap last night, which was a latent bug
exposed by other optimizer improvements.

llvm-svn: 15085
2004-07-21 20:14:10 +00:00
Chris Lattner 1638de4499 Make cast-cast code a bit more defensive
"simplify" a bit of code for comparison/and folding

llvm-svn: 15082
2004-07-21 19:50:44 +00:00
Chris Lattner 4fbad968f8 Remove special casing of pointers and treat them generically as integers of
the appopriate size.  This gives us the ability to eliminate int -> ptr -> int

llvm-svn: 15063
2004-07-21 04:27:24 +00:00
Chris Lattner 45b50d14c9 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.

llvm-svn: 15030
2004-07-20 05:45:24 +00:00
Chris Lattner 11ffd59e37 Implement Transforms/InstCombine/IntPtrCast.ll
llvm-svn: 15029
2004-07-20 05:21:00 +00:00
Chris Lattner ec67df0ed1 Ignore instructions that are in trivially dead functions. This allows us
to constify 14 globals instead of 4 in a trivial C++ testcase.

llvm-svn: 15027
2004-07-20 03:58:07 +00:00
Chris Lattner 44d0b9502a Implement InstCombine/GEPIdxCanon.ll
llvm-svn: 15024
2004-07-20 01:48:15 +00:00
Chris Lattner 5823ac1c21 Implement SimplifyCFG/BrUnwind.ll
llvm-svn: 15022
2004-07-20 01:17:38 +00:00
Chris Lattner 4e2dbc6b4a Rewrite cast->cast elimination code completely based on the information we
actually care about.  Someday when the cast instruction is gone, we can do
better here, but this will do for now.  This implements
instcombine/cast.ll:test17/18 as well.

llvm-svn: 15018
2004-07-20 00:59:32 +00:00