History log of /external/llvm/lib/VMCore/ConstantFold.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
56cb2298663017eb77aa4f4dda8db7ecd1b58173 19-Jul-2012 Bill Wendling <isanbard@gmail.com> Remove tabs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
03e091f0b5f43beee12170efc00bbab86ffeb0dc 27-Apr-2012 Dan Gohman <gohman@apple.com> Reapply r155682, making constant folding more consistent, with a fix to work
properly with how the code handles all-undef PHI nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d213ee764341b5bf6664469a5404fe19c9732828 27-Apr-2012 NAKAMURA Takumi <geek4civic@gmail.com> Revert r155682, "Use ConstantExpr::getExtractElement when constant-folding vectors"

It broke stage2 build. stage1/clang sometimes crashed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
97b44f9b8026fce47c1c882347f88af91c6e74c1 27-Apr-2012 Dan Gohman <gohman@apple.com> Use ConstantExpr::getExtractElement when constant-folding vectors
instead of getAggregateElement. This has the advantage of being
more consistent and allowing higher-level constant folding to
procede even if an inner extract element cannot be folded.

Make ConstantFoldInstruction call ConstantFoldConstantExpression
on the instruction's operands, making it more consistent with
ConstantFoldConstantExpression itself. This makes sure that
ConstantExprs get TargetData-aware folding before being handed
off as operands for further folding.

This causes more expressions to be folded, but due to a known
shortcoming in constant folding, this currently has the side effect
of stripping a few more nuw and inbounds flags in the non-targetdata
side of constant-fold-gep.ll. This is mostly harmless.

This fixes rdar://11324230.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
80c1ea6f9baedf7e957e1c26f960792f016b5329 24-Apr-2012 Nadav Rotem <nadav.rotem@intel.com> ConstantFoldSelectInstruction swapped the operands of the select.

Fix 12592. Patch by Matt Pharr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7302d80490feabfc8a01bee0fa698aab55169544 06-Feb-2012 Chris Lattner <sabre@nondot.org> Remove some dead code and tidy things up now that vectors use ConstantDataVector
instead of always using ConstantVector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0cd0d8149278782aaa93c190f81e04f10a4efb5e 30-Jan-2012 Chris Lattner <sabre@nondot.org> Fix ConstantFoldShuffleVectorInstruction to properly handle the case
when the result type has a different # elements than the input vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a78fa8cc2dd6d2ffe5e4fe605f38aae7b3d2fb7a 27-Jan-2012 Chris Lattner <sabre@nondot.org> continue making the world safe for ConstantDataVector. At this point,
we should (theoretically optimize and codegen ConstantDataVector as well
as ConstantVector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
29bb00b3c5dda58dabb57d016bd0c4099d37cd3b 26-Jan-2012 Chris Lattner <sabre@nondot.org> unbreak test/Bitcode/shuffle.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
71a494d6974f5105f008601a3e7c7474bf508139 26-Jan-2012 Chris Lattner <sabre@nondot.org> simplify by using ShuffleVectorInst::getMaskValue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
56243b89e7d5072d2d5498f806679d19ea483dac 26-Jan-2012 Chris Lattner <sabre@nondot.org> eliminate the Constant::getVectorElements method. There are better (and
more robust) ways to do what it was doing now. Also, add static methods
for decoding a ShuffleVector mask.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d59ae907eea28285ece6696d6f3271b4ca578c0d 26-Jan-2012 Chris Lattner <sabre@nondot.org> Continue improving support for ConstantDataAggregate, and use the
new methods recently added to (sometimes greatly!) simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4d6ccb5f68cd7c6418a209f1fa4dbade569e4493 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1876abe63edf0380aee3d0f3ad9cace3f7e6a042 11-Jan-2012 Duncan Sands <baldrick@free.fr> Don't try to create a GEP when the pointee type is unsized (such GEPs
are invalid). Fixes a crash on array1.C from the GCC testsuite when
compiled with dragonegg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ce16339930a2b03e53b4e6399ef59c092a7f2cfa 17-Dec-2011 Dan Gohman <gohman@apple.com> The powers that be have decided that LLVM IR should now support 16-bit
"half precision" floating-point with a first-class type.

This patch adds basic IR support (but not codegen support).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
adeb0a6e64c5a63e891e016226645f9595d00959 15-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Make constant folding for GEPs a bit more aggressive.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8370d91f1e70837a60653027aabcd27cea0a2e73 02-Sep-2011 Jakub Staszak <jstaszak@apple.com> Return undef value (instead of arbitrary) for wrong or undef index in
ConstantVector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4c6b8bee2ab087f3b21efa6b638c6848f23b74d7 02-Sep-2011 Jakub Staszak <jstaszak@apple.com> ConstantVector returns arbitrary value for the wrong index.
This fixes PR10813.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a9203109f4ac95aa7e9624f2838e3d89623ec902 25-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert GetElementPtrInst to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4b5e207bf24ea9799547a0634acaf7398b32897c 21-Jul-2011 Jay Foad <jay.foad@gmail.com> Make better use of ConstantExpr::getGetElementPtr's InBounds parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
dab3d29605a5c83db41b28176273ef55961120c1 21-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7fc52e2d95ffa543288a2fef7ef1346ce14b1a61 19-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert ConstantFoldGetElementPtr to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3ba292dbc2acee2d1052fb7ffe332e2164147b47 18-Jul-2011 Jeffrey Yasskin <jyasskin@google.com> Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity
errors like the one corrected by r135261. Migrate all LLVM callers of the old
constructor to the new one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
db125cfaf57cc83e7dd7453de2d509bc8efd0e5e 18-Jul-2011 Chris Lattner <sabre@nondot.org> land David Blaikie's patch to de-constify Type, with a few tweaks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
fc6d3a49867cd38954dc40936a88f1907252c6d2 13-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
bda20650d2ec113bd78b8c809dbfafa7f7077152 09-Jul-2011 Chris Lattner <sabre@nondot.org> don't load element before checking to see if it is valid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1afcace3a3a138b1b18e5c6270caa8dae2261ae2 09-Jul-2011 Chris Lattner <sabre@nondot.org> Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM. One way to look at it
is through diffstat:
109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing. Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
uniques them. This means that the compiler doesn't merge them structurally
which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead
"const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
68c0dbc14fb7599987fb3e27be4e12c1ac36535e 01-Jul-2011 Dan Gohman <gohman@apple.com> Improve constant folding of undef for cmp and select operators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
30cb6dda5ae441f27edef302cbb33936fbafba6d 01-Jul-2011 Dan Gohman <gohman@apple.com> Improve constant folding of undef for binary operators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a0c138429e101f573d43740322245c1d5b8b04a0 22-Jun-2011 Jay Foad <jay.foad@gmail.com> Make ConstantVector::get() always take an ArrayRef, never a std::vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b065b06c12dba6001b8140df2744d0c856ef6ea1 20-Jun-2011 Chris Lattner <sabre@nondot.org> Revamp the "ConstantStruct::get" methods. Previously, these were scattered
all over the place in different styles and variants. Standardize on two
preferred entrypoints: one that takes a StructType and ArrayRef, and one that
takes StructType and varargs.

In cases where there isn't a struct type convenient, we now add a
ConstantStruct::getAnon method (whose name will make more sense after a few
more patches land).

It would be "really really nice" if the ConstantStruct::get and
ConstantVector::get methods didn't make temporary std::vectors.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7a2bdde0a0eebcd2125055e0eacaca040f0b766c 15-Apr-2011 Chris Lattner <sabre@nondot.org> Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
562b84b3aea359d1f918184e355da82bf05eb290 11-Apr-2011 Jay Foad <jay.foad@gmail.com> Don't include Operator.h from InstrTypes.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
093399cbf3bcdb31d04b3bf5c5691fc88c25da48 17-Feb-2011 Nadav Rotem <nadav.rotem@intel.com> Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2ca5c8644e6c35b3a7910a576ed89cddb7b82c3b 15-Feb-2011 Chris Lattner <sabre@nondot.org> convert ConstantVector::get to use ArrayRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
75831904220042260c4faece8507a2807acba47f 14-Feb-2011 Chris Lattner <sabre@nondot.org> revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
283c8caccd093f8e1d4f0bdd01ac240b4edbd20a 14-Feb-2011 Chris Lattner <sabre@nondot.org> Switch ConstantVector::get to use ArrayRef instead of a pointer+size
idiom. Change various clients to simplify their code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
bc53ca1b530aa57280c7a373ea518278abb6ae37 13-Feb-2011 Nadav Rotem <nadav.rotem@intel.com> Fix a regression from r125393;

It caused a crash in MultiSource/Benchmarks/Bullet.
Opt hit an assertion with "opt -std-compile-opts" because
Constant::getAllOnesValue doesn't know how to handle floats.

This patch added a test to reproduce the problem and a check that the
destination vector is of integer type.

Thank you Benjamin!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d2f27ead2d71afeee869cad8ae8a1c1dce7229cb 11-Feb-2011 Nadav Rotem <nadav.rotem@intel.com> Fix 9173.

Add more folding patterns to constant expressions of vector selects and vector
bitcasts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
bb25e2c91b79fc31103510860e1817863a674bc5 30-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Fix 'fcmp one' constant folding. Noticed by inspection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b8787f340326100288aeda455ee8dbee7ab2f209 30-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Fix some formatting and upgrade comments from llvm 1.x to 2.x syntax.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
175e7aec1347be3469b0838e5380d424228aa48f 29-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Add the select optimization recently added to instcombine to constant folding.
This is the one where one of the branches of the select is another select on
the same condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4c93a0f09225b428fb0f28f1c540f5ff5dd5bb3c 21-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Add a constant folding of casts from zero to zero. Fixes PR9011!

While here, I'd like to complain about how vector is not an aggregate type
according to llvm::Type::isAggregateType(), but they're listed under aggregate
types in the LangRef and zero vectors are stored as ConstantAggregateZero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
25052d8d64f18a85d6a84e0e010f6ba3eba0760d 14-Jan-2011 Jay Foad <jay.foad@gmail.com> Remove casts between Value** and Constant**, which won't work if a
static_cast from Constant* to Value* has to adjust the "this" pointer.
This is groundwork for PR889.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c43cee3fbb3098f0647e50dd2c13bc55b027a228 14-Jan-2011 Duncan Sands <baldrick@free.fr> Move some shift transforms out of instcombine and into InstructionSimplify.
While there, I noticed that the transform "undef >>a X -> undef" was wrong.
For example if X is 2 then the top two bits must be equal, so the result can
not be anything. I fixed this in the constant folder as well. Also, I made
the transform for "X << undef" stronger: it now folds to undef always, even
though X might be zero. This is in accordance with the LangRef, but I must
admit that it is fairly aggressive. Also, I added "i32 X << 32 -> undef"
following the LangRef and the constant folder, likewise fairly aggressive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e562dba845265b5577699eb857fead1ea0f7905b 29-Dec-2010 Chris Lattner <sabre@nondot.org> fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0d7ce5ffa4aa853b75e1015c62e27bd9f23ef73b 20-Dec-2010 Duncan Sands <baldrick@free.fr> There is no need for isAssociative to take the type as an argument anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
40f8f6264d5af2c38e797e0dc59827cd231e8ff7 07-Dec-2010 Jay Foad <jay.foad@gmail.com> PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3069cbf7b3ef9a31bbb8e434686b7259052c364a 04-Dec-2010 Benjamin Kramer <benny.kra@googlemail.com> Remove unneeded zero arrays.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
61c70e98ac3c7504d31dd9bc81c4e9cb998e9984 28-Aug-2010 Chris Lattner <sabre@nondot.org> remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0dd3549edc91b50fba102a6b0473caf8d4cf6b70 28-Jun-2010 Dan Gohman <gohman@apple.com> Constant fold x == undef to undef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
403a8cdda5e76ea689693de16474650b4b0df818 21-Jun-2010 Dan Gohman <gohman@apple.com> Use A.append(...) instead of A.insert(A.end(), ...) when A is a
SmallVector, and other SmallVector simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
fdbef823ad58f4ddb96da61e59ca48d8390c928f 05-Jun-2010 Dan Gohman <gohman@apple.com> getFoldedOffsetOf no longer does anything special with vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
5bf7f88ea28dae0cad4f311cc5ef708b6ce50e8f 04-Mar-2010 Nick Lewycky <nicholas@mxc.ca> Make the 'icmp pred trunc(ext(X)), CST --> icmp pred X, ext(trunc(CST))'
transformation much more careful. Truncating binary '01' to '1' sounds like it's
safe until you realize that it switched from positive to negative under a signed
interpretation, and that depends on the icmp predicate.

Also a few miscellaneous cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c8e14b3d37b80abb6adb4b831af0452d9ecbf2b2 03-Mar-2010 Chris Lattner <sabre@nondot.org> fix incorrect folding of icmp with undef, PR6481.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
9ee0d8a917a90380afc65c5b8fcea9d9975e6749 25-Feb-2010 Dan Gohman <gohman@apple.com> Teach the constant folder about union types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2440cf1c6f8efe83772dabc4582e8c1e3637cc56 25-Feb-2010 Dan Gohman <gohman@apple.com> Remove code which assumes it knows how vectors are stored in memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0e488b3d1c9293bbf2d64d0ecc4d6339f9100351 22-Feb-2010 Dan Gohman <gohman@apple.com> Canonicalize ConstantInts to the right operand of commutative
operators.

The test difference is just due to the multiplication operands
being commuted (and thus requiring a more elaborate match). In
optimized code, that expression would be folded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d97439d1e5a04a580c48b98512885866dcc83e2a 22-Feb-2010 Dan Gohman <gohman@apple.com> Use Instruction::isCommutative instead of duplicating it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
47c5188789bc40671504ed1fa3a44765cefba44f 16-Feb-2010 Duncan Sands <baldrick@free.fr> Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
methods to try to have the type predicates be more logically positioned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1df9859c40492511b8aa4321eb76496005d3b75b 16-Feb-2010 Duncan Sands <baldrick@free.fr> There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b0bc6c361da9009e8414efde317d9bbff755f6c0 15-Feb-2010 Duncan Sands <baldrick@free.fr> Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
fdfeb6976f07ad10d809b922ed7376ba2a3539be 12-Feb-2010 Chris Lattner <sabre@nondot.org> Add support for a union type in LLVM IR. Patch by Talin!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a84ffedafc102013a935817f30485a47d3dc2383 10-Feb-2010 Dan Gohman <gohman@apple.com> Canonicalize sizeof and alignof on pointer types to a canonical
pointer type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6acb86dcfa1ff4e38d2f189ab09e3fbe22f248a7 02-Feb-2010 Dan Gohman <gohman@apple.com> Factor out alignof expression folding into a separate function and
generalize it to handle more cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b29d596072d2ba32a0bb59241baf7a1c0ff5ed94 01-Feb-2010 Chris Lattner <sabre@nondot.org> eliminate a bunch of pointless LLVMContext arguments.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a419b56d896d5180adb14e39d5c969306bd5b400 01-Feb-2010 Duncan Sands <baldrick@free.fr> Fix typo "of" -> "or" and change the way a line was formatted to fit
into 80 columns to match my artistic preferences.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6304b0dd631ba65f3e325d8ed85a0f770d74d633 01-Feb-2010 Chris Lattner <sabre@nondot.org> fix PR6195, a bug constant folding scalar -> vector compares.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b63127d4359d6a51c35f4ebfabfceac8bbd8364a 01-Feb-2010 Chris Lattner <sabre@nondot.org> fix PR6197 - infinite recursion in ipsccp due to block addresses

evaluateICmpRelation wasn't handling blockaddress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4f8eea82d8967cffa85b9df6c9255717b059009e 01-Feb-2010 Dan Gohman <gohman@apple.com> Generalize target-independent folding rules for sizeof to handle more
cases, and implement target-independent folding rules for alignof and
offsetof. Also, reassociate reassociative operators when it leads to
more folding.

Generalize ScalarEvolution's isOffsetOf to recognize offsetof on
arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr
to getOffsetOfExpr, for consistency with analagous ConstantExpr routines.

Make the target-dependent folder promote GEP array indices to
pointer-sized integers, to make implicit casting explicit and exposed
to subsequent folding.

And add a bunch of testcases for this new functionality, and a bunch
of related existing functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8ca83b4111972f626a3e3f9af41f55718bf68927 28-Jan-2010 Dan Gohman <gohman@apple.com> Remove the folding rule
getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
to
inttoptr (i64 0 to i8*)
from the VMCore constant folder. It didn't handle sign-extension properly
in the case where the source integer is smaller than a pointer size. And,
it relied on an assumption about sizeof(i8).

The Analysis constant folder still folds these kinds of things; it has
access to TargetData, so it can do them right.

Add a testcase which tests that the VMCore constant folder doesn't
miscompile this, and that the Analysis folder does fold it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0f5efe56258f8cd6ceff4d7955a5d80144cd9cb0 28-Jan-2010 Dan Gohman <gohman@apple.com> Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
use plain SCEVUnknowns with ConstantExpr::getSizeOf and
ConstantExpr::getOffsetOf constants. This eliminates a bunch of
special-case code.

Also add code for pattern-matching these expressions, for clients that
want to recognize them.

Move ScalarEvolution's logic for expanding array and vector sizeof
expressions into an element count times the element size, to expose
the multiplication to subsequent folding, into the regular constant
folder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
401f3258f6e72cbc3e1f5e17c3976b241feb1c66 21-Jan-2010 Nick Lewycky <nicholas@mxc.ca> Fix a crasher trying to fold each element in a comparison between two vectors
if one of the vectors didn't have elements (such as undef). Fixes PR 6096.

Fix an issue in the constant folder where fcmp (<2 x %ty>, <2 x %ty>) would
have <2 x i1> type if constant folding was successful and i1 type if it wasn't.
This exposed a related issue in the bitcode reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8c65f6e71c1d46d823b9a884819992a9255edd54 05-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Move remaining stuff to the isInteger predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
11acaa374cdcebb161bf0de5f244265d78a749c1 05-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Convert a ton of simple integer type equality tests to the new predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92760 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e8e17833bec5943dffe5f89546465f94d8277ad6 17-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Aggressively flip compare constant expressions where appropriate; constant
folding in particular expects null to be on the RHS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91587 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0eeb913aa17a68b1f2963b02ca1d68f09dba0b78 28-Oct-2009 Chris Lattner <sabre@nondot.org> Previously, all operands to Constant were themselves constant.
In the new world order, BlockAddress can have a BasicBlock operand.
This doesn't permute much, because if you have a ConstantExpr (or
anything more specific than Constant) we still know the operand has
to be a Constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
59c4eba4169e40b36719c521c25d29115ff6b206 17-Oct-2009 Chris Lattner <sabre@nondot.org> Teach vm core to more aggressively fold 'trunc' constantexprs,
allowing it to simplify the crazy constantexprs in the testcases
down to something sensible. This allows -std-compile-opts to
completely "devirtualize" the pointers to member functions in
the testcase from PR5176.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
cf0fe8d813727383d630055bb9d1cde21b00b7e7 05-Oct-2009 Chris Lattner <sabre@nondot.org> strength reduce a ton of type equality tests to check the typeid (Through
the new predicates I added) instead of going through a context and doing a
pointer comparison. Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
149cbc2a2418e506c71abe7759c9c81eea68976b 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Peer through zext and sext to eliminate them when it is safe to do so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
85958b059dcc4c1e91bb892d6cfe5987109a60ac 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Fold 'icmp eq (icmp), true' into an xor(icmp).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b13efdafec254746bc83583a10ec3604210d0d35 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Correct the comment; this applies to fcmp too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8577e27dd34f190e7014742822b6d2536ebcc796 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Remove tab, again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3105ebfaf7105ffe20530a70194fa8d85d07fb7c 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Teach the constant folder how to not a cmpinst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
55a722bf6a08c684e49f5b56301bfc66d6dc9fd4 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Try turning icmp(bitcast(x), bitcast(y)) into icmp(bitcast(bitcast(x)), y) in
the hopes that the two bitcasts will merge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82371 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8de003663db10137a6c3f3af284317295b9afac6 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Remove tabs I added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3892baac42daadf760d140168720be1d6e585aa8 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Clean up the usage of evaluateICmpRelation's return value.
Add another line to the ConstantExprFold test to demonstrate the GEPs may not
wrap around in either the signed or unsigned senses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d43737bd0935150de2e3f385ad8418f2f3a7d2a2 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Remove dead store by taking a guess at what Chris meant. I wasn't able to
design a testcase that would tickle this behaviour.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a80e9598caa568bfd56a6eb90cf4207c4752915d 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Delete dead code. sext and zext can not turn integers into pointers. Further,
the optimization described in the comment is only valid with target data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
33c06adcf10d3ef7bbfc70f09f4966eec2e6c85e 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Value* were never meant to be const. Removing constness from the constant
folder removes a lot of const_casting and requires no changes to clang or
llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f4d18827430be9ac3a7a5216be61224146d97f44 20-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Teach the constant folder how to handle a few simple i1 cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f672ab89ecc4ed900f054f682617f8bf1d8fae0d 15-Sep-2009 Dan Gohman <gohman@apple.com> Fix an accidental inversion of the inbounds flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
dd4238e04dc8a5144d9c19bd53cf9650d1472309 15-Sep-2009 Chris Lattner <sabre@nondot.org> fix PR4963: folding insertvalue would sometimes turn a packed struct into
an unpacked one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3bfbc4587a7e79f08f8c126a9e62c3475fb90f8b 11-Sep-2009 Dan Gohman <gohman@apple.com> Teach lib/VMCore/ConstantFold.cpp how to set the inbounds keyword and
how to fold notionally-out-of-bounds array getelementptr indices instead
of just doing these in lib/Analysis/ConstantFolding.cpp, because it can
be done in a fairly general way without TargetData, and because not all
constants are visited by lib/Analysis/ConstantFolding.cpp. This enables
more constant folding.

Also, set the "inbounds" flag when the getelementptr indices are
one-past-the-end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e6992f728a94654e43269580a10a667f18dadba9 11-Sep-2009 Dan Gohman <gohman@apple.com> Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6e7ad958683f34bf6c014c88fef723e5a2d741be 04-Sep-2009 Dan Gohman <gohman@apple.com> Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e56a94ef91009ddb8d8b68783ff1650bcad3b326 04-Sep-2009 Dan Gohman <gohman@apple.com> Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,
and exact flags. Because ConstantExprs are uniqued, creating an
expression with this flag causes all expressions with the same operands
to have the same flag, which may not be safe. Add, sub, mul, and sdiv
ConstantExprs are usually folded anyway, so the main interesting flag
here is inbounds, and the constant folder already knows how to set the
inbounds flag automatically in most cases, so there isn't an urgent need
for the API support.

This can be reconsidered in the future, but for now just removing these
API bits eliminates a source of potential trouble with little downside.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f8a87e8343c5f829be9a75d8160e1bb969b84119 30-Aug-2009 Dan Gohman <gohman@apple.com> Cleanup whitespace and indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1d0be15f89cb5056e20e2d24faa8d6afb1573bca 13-Aug-2009 Owen Anderson <resistor@mac.com> Push LLVMContexts through the IntegerType APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c752064894630565bdef503f6001e849a1fcfc3f 12-Aug-2009 Dan Gohman <gohman@apple.com> Simplify this code, and use an in-bounds GEP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d7f2a6cb3fbc012763adb42fd967f6fefbb22a37 06-Aug-2009 Owen Anderson <resistor@mac.com> Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a7235ea7245028a0723e8ab7fd011386b3900777 31-Jul-2009 Owen Anderson <resistor@mac.com> Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
5defacc6e605f4651c6300237cef8e9bb2eb6d0e 31-Jul-2009 Owen Anderson <resistor@mac.com> Move getTrue() and getFalse() to 2.5-like APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
9e9a0d5fc26878e51a58a8b57900fcbf952c2691 31-Jul-2009 Owen Anderson <resistor@mac.com> Move more code back to 2.5 APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
debcb01b0f0a15f568ca69e8f288fade4bfc7297 30-Jul-2009 Owen Anderson <resistor@mac.com> Move types back to the 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
baf3c404409d5e47b13984a7f95bfbd6d1f2e79e 29-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantExpr to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
af7ec975870f92245f1f1484ac80a1e2db6a0afa 28-Jul-2009 Owen Anderson <resistor@mac.com> Return ConstantVector to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1fd7096407d5e598ed3366a1141548e71273f1c5 28-Jul-2009 Owen Anderson <resistor@mac.com> Change ConstantArray to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8fa3338ed2400c1352b137613d2c2c70d1ead695 28-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantStruct back to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6f83c9c6ef0e7f79825a0a8f22941815e4b684c7 27-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantFP construction back to the 2.5-ish API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
eed707b1e6097aac2bb6b3d47271f6300ace7f2e 25-Jul-2009 Owen Anderson <resistor@mac.com> Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b3056faa5554ded7ac1ac5865d10ef5839fb77d3 21-Jul-2009 Owen Anderson <resistor@mac.com> Rename getConstantInt{True|False} to get{True|False} at Chris' behest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c23197a26f34f559ea9797de51e187087c039c42 14-Jul-2009 Torok Edwin <edwintorok@gmail.com> 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").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a43c3aca851b10329f756b084d897e9dfb2d0729 14-Jul-2009 Owen Anderson <resistor@mac.com> Inline EvalVectorOp in order to get rid of passing-pointer-to-static-methods behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0a5372ed3e8cda10d724feda3c1a1c998db05ca0 13-Jul-2009 Owen Anderson <resistor@mac.com> Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c25e7581b9b8088910da31702d4ca21c4734c6d7 11-Jul-2009 Torok Edwin <edwintorok@gmail.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7f6aa2b162e5daaf7b9ccf05d749597d3d7cf460 08-Jul-2009 Nick Lewycky <nicholas@mxc.ca> Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e47f59db448fd468bb32ade37a1fa7ee8a9bff20 21-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Expand this test to handle more cases (remainder and shifts) of zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73839 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1db6866147b6b3028fdc77bc242de8f44edd71d9 21-Jun-2009 Chris Lattner <sabre@nondot.org> implement PR4424: 0/x is always 0 for integer division.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
04fb7c36a9977127f32558dc01c39a9c2388bc39 20-Jun-2009 Owen Anderson <resistor@mac.com> Revert r73790, and replace it with a significantly less ugly solution. Rather than trying to make the global reader-writer lock work,
create separate recursive mutexes for each value map. The recursive-ness fixes the double-acquiring issue, which having one per ValueMap
lets us continue to maintain some concurrency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
430444b10237abd37eb8157c3f84509a7d9636f8 20-Jun-2009 Owen Anderson <resistor@mac.com> Fix a serious bug that would cause deadlock during abstract type refinement. The constant creation
gets involved, and we end up trying to recursively acquire a writer lock. The fix for this is slightly horrible,
and involves passing a boolean "locked" parameter around in Constants.cpp, but it's better than having locked and
unlocked versions of most of the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73790 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6de29f8d960505421d61c80cdb738e16720b6c0e 16-Jun-2009 Dan Gohman <gohman@apple.com> Support vector casts in more places, fixing a variety of assertion
failures.

To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.

Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ae3a0be92e33bc716722aa600983fc1535acb122 05-Jun-2009 Dan Gohman <gohman@apple.com> Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c1317939045d1907f1e4a20315feceb0afa384a2 14-Mar-2009 Dan Gohman <gohman@apple.com> Apply a patch by Micah Villmow to fix AsmParser to accept vector
shift constant expressions, and add support for folding vector
shift constant expressions. This fixes PR3802.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a7b42034fcd0814572547637fc808587ae0822da 24-Feb-2009 Daniel Dunbar <daniel@zuster.org> Extension of GEP in constant folder was broken (apparently this code
has never been run!).
- Sorry, don't know how to make an LLVM test case for this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
09750273a4cd49630b64ec03b2e2f207a4fe8308 04-Feb-2009 Duncan Sands <baldrick@free.fr> Allow the inverse transform x86_fp80 -> i80 (also
fires during the Ada build).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a06aef6ec55552640e45ffada96e43cae96cfc01 04-Feb-2009 Duncan Sands <baldrick@free.fr> Fix PR3468: a crash when constant folding a bitcast of
i80 to x86 long double (this was presumably generated
by sroa).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63730 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ed6af24e146a5d358115123f0d2be694c1fa3a84 21-Jan-2009 Dale Johannesen <dalej@apple.com> Make special cases (0 inf nan) work for frem.
Besides APFloat, this involved removing code
from two places that thought they knew the
result of frem(0., x) but were wrong.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c9a005807ab46d03a3b24f84220542c6eb84e9d1 19-Jan-2009 Chris Lattner <sabre@nondot.org> div/rem by zero and div/rem overflow are both undefined according to
langref. Constant fold them to undef instead of trying to preserve
the trap. This fixes PR3354.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
aeb06d246254e4829a49164a11eacced9a43d9d4 10-Nov-2008 Mon P Wang <wangmp@apple.com> Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b6dc9352b0d8361609c310699ce58a517fdc2264 04-Nov-2008 Devang Patel <dpatel@apple.com> Fix unused variable warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
868510328fc0b25ca97f2fba466a77c2c4e29c45 16-Oct-2008 Chris Lattner <sabre@nondot.org> apply Eli's patch for PR2165 and provide a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
23a98551ab65eeb8fe5019df8b7db4891582a4bd 10-Oct-2008 Dale Johannesen <dalej@apple.com> Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger. Restore return value to
IEEE754. Adjust all users accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7111b02c734c992b8c97d9918118768026dad79e 09-Oct-2008 Dale Johannesen <dalej@apple.com> Rename APFloat::convertToAPInt to bitcastToAPInt to
make it clearer what the function does. No functional
change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8373d38afddec4ade17f72088cb5eeb229e87238 03-Sep-2008 Nick Lewycky <nicholas@mxc.ca> Try to fold each element of a vector. This is needed to maintain structural
equivalence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
83c05e5d30366d7c7e3d08e886dee89b1320ae7a 03-Sep-2008 Nick Lewycky <nicholas@mxc.ca> Don't crash when trying to constant fold a vector with some elements that can't
be folded. Instead, fail to fold the entire vector.

We could also return a vector with some elements folded and some not. If anyone
thinks that's a better approach, please speak up!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
fea85c46c0baae0d40584e3901607ed3db55d6ef 10-Jul-2008 Chris Lattner <sabre@nondot.org> Fix a case where vector comparison constant folding would cause an
infinite recursion. part of PR2529


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
330e7e4d250653243afaaeef4c01a7c12c314b39 10-Jul-2008 Chris Lattner <sabre@nondot.org> elementwise comparison of vector constants was completely wrong. Fix
it for PR2529


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8013954f15e8de25e1231de9665a702a864c2b8f 08-Jul-2008 Chris Lattner <sabre@nondot.org> improve comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
155a490258a3a58f77ead53daa2078c3898938b5 08-Jul-2008 Chris Lattner <sabre@nondot.org> Fix three bugs:

1) evaluate [v]fcmp true/false with undefs to true or false instead
of undef.
2) fix vector comparisons with undef to return a vector result instead
of i1
3) fix vector comparisons with evaluatable results to return vector
true/false instead of i1 true/false (PR2529)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6e68f59b78d8dcb3940469351a08d5884f190223 03-Jun-2008 Dan Gohman <gohman@apple.com> Constant folding for insertvalue and extractvalue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
08de1e476c8404cf49ea37e4268b5ca7b90e0795 17-May-2008 Nick Lewycky <nicholas@mxc.ca> Revert constant-folding change that will miscompile in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6cccce3e58009c92876651877a9a7a19e78b89e8 17-May-2008 Nick Lewycky <nicholas@mxc.ca> Unbreak the build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d24ae8703f2da048b351d6c9c83d1412439e737c 17-May-2008 Nick Lewycky <nicholas@mxc.ca> Constant fold inttoptr and ptrtoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
041e2eb51721bcfecee5d9c9fc409ff185526e47 15-May-2008 Dan Gohman <gohman@apple.com> IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
efe65369a74871c3140a540a6c95ce5d1f080954 10-May-2008 Gabor Greif <ggreif@gmail.com> merge of use-diet branch to trunk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3e5d1d8d0839e98ee203aa3e3c4fe84ef71eba2c 20-Apr-2008 Chris Lattner <sabre@nondot.org> hopefully resolve PR2240


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0e4b6c7551776a801fa3caf9e05f47b5c8e001dc 20-Apr-2008 Chris Lattner <sabre@nondot.org> rearrange some code, simplify handling of shifts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
eb9c8e1e3fd81607f8aa71f2b8b1592d6d333337 20-Apr-2008 Chris Lattner <sabre@nondot.org> Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d881ad2c570dcb5965eb00b66462e1075ec82440 20-Apr-2008 Chris Lattner <sabre@nondot.org> Implement PR2206.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1c14c297460e0a6480bab989c0ade346288bbfd2 19-Apr-2008 Chris Lattner <sabre@nondot.org> refactor handling of symbolic constant folding, picking up
a few new cases( see Integer/a1.ll), but not anything that
would happen in practice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
61783d73223eed373fdcf1e4bda29978323f9e54 19-Apr-2008 Chris Lattner <sabre@nondot.org> indentation fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
83ad90a779f8ce46d6923bc6f63aa15b83968efb 31-Mar-2008 Nate Begeman <natebegeman@mac.com> Don't eliminate bitcast instructions that change the type of a pointer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
26471c48b3d49bdbcfcc05cb9a575b5fa123fbbf 25-Mar-2008 Evan Cheng <evan.cheng@apple.com> Handle a special case xor undef, undef -> 0. Technically this should be transformed to undef. But this is such a common idiom (misuse) we are going to handle it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
37a9ca5bc580e2a8c602a819a0ebdee1d205f1af 29-Feb-2008 Dan Gohman <gohman@apple.com> Use the new convertFromAPInt instead of convertFromZeroExtendedInteger.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ae9f3a3b7c915f725aef5a7250e88eaeddda03c6 20-Feb-2008 Anton Korobeynikov <asl@math.spbu.ru> Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
46acf85b97534fcf9997286da87c38210ce937ec 19-Feb-2008 Chris Lattner <sabre@nondot.org> Fix some minor issues folding undef, PR2052


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4ee451de366474b9c228b4e5fa573795a715216d 29-Dec-2007 Chris Lattner <sabre@nondot.org> Remove attribution from file headers, per discussion on llvmdev.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
43ad6b3e0d6ada51e9b23aab3e061187f1f5710c 17-Dec-2007 Christopher Lamb <christopher.lamb@gmail.com> Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7431c2ba79cbf7019aafac2ebafa259621726be2 11-Dec-2007 Chris Lattner <sabre@nondot.org> Teach VMCore to constant fold shufflevectors with constant operands.
This allows us to compile:

#include <emmintrin.h>
typedef __m128i VSInt16;
typedef short vSInt16 __attribute__ ((__vector_size__ (16)));
VSInt16 t3() {
return (VSInt16)((vSInt16)_mm_set1_epi16(6518));
}

into:

_t3:
movaps LCPI1_0, %xmm0
ret

instead of:
_t3:
movl $6518, %eax
movd %eax, %xmm0
pextrw $0, %xmm0, %eax
xorps %xmm0, %xmm0
pinsrw $0, %eax, %xmm0
punpcklwd %xmm0, %xmm0
pshufd $0, %xmm0, %xmm0
ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
9eaa835e887a0a35161adf357af0e3d221e095d7 11-Dec-2007 Chris Lattner <sabre@nondot.org> significantly simplify some code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2b0f806c88f022094112ccc3aeb31c7d55f50874 11-Dec-2007 Chris Lattner <sabre@nondot.org> refactor some code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f286f6fd93d569befe6e77c94a947e6e04e95685 10-Dec-2007 Chris Lattner <sabre@nondot.org> Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use
targetdata to validate that it is safe. While I'm in there, fix some const
correctness issues and generalize the interface to the "operand folder".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b348d18caf834bc26a80e60aa7a2c9b1748734e8 17-Nov-2007 Nate Begeman <natebegeman@mac.com> Add support for vectors to int <-> float casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2cda9399deed8a50e95848716212b500c5b2d396 31-Oct-2007 Dan Gohman <gohman@apple.com> Fix a regression in test/CodeGen/X86/2007-04-24-VectorCrash.ll introduced
by r43510. Gracefully handle constants with vector type that aren't
ConstantVector or ConstantAggregateZero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d61de35564361355e63d4be9a5cf1136db3da60c 30-Oct-2007 Dan Gohman <gohman@apple.com> Add support for folding binary operators with vector zero operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
db44bf85d832b26c398cda9acfd3473832f6e585 17-Oct-2007 Dale Johannesen <dalej@apple.com> Disable attempts to constant fold PPC f128.
Remove the assumption that this will happen from
various places.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3cab1c72b54cceaf2a4275dabf1b4160765820fc 15-Oct-2007 Chris Lattner <sabre@nondot.org> avoid an APFloat copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
5927d8e94d0b50296c2af4acdfe4d799e369fc08 14-Oct-2007 Dale Johannesen <dalej@apple.com> Disable some compile-time optimizations on PPC
long double.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ccf596a53e16ea221a9bf8b3874a7d6afa71f1f4 07-Oct-2007 Neil Booth <neil@daikokuya.co.uk> convertFromInteger, as originally written, expected sign-extended
input. APInt unfortunately zero-extends signed integers, so Dale
modified the function to expect zero-extended input. Make this
assumption explicit in the function name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
88216af3ea4bb1c68a8793ed1d3b30308b64ab0e 30-Sep-2007 Dale Johannesen <dalej@apple.com> Constant fold int-to-long-double conversions;
use APFloat for int-to-float/double; use
round-to-nearest for these (implementation-defined,
seems to match gcc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
350add8f510f54f7728721d15e9c319c47dbe55b 26-Sep-2007 Dale Johannesen <dalej@apple.com> Remove no-longer-used variable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0edc47ad7b3fb5ad5f9dcd4139f3074dd11ff457 26-Sep-2007 Dale Johannesen <dalej@apple.com> Make APFloat->int conversions deterministic even in
cases with undefined behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6b92942c9c5c2cc94bffe0850b41afce3b3e991f 24-Sep-2007 Dale Johannesen <dalej@apple.com> float->int conversion rounds toward 0. Duh.
Fixes PR1698.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
79653fcdc233476ad78bc232fb2c3764c89427f4 24-Sep-2007 Dale Johannesen <dalej@apple.com> Just use APFloat for const / const. Fixes
-1. / -0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4bf6ac5f40ba501713755cd9c984e8abce1f3f5d 20-Sep-2007 Dale Johannesen <dalej@apple.com> Fix dumb regression in constant folding (Regression/C/casts)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ac1220551fa3a4dc8b1eea2584920b8f18d7b571 19-Sep-2007 Dale Johannesen <dalej@apple.com> Fix some long double issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
780164433250ebc6f42671f5fdd259db14d71c0e 19-Sep-2007 Duncan Sands <baldrick@free.fr> Partial fix for PR1678: correct some parts of constant
fold that were missed in the fix for PR1646. Probably
this null/not-null logic should be factorized somewhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
9d5f45607793052bf5b4436d1b43013fab9999ac 12-Sep-2007 Dale Johannesen <dalej@apple.com> Revise previous patch per review comments.
Next round of x87 long double stuff.
Getting close now, basically works.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3f6eb7419de437436265831fce92f62498556e08 11-Sep-2007 Dale Johannesen <dalej@apple.com> Add APInt interfaces to APFloat (allows directly
access to bits). Use them in place of float and
double interfaces where appropriate.
First bits of x86 long double constants handling
(untested, probably does not work).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a0ef5ed742a81b134ac4438c3a4adc0c9a151b64 11-Sep-2007 Chris Lattner <sabre@nondot.org> Fix a buggy constant folding transformation when handling aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
43421b3dd70af5b70e71816521f37502c397cc65 06-Sep-2007 Dale Johannesen <dalej@apple.com> Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double. Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b8f74793b9d161bc666fe27fc92fe112b6ec169b 04-Sep-2007 David Greene <greened@obbligato.org> Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41697 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
fe9d82a71bac418d82f14d28d654dedea66083d5 13-Aug-2007 Chris Lattner <sabre@nondot.org> Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
Into: inttoptr (i64 0 to i8*) -> null

This occurs in the example in PR1602. With this fixed, we now compile
the example in PR1602 into fully "devirtualized" code:

define void @_Z1g1S(%struct.S* noalias %s) {
entry: %tmp131415 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i32 (...)***> [#uses=1] %tmp16 = load i32 (...)*** %tmp131415, align 4 ; <i32 (...)**> [#uses=1]
%tmp26277 = load i32 (...)** %tmp16 ; <i32 (...)*> [#uses=1]
%tmp2829 = bitcast i32 (...)* %tmp26277 to void (%struct.S*)* ; <void (%struct.S*)*> [#uses=1]
tail call void %tmp2829( %struct.S* %s )
ret void
}

This still has the vtable dispatch (as required) but does not have any pointer
to method cruft left.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
daa10a46b2e94e95b3f479cc24ecbbd33fe94c87 05-Aug-2007 Reid Spencer <rspencer@reidspencer.com> Fix a doxygen directive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d2f09965e6ba462c4728ff4d5c79b0d0d20ec47f 21-Jul-2007 Chris Lattner <sabre@nondot.org> zext(undef) = 0 and sext(undef) = 0, not undef.
This hopefully fixes a miscompilation of TargetData.cpp when self hosting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
07a96765daedf180a7102d39fe56c499878312b7 16-Jul-2007 Dan Gohman <gohman@apple.com> Fix comments about vectors to use the current wording.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4ada00d166b1d265fa4e751b63d7f869c7541f1b 26-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Add a comment to explain a folding transform.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2ef14d9f7c416105be650021c8010bcf47583065 25-Mar-2007 Chris Lattner <sabre@nondot.org> fold constantexprs more aggressively, fixing PR1265


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b8f1c1657f1b63f92957c5b1c5a4e26e4945c34d 23-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Fix constant fold of div by zero and rem by zero to match IEEE 754
requirements. We must return NaN in some cases and correctly signed
infinity in other cases. Passes CFP2006 (not that that says much).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a188bbe7ac5fd8299530c585966f3305bcc3d95b 03-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Fix constant folding of fp->int bitcast for vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
cae5754619433aed7be74abbf1c0551a82d369cb 02-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0d54b7df4f99fb18c3893455ad3864326f74feb6 01-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Use the APInt versions of the bit-wise conversions of float/double to int
and back. While this is not strictly necessary, it does pave the way for
future changes in casting. It should now be possible to improve vector
casting to deal with un-equal fp/int sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ef2185b4d2784d25c0fc6849b298a61e90541096 01-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Use a simpler constructor when constructing ConstantInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
012d50b8516c4a9013f478b54d80c3506103f926 28-Feb-2007 Reid Spencer <rspencer@reidspencer.com> Pull out the stops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34703 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
914c3bca870e448731b210b528a6a2f450ece772 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com> Adjust to changes in the APInt interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a5c7472726578c0884a6e69a4f808e4aa9a5d8ed 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR1205:
Implement review feedback:
1. Use new APInt::RoundDoubleToAPInt interface to specify the bit width so
that we don't have to truncate or extend in constant folding.
2. Fix a pasteo in SDiv that prevented a check for overflow.
3. Fix the shift operators: undef happens when the shift amount is equal
to the bitwidth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
9472c373a3378982ab4ef1a2caafabd4acf58ba2 27-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR1205:
Implement constant folding via APInt instead of uint64_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
92f6feaf792469130eec7196854ff01215955964 27-Feb-2007 Chris Lattner <sabre@nondot.org> ConstantFolding.cpp/h -> ConstantFold.cpp/h to avoid confusion with
lib/Analysis/ConstantFolding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6b178a3801955490886e5729cbc85fe8e68fdc77 24-Feb-2007 Chris Lattner <sabre@nondot.org> Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ac9dcb94dde5f166ee29372385c0e3b695227ab4 15-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
9d6565a5b1fbc4286d6ee638d8f47a3171a9ed7e 15-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
775bd830505c01d9cd8c53e4670bc3c0b78ab47b 06-Feb-2007 Chris Lattner <sabre@nondot.org> Fix Transforms/ConstProp/2007-02-05-BitCast.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2b9a5daf7c4dc39b46662a69e95e610e7b2cd4ba 31-Jan-2007 Chris Lattner <sabre@nondot.org> Revise APIs for creating constantexpr GEPs to not require the use of vectors.
This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c10305743c313558405079452138f03124e87581 19-Jan-2007 Reid Spencer <rspencer@reidspencer.com> For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
42a75517250017a52afb03a0ade03cbd49559fe5 15-Jan-2007 Chris Lattner <sabre@nondot.org> rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent. For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d333d906734088b074806721ee16aa68359e41c3 12-Jan-2007 Chris Lattner <sabre@nondot.org> Remove a bunch of duplicated code. Among other things, this fixes
constant folding of signed comparisons of bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a54b7cbd452b3adb2f51346140d996b29c2cdb30 12-Jan-2007 Reid Spencer <rspencer@reidspencer.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
579dca12c2cfd60bc18aaadbd5331897d48fec29 12-Jan-2007 Reid Spencer <rspencer@reidspencer.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4fe16d607d11e29d742208894909733f5ad01f8f 11-Jan-2007 Reid Spencer <rspencer@reidspencer.com> Rename BoolTy as Int1Ty. Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6b6b6ef1677fa71b1072c2911b4c1f9524a558c9 11-Jan-2007 Zhou Sheng <zhousheng00@gmail.com> For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
53054785115a4e7b521251fd698b6b82ee2c5c8f 11-Jan-2007 Reid Spencer <rspencer@reidspencer.com> Implement better constant folding of unordered FCMP predicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
898b2d52f9802fb8d9c426fa1c7e28c91cf2b1d8 04-Jan-2007 Chris Lattner <sabre@nondot.org> fix typo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e94d8b2f536cb9ec9a3a825a8b2bfbb000952b5e 04-Jan-2007 Chris Lattner <sabre@nondot.org> fix some bugs handling vectors, avoid host-specific handling of undefined shift results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
cc615c38b189f36b4a4a2b515232f69e63717d26 31-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Fix a bug in comparison of GEP indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
79e21d338c60b4b5a5746fc45e37ea0310606aee 31-Dec-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
Change signed integer type names to unsigned equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b913bbaa415299b732d72239566e203fe57761d6 24-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Cleanup ConstantFoldCompareInstruction:
1. Make the arguments const like the other ConstantFold* functions.
2. Clean up evaluateFCmpRelation so it makes sense for floating point.
3. Implement the use of evaluateFCmpRelation to fold floating point CEs
4. Shorten a variable name so more things fit on one line.
5. Fix various comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
283e20708bbc7682cbcf1356abe1b59cda28b932 23-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Don't overload var names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e4d87aa2de6e52952dca73716386db09aad5a8fd 23-Dec-2006 Reid Spencer <rspencer@reidspencer.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
85e36e474d795c95fd784e6312d3ef2fbfc0c99e 19-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Clean up ConstantFoldCastInstruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
390437fc6d6e7a244e7c81683576e7d27a425cea 19-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Rewrite ConstantFoldCastInstruction so that it doesn't use any of the
ConstRules. Remove the casting rules from ConstRules and subclasses. This
cleans up ConstantFolding significantly. Passes all tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
fdf15e1dc8f1c4cb48a16eb20c536072ca7188fd 18-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Revert last patch. ConstantInt isn't quite ready for signlessness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d54d8fa45a1f189580934259fcac3fc3c663810e 18-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Remove the last use of getUnsignedVersion and getSignedVersion from VMCore.
ConstantInt doesn't care about the sign of the type it represents. It only
cares about the bitwidth so there is no need to make the sign of the type
match the SExt or ZExt constant expression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d977d8651a5cd26a3e1088267f31cade405f2adf 13-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match
the the casting mnemonics in the rest of LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8c4fed50e3f4318baadf88bbbaa9313a6616493b 11-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Fix constant folding of FP->int due to cut & paste error in last commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
14f440aae76e5bae91e6775ddfbb9473bf0b8144 11-Dec-2006 Chris Lattner <sabre@nondot.org> Implement correct constant folding of bitcast. This implements
Transforms/ConstProp/bitcast.ll and fixes
SingleSource/Regression/C/2003-10-12-GlobalVarInitializers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
36c2451ddbe80dc9644b91fe1d31e7fb82b11e13 11-Dec-2006 Chris Lattner <sabre@nondot.org> fix typo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
87d5f6c29f098d464f6881e6652aab13a3bb70db 06-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Fix constant folding to deal with external weak global values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6f40b831e0e653f88cbb17bf00d739bae28b5816 05-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Can't make these fail now with just BitCast. Previous failures must have
been in conjunction with something else. By right, they should just be
BitCasts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
57c699381bfde5f8d47079cd87e4f3e7fb9fca84 05-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Remove the last inferred casts from VMCore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2f8bbf5d65cf7514cdc0821f14a81f4cf2b0a3ac 04-Dec-2006 Reid Spencer <rspencer@reidspencer.com> For PR950: Implement a stub for folding ICmp and FCmp instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32169 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
575d95ce373f1e405e6c27ce8d9f244bba3bdd0d 04-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Change inferred casts to explicit casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
9dec3a2c0ca8d59e50ffbf1c97b171c7d5f2d6ec 01-Dec-2006 Chris Lattner <sabre@nondot.org> These should be rewritten to fold without using the 'Rules' mechanism, but
until this happens at least make sext from bool and sitofp from bool do the
right thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
5be662505e16c485596b53a8eabc3edb8bc88d17 01-Dec-2006 Chris Lattner <sabre@nondot.org> this logic is broken for trunc to bool, replace the folding logic for trunc
completely, as it is trivial. We should probably do this for the rest of the
cast operations. This fixes ConstProp/2006-12-01-TruncBoolBug.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7da3bde866889f963e98049c09c5b43cfb336d3f 01-Dec-2006 Chris Lattner <sabre@nondot.org> Fix a typo introduced by the cast patch that horribly broke a lot of vector
code. Testcase here: Transforms/ConstProp/2006-11-30-vector-cast.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b8611ec8bcf4a24042824f5ddc9858e32c56dc2e 01-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Don't fold "ptrtoint GV to bool" since this should be doing a truncate not
a comparison against zero. Instead fold setne(GV,null) and seteq(GV,null)
to ConstantBool::True or ConstantBool::False, respectively.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
78ee7b78c3c47b71c4b7a1475438d6574216a64b 01-Dec-2006 Anton Korobeynikov <asl@math.spbu.ru> Introducing external weak linkage. Darwin codegen should be added later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3da59db637a887474c1b1346c1f3ccf53b6c4663 27-Nov-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d6c3422e3126927840683574a658a0deada903f0 08-Nov-2006 Jim Laskey <jlaskey@mac.com> Remove redundant <cmath>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3822ff5c71478c7c90a50ca57045fb676fcb5005 08-Nov-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4ab09d4bb769a3ffae27e557ed4d645870c79388 02-Nov-2006 Reid Spencer <rspencer@reidspencer.com> Remove unused variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0a783f783ca05c961234385f5b269d4cf03dbbdb 02-Nov-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
Replace the REM instruction with UREM, SREM and FREM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1628cec4d7fce310d9cde0bcc73997e5a71692c4 26-Oct-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b83eb6447ba155342598f0fabe1f08f5baa9164a 20-Oct-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0eff5ad3db4bc85e84c85a7fbdc6b26653ff223d 13-Oct-2006 Chris Lattner <sabre@nondot.org> Fix another dtor issue. The function local statics in this function were
being destroyed at inconvenient times. Switch to using non-local ManagedStatic
objects, which actually also speeds up ConstRules::get.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
850ba99cb6fe5b7c70eb81103441d1fe123d6291 29-Sep-2006 Chris Lattner <sabre@nondot.org> Eliminate ConstantBool::True and ConstantBool::False. Instead, provideConstantBool::getTrue() and ConstantBool::getFalse().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a5b07404f79036727ba47624050040defe59a5fa 17-Sep-2006 Chris Lattner <sabre@nondot.org> Add new SetCondInst::isRelational/isEquality methods. Rename
Instruction::isRelational to Instruction::isComparison.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a4f0b3a084d120cfc5b5bb06f64b222f5cb72740 27-Aug-2006 Chris Lattner <sabre@nondot.org> s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f190d3805519beb3ec9afe4adfda30e82dcd2995 28-Jun-2006 Chris Lattner <sabre@nondot.org> Use hidden visibility to reduce the sizes of some .o files. This chops 60K off a release llvm-dis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
51df6d5459bf24b47ea59c28603df280261d4774 21-Jun-2006 Chris Lattner <sabre@nondot.org> Add more anonymous namespaces to make it clear that these are private classes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
00f1023cf8b30c74dc219525f518a80c45b6e7ba 08-Apr-2006 Chris Lattner <sabre@nondot.org> Add shufflevector support, todo, implement better constant folding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f38d47144572275396e6e6611fa5e181e79b2944 07-Apr-2006 Chris Lattner <sabre@nondot.org> Constant fold extractelement(zero, x) -> zero


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4460f4058fb33e468358f85c7f0925fc0e69e16c 02-Apr-2006 Chris Lattner <sabre@nondot.org> Constant fold casts from things like <4 x int> -> <4 x uint>, likewise int<->fp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6fa4cdf92eb240f06c7705a8d72b408668b5869b 31-Mar-2006 Chris Lattner <sabre@nondot.org> constant fold extractelement with undef operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c152f9cd26e7cb32352c513389a18ffd892ecaec 17-Jan-2006 Robert Bocchino <bocchino@illinois.edu> VMCore support for the insertelement operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
bb90a7aa7bf71311046ccc9f277e5f76cc082722 10-Jan-2006 Robert Bocchino <bocchino@illinois.edu> Added constant folding support for the extractelement operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2f690c84fa1682a2009423539af16d5f530006f9 05-Jan-2006 Chris Lattner <sabre@nondot.org> Implement a few symbolic constant folding things. X ? Y : Y is Y.

Fold:
seteq ({ short }* cast (int 1 to { short }*), { short }* null)
setlt ({ short }* cast (int 1 to { short }*), { short }* cast (int 2 to { short }*))

to false/true. These last two commonly occur in the output of compilers that
tag integers, like cozmic's scheme compiler.

Tested by Regression/Assembler/ConstantExprFold.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2c822cce61d151e934ab5f95b9511be206b5ebce 05-Jan-2006 Chris Lattner <sabre@nondot.org> fix some formatting problems


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
84e1064f4584c20b839b9172c5c26c20b6ffb2fe 04-Jan-2006 Chris Lattner <sabre@nondot.org> implement constant folding of ==/!= on constant packed, simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d2a7ea45b0603aeeb4921ab3b7e39aa07ca3bd77 04-Jan-2006 Chris Lattner <sabre@nondot.org> implement constant folding for the element-wise binary operations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d15ed597349e611553f0eb72b7187844c7630acc 04-Jan-2006 Chris Lattner <sabre@nondot.org> don't crash when trying to constant fold packed expressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a97e8db835cd6655eb537ace67dd46be7e4585b5 03-May-2005 Jeff Cohen <jeffc@jolt-lang.org> Use ANSI-approved way of getting the value infinity (otherwise VC++ won't compile it)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8b9e3e651159653a98141ea89ba35305d7f8c7e2 02-May-2005 Andrew Lenharth <andrewl@lenharth.org> fold fp div by 0 to inf, the way gcc does. This is legal according to the FP spec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2b2a5283742662ddef1574b8278d5e8c8127badd 25-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Shut GCC 4.0 up about classes with virtual functions but no virtual
destructor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
fd93908ae8b9684fe71c239e3c6cfe13ff6a2663 22-Apr-2005 Misha Brukman <brukman+llvm@gmail.com> Remove trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f4aa3351de8c997cef7a33e6946c6083e425618b 29-Jan-2005 Chris Lattner <sabre@nondot.org> Fix a nasty thinko in my previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ce04a6d7f6ce25c7d765a57baa30a70993a46021 28-Jan-2005 Chris Lattner <sabre@nondot.org> Fix ConstProp/2005-01-28-SetCCGEP.ll: indexing over zero sized elements does
not change the address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
488742a28e6680e8fb394367967fbd9a1621fb1f 06-Jan-2005 Chris Lattner <sabre@nondot.org> No need to pessimize current code for future possibilities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
ddc4860c1d6e06db2db5c08a01dc1ff3293d9daf 22-Nov-2004 Chris Lattner <sabre@nondot.org> Fix test/Regression/CFrontend/2003-11-01-EmptyStructCrash.c


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
1b9fe1cbbe9bceba688255dc4ef3b3155550b687 17-Nov-2004 Chris Lattner <sabre@nondot.org> Generalize this code to turn any cast-to-first-element-of into a gep constexpr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
cfbf9faaa4f1c92a746c8681ecd3bc52ad5313e8 17-Oct-2004 Chris Lattner <sabre@nondot.org> fold gep undef, ... -> undef
This comes up many times in perlbmk and probably others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
35f92ae3af08e79f60c6d09b38f650a29b1c2cbf 17-Oct-2004 Chris Lattner <sabre@nondot.org> Fix constant folding relational operators with undef operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
71d3778c0b75a637c66704689bf624e9bd317521 17-Oct-2004 Chris Lattner <sabre@nondot.org> Implement constant folding of undef values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7fa6e666ece60455cf9d75eff6e6915bebf05cbc 12-Oct-2004 Chris Lattner <sabre@nondot.org> Allow creation of GEP constantexprs with a vector of value* operands as
well as a vector of constant*'s. It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f8d1097e9d69c65642d008926065317db583961a 11-Oct-2004 Chris Lattner <sabre@nondot.org> If we are trying to create a ConstantExpr cast that is really a GEP to the
first element of an array, return a GEP instead of a cast. This allows us
to transparently fold this:

int* getelementptr (int* cast ([100 x int]* %Gbody to int*), int 40)

into this:

int* getelementptr ([100 x int]* %Gbody, int 0, int 40)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7970396014eacbe719eb171448ddc546c1ad2289 18-Jul-2004 Reid Spencer <rspencer@reidspencer.com> bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
dd68469382cafff2051289707ea2d3e0d26919b1 15-Jul-2004 Chris Lattner <sabre@nondot.org> Implement folding of expressions like 'uint cast (int* getelementptr (int*
null, uint 1) to uint)' to a constant integer. We can only do this with
primitive LLVM types, because other types have target-specific sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d34086796485ffcba4789ddda4277afca3d4f6b9 07-Jul-2004 Chris Lattner <sabre@nondot.org> When folding constant expr gep's, don't force the use of long indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f70c22b019494723d0e706f93d6542dfaa6e73a5 17-Jun-2004 Chris Lattner <sabre@nondot.org> 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
/external/llvm/lib/VMCore/ConstantFold.cpp
3ee239bd40c1c54d79dd1aca0779b5e0da5e0c23 30-May-2004 Reid Spencer <rspencer@reidspencer.com> Fix a bug that Chris asserts emphatically is a bug. The changed clause
would always return false because the Type of a type value is always
Type::TypeTY and can never be a floating point type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13902 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a0ae8196a1d2d1291949e268afc1bf932c9f8028 11-Apr-2004 Chris Lattner <sabre@nondot.org> Add a missing break, which caused a crash in an obscure situation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
28977af72a11fcad5d1b54d7a96b3df02828f6fc 05-Apr-2004 Chris Lattner <sabre@nondot.org> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e97148628f8a52fff1752937f6f49945bbe9937b 12-Mar-2004 Chris Lattner <sabre@nondot.org> Teach the constant folder how to do select instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
802b5ab844070daf5a3e8947124c476b88a5d22c 08-Mar-2004 Chris Lattner <sabre@nondot.org> Implement test/Regression/Assembler/2004-03-07-FunctionAddressAlignment.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b228f9c86bcc983e434a3d1df03046d51552bf70 22-Feb-2004 Chris Lattner <sabre@nondot.org> Get all instruction definitions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
2e9bb1a88e806644e96b2a73bf8c2eb540d68ede 16-Feb-2004 Chris Lattner <sabre@nondot.org> Move the folding of gep null, 0, 0, 0 to a place where it can be shared and
enjoyed by all, fixing a fixme. Add an assert


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11505 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b97e2788ff303e83eab8d24960966bfde05e6a37 01-Feb-2004 Chris Lattner <sabre@nondot.org> Fix a crasher bug in my constant folding rewrite


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
504e8fb74e4eec97a2ee1c195026824468cb6f7f 13-Jan-2004 Chris Lattner <sabre@nondot.org> Implement a bunch of symbolic constant folding opportunities. This implements
testcase test/Regression/Assembler/ConstantExprFold.llx

Note that these kinds of things only rarely show up in source code, but are
exceedingly common in the intermediate stages of algorithms like SCCP. By
folding things (especially relational operators) that use symbolic constants,
we are able to speculatively fold more conditional branches, which can
lead to some big simplifications.

It would be easy to add a lot more special cases here, so if you notice
SCCP missing anything "obvious", you know what to make smarter. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
eab20b58b1ca882933b3934fd9f320aba0bc1f10 12-Jan-2004 Chris Lattner <sabre@nondot.org> Rearrange and comment code better. No functionality changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
cbfd40654177d6c2b7fcb94272c3a8064d5b8297 12-Jan-2004 Chris Lattner <sabre@nondot.org> Rename ConstantHandling.* -> ConstantFolding.*
Move a bunch of (now) private stuff from ConstantFolding.h into
ConstantFolding.cpp.

This _finally_ gets us to a place where we have a sane constant folder. The
rules are:

1. LLVM clients now use ConstantExpr::get* methods to fold constants. If they
cannot be folded, a constantexpr is created, so these methods always return
valid Constant*'s.
2. The implementation of ConstantExpr::get* uses the functions exposed by
ConstantFolding.h to try to fold constants. If they cannot be folded,
they should return a null pointer.
3. The implementation of ConstantFolding can do whatever it wants, and only
has one client (Constants.cpp)

This cuts down on the wierd dependencies, and eliminates the two interfaces.
The old constanthandling interface was especially bad for clients to use
because almost none of them took the failure condition into consideration,
thus leading to obscure problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
8b0f0cb9088a7746fea2ba23821e50d87cef4a56 12-Jan-2004 Chris Lattner <sabre@nondot.org> Remove a whole bunch more ugliness. This is actually getting to the point of
this whole refactoring: allow constant folding methods to return something
other than predefined classes, allow them to return generic Constant*'s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6b7b91ab038eb468431725993dfe246726bc9743 12-Jan-2004 Chris Lattner <sabre@nondot.org> Move ConstantHandling.h into lib/VMCore and out of include/llvm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4a0ecc8c0c574b53d69fd2cfbc0371ff42240890 12-Jan-2004 Chris Lattner <sabre@nondot.org> Eliminate usage of the wierd overloaded operator constant folders


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
28aabc34f72663bfbda6e02a09a006dd7c81d155 12-Jan-2004 Chris Lattner <sabre@nondot.org> Move llvm::ConstantFoldInstruction from here to Transforms/Utils


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
952454dbffed89dacc85b9d6253bc8203a415f14 12-Jan-2004 Chris Lattner <sabre@nondot.org> Implement: Assembler/2004-01-11-getelementptrfolding.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b9da9c137d3062dd2277937eaafa502fba2ffe3f 25-Nov-2003 Chris Lattner <sabre@nondot.org> Relax constrains on GEP type indexes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
5d5a714b24f1e31ca98f697dc02ff9b554e258cc 17-Nov-2003 Chris Lattner <sabre@nondot.org> Implement == and != correctly. Before they would incorrectly return !=
for some constant exprs when they could really be the same value


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
a83a6e4276fecc6123162ff96a3535f0b6e7e691 17-Nov-2003 Chris Lattner <sabre@nondot.org> No REALLY, get rid of ConstantPointer references


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
cf09f51bb98a1658c2357f39d12d3e0ed4fa6133 17-Nov-2003 Chris Lattner <sabre@nondot.org> Eliminate use of the ConstantPointer class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0dc396909e01c5fb27e2a5a192131a5d79c3f0e9 17-Nov-2003 Chris Lattner <sabre@nondot.org> Constant folding shalt not be built on annotations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
d0fde30ce850b78371fd1386338350591f9ff494 11-Nov-2003 Brian Gaeke <gaeke@uiuc.edu> Put all LLVM code into the llvm namespace, as per bug 109.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b576c94c15af9a440f69d9d03c2afead7971118c 20-Oct-2003 John Criswell <criswell@uiuc.edu> Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0425a87a625de7f107642242c21eafb58c2119da 21-Aug-2003 Chris Lattner <sabre@nondot.org> Implement Assembler/2003-08-21-ConstantExprCast-Fold.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
4b517a4654921ac8e2225237f82d5fe8b3ba49b1 20-Aug-2003 Chris Lattner <sabre@nondot.org> Implement testcase: Assembler/2003-08-20-ConstantExprGEP-Fold.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3ccd0fd7568ab3f671c00cc2b7defc616d9d213a 13-Aug-2003 Chris Lattner <sabre@nondot.org> Implement constant folding of casts from boolean constants to other values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6a2a60aaf36bd18577c5825afbbd9930600d515c 26-Jun-2003 Chris Lattner <sabre@nondot.org> Implement more aggressive folding of constant GEP instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
5c38e99c59b8f9846a3fddb6c18c94a47717de02 27-May-2003 Chris Lattner <sabre@nondot.org> Fix constant folding to ALWAYS work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
3b9922f99c96bafd2c3ecb7f7fa4a8a4fc9cc9dc 14-May-2003 Chris Lattner <sabre@nondot.org> Remove unnecessary casts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e0c60038ebf0d259b28954a380adcbed9b5a39ee 14-May-2003 Chris Lattner <sabre@nondot.org> Fix bug


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0ec3590664dda705ac9039de403460cca5b947c1 13-May-2003 Chris Lattner <sabre@nondot.org> Implement another getelementptr folding opportunity that arises when
linking stuff with appending linkage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
893af8c058aad683027c604d6cbe818c59e0eda8 12-May-2003 Chris Lattner <sabre@nondot.org> Fix Bug: ConstProp/2003-05-12-DivideError.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
6cf4cb90a0d6147c05bdf65d9e666108082c3d4b 25-Apr-2003 Chris Lattner <sabre@nondot.org> ** CORRECTLY, conservatively handle constant expressions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
27287de06b0a6d3c2713fc3a78281df8f5d1a0fa 17-Apr-2003 Chris Lattner <sabre@nondot.org> Allow constant folding of GEP instructions, even if we don't do a whole lot yet.
Fold ConstExpr casts better
castToPointer shouldn't be forced to return a constantpointer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
252030e86b4cd252eadf702356ff3a7951247276 03-Sep-2002 Chris Lattner <sabre@nondot.org> Implement setcc for booleans. Fixes bug:
test/Regression/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
589fda514c4977ac936354f5a1c0226bbf409c86 14-Aug-2002 Chris Lattner <sabre@nondot.org> Remove support forNOT instruction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
5fa829c54a38f017fc1077c57716269275524e59 30-Jul-2002 Chris Lattner <sabre@nondot.org> Implement constant propogation of logical (and, or, xor) expressions.
Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
54753e279032efd7d7f9aba12dbbb5b7ba8a20ce 07-May-2002 Chris Lattner <sabre@nondot.org> Implement constant propogation of PHI instructions like this:
X = phi(0, 0, 0)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
178414c3cff00f32c72076db7efb5e0c7b6d81ec 06-May-2002 Chris Lattner <sabre@nondot.org> Move code out of header file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
cf4929fa2751c35889bdc892037c1b49721b6741 06-May-2002 Chris Lattner <sabre@nondot.org> Implement constant propogation of shifts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
44540ddaa0eb8ea75c827a266dc98d70248e2afb 03-May-2002 Chris Lattner <sabre@nondot.org> Implement remainder
Fix implementation of Not


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
905f311d051496023e31fa8ba98db4f5b8f54c17 03-May-2002 Chris Lattner <sabre@nondot.org> Fix bug: test/Regression/Transforms/SCCP/2002-05-03-NotOperator.ll
by using the ~ operator instead of !


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
968ddc921e70d098923a6dc585f86b6ebc3fd13e 08-Apr-2002 Chris Lattner <sabre@nondot.org> ConstantHandling moved into VMCore library


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
05c05ea9cad7d8836e161db674b041a0485fe39f 07-Apr-2002 Chris Lattner <sabre@nondot.org> Implement constant propogation of multiply and divide instructions!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
59b6b8e0b3e51dd899da25bd25b0793cc8229eea 22-Jan-2002 Chris Lattner <sabre@nondot.org> Move stuff out of the Optimizations directories into the appropriate Transforms
directories. Eliminate the opt namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
c4edcb3a17165e4cbd994671221e84053c68e7db 21-Jan-2002 Chris Lattner <sabre@nondot.org> Pull stuff out of opt namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
e9bb2df410f7a22decad9a883f7139d5857c1520 03-Dec-2001 Chris Lattner <sabre@nondot.org> Rename ConstPoolVal -> Constant
Rename ConstPool* -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
76ac1a45b40a96d1e583e2576c04d19b7d23a99e 01-Nov-2001 Chris Lattner <sabre@nondot.org> Implement constant propogation of null pointer values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
01bad7fbda047a33e96aee0c5d95f1673d772228 13-Oct-2001 Chris Lattner <sabre@nondot.org> not is a keyword in ansi C++, avoid it


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
cfe26c930ae691ff3012736555846c45087e1a9e 01-Oct-2001 Chris Lattner <sabre@nondot.org> Add more support for new style casts
Convert more code to use them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
243f1f73154f1f52858700f4d46eb3d169a2c267 10-Sep-2001 Chris Lattner <sabre@nondot.org> Use correct style casts
Types are not all constant now


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
14712a6abf2587666e8171cbb6ebe6ffab3ea514 09-Sep-2001 Chris Lattner <sabre@nondot.org> Clean up ConstRules stuff to use annotations instead of a mutable member in Type


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
311611079b3db0d59cc4f532a4a06e4f88268e95 07-Sep-2001 Chris Lattner <sabre@nondot.org> * Support global constants
* Eliminate need for constant pool


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
f59bd5331e050395fd7c454493c8d9f8a0372b98 21-Jul-2001 Chris Lattner <sabre@nondot.org> Add support for casts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
b5bcbc3bef1f81fe600ef1b2be919d48e19dbd33 20-Jul-2001 Chris Lattner <sabre@nondot.org> Add support for constant propogation of multiplies


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
0908309e3c4b4f423e88d8d8fe8060cb10eaa1c9 08-Jul-2001 Chris Lattner <sabre@nondot.org> Neg instruction removed. Cast instruction implemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
7e02b7e600ce8b719b34e2df7a7e44310229564d 30-Jun-2001 Chris Lattner <sabre@nondot.org> Optimizations got their own header files
Optimizations now live in the 'opt' namespace
include/llvm/Opt was renamed include/llvm/Optimizations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp
009505452b713ed2e3a8e99c5545a6e721c65495 06-Jun-2001 Chris Lattner <sabre@nondot.org> Initial revision


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/VMCore/ConstantFold.cpp