1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

276 Commits

Author SHA1 Message Date
Anton Korobeynikov
fd6b669c80 Make Transforms to be 4.3 warnings-clean
llvm-svn: 47371
2008-02-20 11:26:25 +00:00
Chris Lattner
7250586ec9 Fix PR1938 by forcing the code that uses an undefined value to branch one
way or the other.  Rewriting the code itself prevents subsequent analysis
passes from making contradictory conclusions about the code that could 
cause an infeasible path to be made feasible.

llvm-svn: 46427
2008-01-28 00:32:30 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Christopher Lamb
dfad5f19b4 Disable null pointer folding transforms for non-generic address spaces. This should probably be a target-specific predicate based on address space. That way for targets where this isn't applicable the predicate can be optimized away.
llvm-svn: 45403
2007-12-29 07:56:53 +00:00
Dan Gohman
30ba45b569 Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().

llvm-svn: 42585
2007-10-03 19:26:29 +00:00
Duncan Sands
4b390d541e Place SCCPSolver also in the anonymous namespace. This
pacifies g++-4.2.

llvm-svn: 40089
2007-07-20 08:56:21 +00:00
Devang Patel
6e8f1aa332 Fix PR1431
Test case at Transformations/SCCP/2007-05-16-InvokeCrash.ll

llvm-svn: 37185
2007-05-17 22:10:15 +00:00
Nick Lewycky
c2306ff5b4 Fix typo in comment.
llvm-svn: 36873
2007-05-06 13:37:16 +00:00
Devang Patel
cd45427a87 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
8ee9065162 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
38a66bc82e Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Chris Lattner
022c2bc0c3 fix long lines
llvm-svn: 36031
2007-04-14 23:32:02 +00:00
Chris Lattner
758a83d1b0 minor cleanups
llvm-svn: 34904
2007-03-04 04:50:21 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Reid Spencer
8749d297f5 Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.

llvm-svn: 33939
2007-02-05 23:32:05 +00:00
Chris Lattner
d3fb549bdc Switch this back to using an std::map. DenseMap entries are getting invalidated
llvm-svn: 33799
2007-02-02 22:36:16 +00:00
Chris Lattner
3ae99a1181 Remove more malloc thrashing, this speeds up IPSCCP on kimwitu another 6.7%.
llvm-svn: 33796
2007-02-02 21:15:06 +00:00
Chris Lattner
dec49cea56 Convert an std::set to SmallSet, this speeds up IPSCCP 17% on kimwitu.
llvm-svn: 33794
2007-02-02 20:57:39 +00:00
Chris Lattner
e9c0bac4c5 eliminate a malloc/free for (almost) every GEP processed. This speeds up
IPSCCP 3.3% on kimwitu.

llvm-svn: 33793
2007-02-02 20:51:48 +00:00
Chris Lattner
449f7d0d63 switch hash_map's over to DenseMap in SCCP. This speeds up SCCP by 30% in
a release-assert build on kimwitu++.

llvm-svn: 33792
2007-02-02 20:38:30 +00:00
Reid Spencer
591bfa1e0b Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Chris Lattner
7db51ec161 Adjust #includes to match movement of constant folding code from transformutils to libanalysis.
llvm-svn: 33680
2007-01-30 23:46:24 +00:00
Chris Lattner
129e04aa43 use smallvector instead of vector to make constant folding a bit more efficient
llvm-svn: 33672
2007-01-30 23:15:19 +00:00
Reid Spencer
19af04a142 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Chris Lattner
8b6e091a62 Fix a minor bug handling constant exprs, introduced by a recent patch.
llvm-svn: 33175
2007-01-13 00:42:58 +00:00
Reid Spencer
373d2bccea For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer
3d986f6487 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Chris Lattner
06b8d30502 Enable a couple xforms for packed vectors (undef | v) -> -1 for packed.
llvm-svn: 32858
2007-01-04 02:12:40 +00:00
Jim Laskey
06f1a4227e Vectors are not supported by ConstantInt::getAllOnesValue.
llvm-svn: 32827
2007-01-03 00:11:03 +00:00
Reid Spencer
7eeddcbe43 Fix a typo.
llvm-svn: 32803
2006-12-31 22:26:06 +00:00
Reid Spencer
4428c3483b For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Chris Lattner
c4b04b65ba handle undef values much more carefully: generalize the resolveundefbranches
code to handle instructions as well, so that we properly fold things like
X & undef -> 0.
This fixes Transforms/SCCP/2006-12-19-UndefBug.ll

llvm-svn: 32715
2006-12-20 06:21:33 +00:00
Chris Lattner
9e7640cf02 Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic
converted, we lose a static initializer.  This also allows GCC to emit warnings
about unused statistics.

llvm-svn: 32690
2006-12-19 21:40:18 +00:00
Reid Spencer
562b83c7df Change inferred getCast into specific getCast. Passes all tests.
llvm-svn: 32469
2006-12-12 05:05:00 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Chris Lattner
a531ce882e Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Devang Patel
ae17721f63 SCCP does not handle Packed Type properly. Disable Packed Type handling
for now.

llvm-svn: 32208
2006-12-04 23:54:59 +00:00
Bill Wendling
1b3a86000a Removed #include <iostream> and replaced with llvm_* streams.
llvm-svn: 31923
2006-11-26 09:46:52 +00:00
Reid Spencer
4bafa71dc1 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Chris Lattner
91e628645b Handle fallout from the recent branch-on-undef changes. This fixes
Prolangs-C/agrep and SCCP/2006-10-23-IPSCCP-Crash.ll

llvm-svn: 31132
2006-10-23 18:57:02 +00:00
Chris Lattner
50b3810d9a 3 Changes:
1. Better document what is going on here.
2. Only hack on one branch per iteration, making the results less conservative.
3. Handle the problematic case by marking edges executable instead of by
   playing with value lattice states.  This is far less pessimistic, and fixes
   SCCP/ipsccp-gvar.ll.

llvm-svn: 31106
2006-10-22 05:59:17 +00:00
Chris Lattner
6ea0134893 Fix an ugly problem in SCCP. This fixes Benchmarks/Misc-C++/mandel-text.cpp
llvm-svn: 31073
2006-10-20 20:19:08 +00:00
Chris Lattner
168061f13d Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().

llvm-svn: 30665
2006-09-28 23:35:22 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
a0a718c0cc Add supprot for shufflevector
llvm-svn: 27513
2006-04-08 01:19:12 +00:00
Chris Lattner
09ae00eba1 Implement some more interesting select sccp cases. This implements:
test/Regression/Transforms/SCCP/select.ll

llvm-svn: 26049
2006-02-08 02:38:11 +00:00
Chris Lattner
2588f0eb8f Make iostream #inclusion explicit
llvm-svn: 25514
2006-01-22 23:32:06 +00:00
Robert Bocchino
d9fa267a49 Lowerpacked and SCCP support for the insertelement operation.
llvm-svn: 25406
2006-01-17 20:06:55 +00:00
Robert Bocchino
e00d93bc83 Added lower packed support for the extractelement operation.
llvm-svn: 25180
2006-01-10 19:05:05 +00:00
Chris Lattner
7c43a40871 Eliminate GetGEPGlobalInitializer in favor of the more powerful
ConstantFoldLoadThroughGEPConstantExpr function in the utils lib.

llvm-svn: 23446
2005-09-26 05:28:52 +00:00
Jeff Cohen
6c42217055 Eliminate tabs and trailing spaces
llvm-svn: 21480
2005-04-23 21:38:35 +00:00
Misha Brukman
53e199440e Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
145f1ec0a4 Wrap some long lines.
Make IPSCCP strip off dead constant exprs that are using functions, making
them appear as though their address is taken.  This allows us to propagate
some more pool descriptors, lowering the overhead of pool alloc.

llvm-svn: 21363
2005-04-19 19:16:19 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
d1e987d9ae Silence warnings
llvm-svn: 19379
2005-01-08 19:34:41 +00:00
Chris Lattner
02c04bbf45 If one side of and/or is known to be 0/-1, it doesn't matter
if the other side is overdefined.

This allows us to fold conditions like:  if (X < Y || Y > Z) in some cases.

llvm-svn: 18807
2004-12-11 23:15:19 +00:00
Chris Lattner
06bfa390f6 Two bug fixes:
1. Actually increment the Statistic for the GV elim optzn
 2. When resolving undef branches, only resolve branches in executable blocks,
    avoiding marking a bunch of completely dead blocks live.  This has a big
    impact on the quality of the generated code.

With this patch, we positively rip up vortex, compiling Ut_MoveBytes to a
single memcpy call. In vortex we get this:

     12 ipsccp           - Number of globals found to be constant
    986 ipsccp           - Number of arguments constant propagated
   1378 ipsccp           - Number of basic blocks unreachable
   8919 ipsccp           - Number of instructions removed

llvm-svn: 18796
2004-12-11 06:05:53 +00:00
Chris Lattner
5af0ef5c44 Do not delete the entry block to a function.
llvm-svn: 18795
2004-12-11 05:32:19 +00:00
Chris Lattner
943f94d2b3 Implement Transforms/SCCP/ipsccp-gvar.ll, by tracking values stored to
non-address-taken global variables.

llvm-svn: 18790
2004-12-11 05:15:59 +00:00
Chris Lattner
beeab3a124 Fix a bug where we could delete dead invoke instructions with uses.
In functions where we fully constant prop the return value, replace all
ret instructions with 'ret undef'.

llvm-svn: 18786
2004-12-11 02:53:57 +00:00
Chris Lattner
d1d00e017b Implement SCCP/ipsccp-conditional.ll, by totally deleting dead blocks.
llvm-svn: 18781
2004-12-10 22:29:08 +00:00
Chris Lattner
5be2c2e299 Fix SCCP/2004-12-10-UndefBranchBug.ll
llvm-svn: 18776
2004-12-10 20:41:50 +00:00
Chris Lattner
ead42a768e This is the initial implementation of IPSCCP, as requested by Brian.
This implements SCCP/ipsccp-basic.ll, rips apart Olden/mst (as described in
PR415), and does other nice things.

There is still more to come with this, but it's a start.

llvm-svn: 18752
2004-12-10 08:02:06 +00:00
Chris Lattner
92e712b00f Do not delete dead invoke instructions!
llvm-svn: 17897
2004-11-16 16:32:28 +00:00
Chris Lattner
f95f7e05a5 Minor cleanups. There is no reason for SCCP to derive from instvisitor anymore.
llvm-svn: 17825
2004-11-15 07:15:04 +00:00
Chris Lattner
4aa7dc02bf Count more accurately
llvm-svn: 17824
2004-11-15 07:02:42 +00:00
Chris Lattner
e87a1360b3 Two minor improvements:
1. Speedup getValueState by having it not consider Arguments.  It's better
    to just add them before we start SCCP'ing.
 2. SCCP can delete the contents of dead blocks.  No really, it's ok!  This
    reduces the size of the IR for subsequent passes, even though
    simplifycfg would do the same job.  In practice, simplifycfg does not
    run until much later than sccp in gccas

llvm-svn: 17820
2004-11-15 05:45:33 +00:00
Chris Lattner
4ad574191b rename InstValue to LatticeValue, as it holds for more than instructions.
llvm-svn: 17818
2004-11-15 05:03:30 +00:00
Chris Lattner
bde8da9e43 Substantially refactor the SCCP class into an SCCP pass and an SCCPSolver
class.  The only changes are minor:

 * Do not try to SCCP instructions that return void in the rewrite loop.
   This is silly and fool hardy, wasting a map lookup and adding an entry
   to the map which is never used.
 * If we decide something has an undefined value, rewrite it to undef,
   potentially leading to further simplications.

llvm-svn: 17816
2004-11-15 04:44:20 +00:00
Chris Lattner
dd0094e4ed Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
80f963c30b Handle undef values as undefined on the constant lattice
ignore unreachable instructions

llvm-svn: 17044
2004-10-16 18:09:41 +00:00
Chris Lattner
f8a6e4402e Use DEBUG instead of DebugFlag directly, as DebugFlag does not respect
-debug-only!

llvm-svn: 16868
2004-10-09 19:30:36 +00:00
Chris Lattner
c137c9ac39 Prototype these functions more accurately
llvm-svn: 16432
2004-09-20 04:43:15 +00:00
Reid Spencer
c6a8d70cff Convert code to compile with vc7.1.
Patch contributed by Paolo Invernizzi. Thanks Paolo!

llvm-svn: 16368
2004-09-15 17:06:42 +00:00
Reid Spencer
c4abcbefb1 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
Alkis Evlogimenos
f853362a44 Stop using getValues().
llvm-svn: 15487
2004-08-04 08:44:43 +00:00
Reid Spencer
6d26720976 Delete a redundant if branch.
llvm-svn: 14967
2004-07-18 08:34:52 +00:00
Reid Spencer
2a8914b64b bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14947
2004-07-18 00:31:05 +00:00
Chris Lattner
952bbd726b This patch was contributed by Daniel Berlin!
Speed up SCCP substantially by processing overdefined values quickly.  This
patch speeds up SCCP by about 30-40% on large testcases.

llvm-svn: 14861
2004-07-15 23:36:43 +00:00
Chris Lattner
0f61d55197 Fixes working towards PR341
llvm-svn: 14839
2004-07-15 01:50:47 +00:00
Chris Lattner
545e77c9d5 Add SCCP support for constant folding calls, implementing:
test/Regression/Transforms/SCCP/calltest.ll

llvm-svn: 12921
2004-04-13 19:43:54 +00:00
Chris Lattner
9236135e8f Support getelementptr instructions which use uint's to index into structure
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.

llvm-svn: 12653
2004-04-05 01:30:19 +00:00
Chris Lattner
dc22f37eb5 Do not try to optimize PHI nodes with incredibly high degree. This reduces SCCP
time from 615s to 1.49s on a large testcase that has a gigantic switch statement
that all of the blocks in the function go to (an intepreter).

llvm-svn: 12442
2004-03-16 19:49:59 +00:00
Chris Lattner
6b127ea270 Add sccp support for select instructions
llvm-svn: 12318
2004-03-12 05:52:44 +00:00
Chris Lattner
ca3b90f308 Since 'load null' is undefined, we can make it do whatever we want. Returning
a zero value is the most likely way to cause further simplification, so we do it.

llvm-svn: 12197
2004-03-07 22:16:24 +00:00
Chris Lattner
28131460da Adjustments to support the new ConstantAggregateZero class
llvm-svn: 11474
2004-02-15 05:55:15 +00:00
Chris Lattner
758109ce2e Don't use ConstantExpr::getShift anymore
llvm-svn: 10791
2004-01-12 19:08:43 +00:00
Chris Lattner
5a9246fb56 Use constantexprs for casts. Eliminate use of the ConstantHandling interfaces
llvm-svn: 10779
2004-01-12 17:43:40 +00:00
Chris Lattner
8e3cb82d12 Fix fairly severe bug in my last checking where we treated all unfoldable
constants as being "true" when evaluating branches.  This was introduced
because we now create constantexprs for the constants instead of failing the
fold.

llvm-svn: 10778
2004-01-12 17:40:36 +00:00
Chris Lattner
a523d45c39 * Implement minor performance optimization for the getelementptr case
* Implement SCCP of load instructions, implementing Transforms/SCCP/loadtest.ll
  This allows us to fold expressions like "foo"[2], even if the pointer is only
  a conditional constant.

llvm-svn: 10767
2004-01-12 04:29:41 +00:00
Chris Lattner
1269b71517 Implement SCCP/phitest.ll
llvm-svn: 10763
2004-01-12 03:57:30 +00:00
Chris Lattner
d33cc684b5 Finegrainify namespacification
llvm-svn: 10725
2004-01-09 06:02:20 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
ae52a1b309 ADd support for the new varargs instructions
llvm-svn: 9225
2003-10-18 05:56:52 +00:00
Misha Brukman
868eac95dd Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Chris Lattner
bf95cc12a3 Update comment
llvm-svn: 8965
2003-10-08 16:56:11 +00:00
Chris Lattner
9cece85acb Use a set to keep track of which edges have been noticed as executable already
to avoid reprocessing PHI nodes needlessly.  This speeds up the big bad PHI
testcase 43%: from 104.9826 to 73.5157s

llvm-svn: 8964
2003-10-08 16:55:34 +00:00
Chris Lattner
251ff679ce Minor fixes here and there
llvm-svn: 8963
2003-10-08 16:21:03 +00:00
Chris Lattner
36960b263b Avoid building data structures we don't really need. This improves the runtime
of a test that Bill Wendling sent me from 228.5s to 105s.  Obviously there is
more improvement to be had, but this is a nice speedup which should be "felt"
by many programs.

llvm-svn: 8962
2003-10-08 15:47:41 +00:00
Chris Lattner
4ad8720f91 Add support for the unwind instruction
llvm-svn: 8408
2003-09-08 18:54:55 +00:00
Chris Lattner
491ea39105 Fix bug: SCCP/2003-08-26-InvokeHandling.ll
llvm-svn: 8152
2003-08-27 01:08:35 +00:00
Misha Brukman
56f7db4178 Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner
686e94e760 DEBUG got moved to Support/Debug.h
llvm-svn: 7492
2003-08-01 22:15:03 +00:00
Chris Lattner
867b7661cb Fix bug: SCCP/2003-06-24-OverdefinedPHIValue.ll
llvm-svn: 6883
2003-06-24 20:29:52 +00:00
Misha Brukman
825e174bf7 Hopefully, the final fix for `[Pp]ropogate'.
llvm-svn: 6251
2003-05-20 21:01:22 +00:00
Chris Lattner
a7ee27e0fd Handle va_arg instruction correctly
llvm-svn: 6030
2003-05-08 02:50:13 +00:00
Chris Lattner
c78cd5c758 Fix major problem with PHI node traversal: rechecking PHIs should go into
the visit function.  The worklist is for when their lattice value changes.

llvm-svn: 5927
2003-04-25 03:35:10 +00:00
Chris Lattner
7b67a6e77d Minor non-functional changes:
* Spell propagate right
  * Improve performance of phi node handling
  * Delete using directive
  * Other minor changes

llvm-svn: 5920
2003-04-25 02:50:03 +00:00
Chris Lattner
db6b7ba364 Remove unnecesary &*'s
llvm-svn: 5872
2003-04-23 16:37:45 +00:00
Chris Lattner
b9fa84c1ed Make sure to _delete_ memory allocated by worklists
llvm-svn: 4523
2002-11-04 02:54:22 +00:00
Misha Brukman
c9c721edf0 Fix spelling of `propagate'.
llvm-svn: 4423
2002-10-29 23:06:16 +00:00
Chris Lattner
b565d3ac5b - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.

llvm-svn: 4255
2002-10-21 20:00:28 +00:00
Chris Lattner
7cf9f6f4b1 Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.

llvm-svn: 4002
2002-10-01 22:38:41 +00:00
Chris Lattner
bb8f1a072b - Implement SCCP of getelementptr instructions
- Implement SCCP of globals into ConstantExprs hopefully opening new
   opportunities for more SCCP.

llvm-svn: 3555
2002-08-30 23:39:00 +00:00
Chris Lattner
20b85d96e4 Eliminated the MemAccessInst class, folding contents into GEP class.
llvm-svn: 3487
2002-08-22 23:37:20 +00:00
Chris Lattner
34a9a81756 Remove extra #includes
llvm-svn: 3322
2002-08-14 18:17:32 +00:00
Chris Lattner
c264beb7c5 Remove support for unary operators
llvm-svn: 3318
2002-08-14 17:53:45 +00:00
Chris Lattner
7a9eb848cd * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses

llvm-svn: 3113
2002-07-26 21:12:46 +00:00
Chris Lattner
c482880f9e *** empty log message ***
llvm-svn: 3016
2002-07-23 18:06:35 +00:00
Chris Lattner
dfd421a7df MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner
1f2723a2c9 Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline
llvm-svn: 2713
2002-05-22 17:17:27 +00:00
Chris Lattner
245c8615e4 Fix bug: test/Regression/Transforms/SCCP/2002-05-21-InvalidSimplify.ll
Improperly handling edges... by not marking them alive properly

llvm-svn: 2707
2002-05-22 16:07:20 +00:00
Chris Lattner
c3d944c4f7 Fix bug: test/Regression/Transforms/SCCP/2002-05-20-MissedIncomingValue.ll
That was causing a miscompilation of strtol/atoi plus others

llvm-svn: 2669
2002-05-20 20:48:03 +00:00
Chris Lattner
adba963886 Add support for printing out statistics information when -stats is added to
the command line

llvm-svn: 2601
2002-05-10 15:38:35 +00:00
Chris Lattner
2a43c7c03d Merge all individual .h files into a single Scalar.h file
llvm-svn: 2537
2002-05-07 20:03:00 +00:00
Chris Lattner
a35a291f7b Add #include no longer included by llvm/Transforms/Scalar/ConstantProp.h
llvm-svn: 2517
2002-05-07 18:11:30 +00:00
Chris Lattner
394781b660 * Convert InstWorkList to vector instead of set, because on big programs it
is empirically faster by a noticable margin, even though duplicates can
  happen.

llvm-svn: 2511
2002-05-07 04:29:32 +00:00
Chris Lattner
d12eac0b1b Implement constant propogation of shift instructions
llvm-svn: 2471
2002-05-06 03:01:37 +00:00
Chris Lattner
9606fd4830 Ok, really it only takes me 3 times to get this right!
Now use #if 0 instead of #ifdef 0

llvm-svn: 2448
2002-05-02 21:49:50 +00:00
Chris Lattner
de442f70ac Oops, disable debugging code all the way. :)
llvm-svn: 2447
2002-05-02 21:47:40 +00:00
Chris Lattner
7d4f3ed1f2 * Finish the implementation of isEdgeFeasible this fixes bug:
test/Regression/Transforms/SCCP/2002-05-02-EdgeFailure.ll
* SCCP now preserves the CFG:  It leaves conditional branches the way they
  are in the program, not simplifying them.  A seperate pass should eliminate
  the potentially dead basic blocks and edges in the CFG.

llvm-svn: 2446
2002-05-02 21:44:00 +00:00
Chris Lattner
b30088a50d * Enable SCCP debugging to be turned on with a simple change of #define
* Change worklist to a set so that duplicates cannot happen
* Add support for the invoke instruction
* Avoid marking store and free instructions as overdefined, since they
  cannot produce a value anyway.
* Inline the OperandChangedState implementation
* Add isEdgeFeasible in preparation to fix a bug.  Right now it behaves
  exactly as before.
* Remove obsolete comment about constant pools

llvm-svn: 2445
2002-05-02 21:18:01 +00:00
Chris Lattner
28a8acc476 * Simplify the code by not bothering to name the folded constant
* Do not skip the instruction immediately after a folded instruction.  This
  was causing the testcase failure:
	test/Regression/Transforms/SCCP/2002-05-02-MissSecondInst.ll

llvm-svn: 2443
2002-05-02 20:32:51 +00:00
Chris Lattner
5d1ac4dbc9 Significantly clean up SCCP pass. Now the two classes are merged and in
an anonymous namespace where they belong.

llvm-svn: 2415
2002-04-29 21:26:08 +00:00
Chris Lattner
96e0c48175 Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner
589debc4ba Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.

llvm-svn: 2395
2002-04-29 14:57:45 +00:00
Chris Lattner
ec70d92221 Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
llvm-svn: 2386
2002-04-28 21:27:06 +00:00
Chris Lattner
321a8cf4ba Split ConstantVals.h into Constant.h and Constants.h
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner
536cf1b13f * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well

llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Chris Lattner
0c04e4d1ef Changes because the Terminator::getSuccessor function now FAILS if successor
IDX is out of range instead of returning null.

llvm-svn: 2332
2002-04-27 03:15:45 +00:00
Chris Lattner
bb60c83409 Convert SCCP over to use InstVisitor instead of hand crafted switch
llvm-svn: 2286
2002-04-18 15:13:15 +00:00
Chris Lattner
b736829547 GEP instructions can never be constant propogated.
llvm-svn: 2284
2002-04-18 14:44:13 +00:00
Chris Lattner
5e12c7caf5 Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

llvm-svn: 2216
2002-04-09 19:48:49 +00:00
Chris Lattner
31e5838296 s/Method/Function
Remove extraneous #includes of llvm/Assembly/Writer

llvm-svn: 2178
2002-04-08 22:03:00 +00:00
Chris Lattner
44f14449c4 ConstantHandling moved into VMCore library
llvm-svn: 2165
2002-04-08 20:18:09 +00:00
Chris Lattner
849c762b02 Change references from Method to Function
change references from MethodARgument to FunctionArgument

llvm-svn: 1991
2002-03-26 18:01:55 +00:00
Chris Lattner
889b1e5b00 Fix bug: test/Regression/Other/2002-03-11-ConstPropCrash.ll
llvm-svn: 1858
2002-03-11 22:11:07 +00:00