Commit Graph

19 Commits

Author SHA1 Message Date
Oscar Fuentes
429c75b865 Avoid warnings about implicit conversions to `bool' in MSVC. This time
for real.

Patch by Nathan Jeffords!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 20:27:36 +00:00
Oscar Fuentes
32d2c5de64 Avoid warnings about conversions to `bool' in MS compilers.
Patch by Nathan Jeffords!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 16:59:44 +00:00
Eric Christopher
41b5adf202 Remove a bunch of unused arguments from functions, silencing a
warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 20:28:33 +00:00
Chris Lattner
0c1f688954 add a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 05:52:45 +00:00
Dan Gohman
f8dbee7cea Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 23:54:19 +00:00
Daniel Dunbar
92a97a9166 Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 00:11:24 +00:00
Dan Gohman
859fff476d Include optional subclass flags, such as inbounds, nsw, etc., in the
Constant uniquing tables. This allows distinct ConstantExpr objects
with the same operation and different flags.

Even though a ConstantExpr "a + b" is either always overflowing or
never overflowing (due to being a ConstantExpr), it's still necessary
to be able to represent it both with and without overflow flags at
the same time within the IR, because the safety of the flag may
depend on the context of the use. If the constant really does overflow,
it wouldn't ever be safe to use with the flag set, however the use
may be in code that is never actually executed.

This also makes it possible to merge all the flags tests into a single test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 12:08:11 +00:00
Dan Gohman
5078f84c82 Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
and hasNoSignedWrap, for consistency with the nuw and nsw properties.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 17:11:38 +00:00
Dan Gohman
2907542a3f Add unimplemented destructor declarations to hopefully address
compiler warnings on windows (PR4714).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 20:43:13 +00:00
Dan Gohman
d30658c3ff Avoid implicitly depending on Instructions.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:03:18 +00:00
Dan Gohman
dd8004dc73 Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:53:46 +00:00
Dan Gohman
5a4e2a47b3 Order unsigned before signed, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:49:34 +00:00
Dan Gohman
6b118a2122 Add specific classes for Add, Sub, and Mul, for convenience.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 18:12:25 +00:00
Dan Gohman
344df5ecdf Clarify that OverflowingBinaryOperator is not used for SDiv, even though
SDiv is a binary operation that can overflow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 20:32:43 +00:00
Dan Gohman
7a965b03a8 Drop UDivOperator and introduce SDivOperator. Thanks to Chris
for noticing this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 17:51:10 +00:00
Dan Gohman
f241174421 Revert the addition of hasNoPointerOverflow to GEPOperator.
Getelementptrs that are defined to wrap are virtually useless to
optimization, and getelementptrs that are undefined on any kind
of overflow are too restrictive -- it's difficult to ensure that
all intermediate addresses are within bounds. I'm going to take
a different approach.

Remove a few optimizations that depended on this flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 17:43:30 +00:00
Dan Gohman
016de81177 Convert more code to use Operator instead of explicitly handling both
ConstantExpr and Instruction. This involves duplicating some code
between GetElementPtrInst and GEPOperator, but it's not a lot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76265 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 23:55:56 +00:00
Dan Gohman
5c2cb324d8 Add a GEPOperator class, and move the hasNoPointerOverflow
accessors into it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 21:33:58 +00:00
Dan Gohman
ca178908c8 Add a new Operator class, for handling Instructions and ConstantExprs
in a convenient manner, factoring out some common code from
InstructionCombining and ValueTracking. Move the contents of
BinaryOperators.h into Operator.h and use Operator to generalize them
to support ConstantExprs as well as Instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 20:47:02 +00:00