Owen Anderson
93ccaf5c60
Move more code back to 2.5 APIs.
...
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Owen Anderson
0ce2151b36
Move ConstantExpr to 2.5 API.
...
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
Daniel Dunbar
75a66c519b
Eliminate some uses of DOUT, cerr, and getNameStart().
...
llvm-svn: 77145
2009-07-26 07:49:05 +00:00
Daniel Dunbar
8496064116
More migration to raw_ostream, the water has dried up around the iostream hole.
...
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
"magic" DOUT behavior which avoided calling printing functions when the
statement was disabled. In addition to being unnecessary magic, it had the
downside of leaving code in -Asserts builds, and of hiding potentially
unnecessary computations.
llvm-svn: 77019
2009-07-25 00:23:56 +00:00
Owen Anderson
cc287b28c9
Get rid of the Pass+Context magic.
...
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Owen Anderson
7f61f8dc30
Rename getConstantInt{True|False} to get{True|False} at Chris' behest.
...
llvm-svn: 76598
2009-07-21 18:03:38 +00:00
Owen Anderson
21d2d69727
Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
...
our current context-passing stuff, which is also fixed here
llvm-svn: 76089
2009-07-16 18:04:31 +00:00
Torok Edwin
f955a6ef49
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
...
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").
llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Owen Anderson
1e5155161a
Move more functionality over to LLVMContext.
...
llvm-svn: 75497
2009-07-13 20:58:05 +00:00
Torok Edwin
ae8a3ff177
assert(0) -> LLVM_UNREACHABLE.
...
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.
llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Torok Edwin
9b41a5faf2
Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
...
and abort()/exit() -> llvm_report_error().
llvm-svn: 75363
2009-07-11 13:10:19 +00:00
Owen Anderson
121f736d9c
"LLVMContext* " --> "LLVMContext *"
...
llvm-svn: 74878
2009-07-06 23:00:19 +00:00
Owen Anderson
5f268720e9
Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's through the ValueTracking API.
...
llvm-svn: 74873
2009-07-06 22:37:39 +00:00
Owen Anderson
ad3229d281
Thread LLVMContext through the constant folding APIs, which touches a lot of files.
...
llvm-svn: 74844
2009-07-06 18:42:36 +00:00
Owen Anderson
a8ce571a68
Even more passes being LLVMContext'd.
...
llvm-svn: 74781
2009-07-03 19:42:02 +00:00
Nick Lewycky
1a54547335
Don't crash on multiple return value with no obvious inserted value.
...
Fixes PR4314.
llvm-svn: 73007
2009-06-06 23:13:08 +00:00
Nick Lewycky
3dd0d690f3
Use Operands.data() instead of &Operands[0] where Operands is a potentially
...
empty SmallVector.
llvm-svn: 72512
2009-05-28 04:08:10 +00:00
Duncan Sands
3c115770e7
Factorize out a concept - no functionality change.
...
llvm-svn: 67454
2009-03-21 21:27:31 +00:00
Duncan Sands
926d062a48
Don't load values out of global constants with weak
...
linkage: the value may be replaced with something
different at link time. (Frontends that want to
allow values to be loaded out of weak constants can
give their constants weak_odr linkage).
llvm-svn: 67407
2009-03-20 21:53:29 +00:00
Rafael Espindola
0aba6c9435
Add the private linkage.
...
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Chris Lattner
fa0c0e19f6
Fix PR3325, a miscompilation of invokes by IPSCCP. Patch by Jay Foad!
...
llvm-svn: 62244
2009-01-14 21:01:16 +00:00
Devang Patel
b6d277da6c
Fix unused variable warnings.
...
llvm-svn: 59778
2008-11-21 01:52:59 +00:00
Nick Lewycky
f393d56364
Replace explicit loop with utility function.
...
llvm-svn: 58593
2008-11-03 03:49:14 +00:00
Dan Gohman
e1f9be27bc
Tidy up several unbeseeming casts from pointer to intptr_t.
...
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Chris Lattner
9f10b57760
improve encapsulation of the BBExecutable set.
...
llvm-svn: 55271
2008-08-23 23:39:31 +00:00
Chris Lattner
15f29cad83
Switch an assortment of maps, sets and vectors to more efficient versions,
...
patch contributed by m-s!
llvm-svn: 55270
2008-08-23 23:36:38 +00:00
Bill Wendling
bebfe7b7fc
Temporarily revert r54792. It's causing an ICE during bootstrapping.
...
llvm-svn: 54804
2008-08-14 23:05:24 +00:00
Devang Patel
8aa62f7dfa
Use DenseMap. Patch by Pratik Solanki.
...
llvm-svn: 54792
2008-08-14 21:31:10 +00:00
Dan Gohman
374d9328b7
Fix SCCP's handling of struct value loads and stores. SCCP doesn't
...
track individual leaf values in such cases, so it needs to treat
struct values as normal values in this case.
llvm-svn: 54760
2008-08-13 21:22:48 +00:00
Dan Gohman
6564581be0
Enable first-class aggregates support.
...
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.
The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.
llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Dan Gohman
fcc6f11fc3
Tidy up some commments and use the getAggregateOperand and
...
getInsertedValueOperand accessors. Thanks Matthijs!
llvm-svn: 52543
2008-06-20 16:41:17 +00:00
Dan Gohman
3968f90c4c
Fix the conditions under which SCCP should examine insertvalue
...
instructions. Thanks to Matthijs Kooijman for pointing this out!
llvm-svn: 52542
2008-06-20 16:39:44 +00:00
Dan Gohman
b4ee9dfc2d
Teach SCCP about insertvalue and extractvalue, and about
...
propagating constants across aggregate return values when
insertvalue and extractvalue are used.
llvm-svn: 52520
2008-06-20 01:15:44 +00:00
Chris Lattner
bde5fd685d
Fix PR2358 by resolving calls with undef arguments to overdefined.
...
llvm-svn: 51535
2008-05-24 03:59:33 +00:00
Dale Johannesen
da54faec0c
Allow for switch with no cases. Was causing fault
...
in gcc.dg/pr27531-1.c.
llvm-svn: 51464
2008-05-23 01:01:31 +00:00
Dan Gohman
bab18cae46
Clean up the use of static and anonymous namespaces. This turned up
...
several things that were neither in an anonymous namespace nor static
but not intended to be global.
llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Chris Lattner
b700ffd977
Fix various DOUTs to not call the extremely expensive Value::getName()
...
method. DOUT statements are disabled when assertions are off, but the
side effects of getName() are still evaluated. Just call getNameSTart,
which is close enough and doesn't cause heap traffic.
llvm-svn: 50958
2008-05-11 01:55:59 +00:00
Chris Lattner
858c3299c1
Simplify code by using SwitchInst::findCaseValue instead of reimplementing it.
...
llvm-svn: 50957
2008-05-10 23:56:54 +00:00
Nick Lewycky
1f831c0f57
Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
...
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.
llvm-svn: 50265
2008-04-25 16:53:59 +00:00
Chris Lattner
a646a59205
code restructuring, not functionality change.
...
llvm-svn: 50203
2008-04-24 00:21:50 +00:00
Chris Lattner
10ffed0ed0
Don't replace multiple result of calls with undef,
...
sccp tracks getresult values, not call values in this
case.
llvm-svn: 50202
2008-04-24 00:19:54 +00:00
Chris Lattner
8c6e641cf4
code cleanup, no functionality change.
...
llvm-svn: 50201
2008-04-24 00:16:28 +00:00
Chris Lattner
721ea7ca10
Rewrite multiple return value handling in SCCP. Before, the -sccp pass
...
would turn every getresult instruction into undef. This helps with
rdar://5778210
llvm-svn: 50140
2008-04-23 05:38:20 +00:00
Devang Patel
47b4a18b75
Be conservative if getresult operand is neither call nor invoke.
...
llvm-svn: 49430
2008-04-09 15:58:24 +00:00
Gabor Greif
6c6b8a57f3
API changes for class Use size reduction, wave 1.
...
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.
llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Dan Gohman
a363ba510c
Don't include <map> in Pass.h, which doesn't need it. This requires
...
adding <map> to many files that actually do need it.
llvm-svn: 48667
2008-03-21 23:51:57 +00:00
Devang Patel
e163bda565
Add TODO reminder.
...
llvm-svn: 48227
2008-03-11 17:32:05 +00:00
Devang Patel
6c189c16b5
Initial multiple return values support.
...
llvm-svn: 48210
2008-03-11 05:46:42 +00:00
Nick Lewycky
8626cfb86d
SCCP also needs to be taught to follow unwind_to
...
llvm-svn: 48109
2008-03-09 09:44:38 +00:00
Nick Lewycky
e13db2c263
Not all users of a BB are Instructions any more.
...
llvm-svn: 48047
2008-03-08 07:48:41 +00:00
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