diff options
| author | Jim Laskey <jlaskey@mac.com> | 2007-01-03 00:11:03 +0000 |
|---|---|---|
| committer | Jim Laskey <jlaskey@mac.com> | 2007-01-03 00:11:03 +0000 |
| commit | c4ba9c161b830047cd42e3c9f7156171c126cdce (patch) | |
| tree | c2d2975c709af2a116e18643dbc86e47b00118bc /llvm/lib/Transforms | |
| parent | ab2fccd9eb821b2e6c62b9d51fd9c1b89f6501ad (diff) | |
| download | bcm5719-llvm-c4ba9c161b830047cd42e3c9f7156171c126cdce.tar.gz bcm5719-llvm-c4ba9c161b830047cd42e3c9f7156171c126cdce.zip | |
Vectors are not supported by ConstantInt::getAllOnesValue.
llvm-svn: 32827
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index e55e313686d..08c5d27cd51 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -88,6 +88,7 @@ public: if (LatticeValue != constant) { if (LatticeValue == undefined) { LatticeValue = constant; + assert(V && "Marking constant with NULL"); ConstantVal = V; } else { assert(LatticeValue == forcedconstant && @@ -699,14 +700,15 @@ void SCCPSolver::visitBinaryOperator(Instruction &I) { // Could annihilate value. if (I.getOpcode() == Instruction::And) markConstant(IV, &I, Constant::getNullValue(I.getType())); - else - markConstant(IV, &I, ConstantInt::getAllOnesValue(I.getType())); + else if (Constant *Ones = ConstantInt::getAllOnesValue(I.getType())) { + markConstant(IV, &I, Ones); + } return; } else { if (I.getOpcode() == Instruction::And) { if (NonOverdefVal->getConstant()->isNullValue()) { markConstant(IV, &I, NonOverdefVal->getConstant()); - return; // X or 0 = -1 + return; // X and 0 = 0 } } else { if (ConstantIntegral *CI = @@ -1231,8 +1233,11 @@ bool SCCPSolver::ResolvedUndefsIn(Function &F) { case Instruction::Or: // undef | X -> -1. X could be -1. - markForcedConstant(LV, I, ConstantInt::getAllOnesValue(ITy)); - return true; + if (Constant *Ones = ConstantInt::getAllOnesValue(ITy)) { + markForcedConstant(LV, I, Ones); + return true; + } + break; case Instruction::SDiv: case Instruction::UDiv: |

