diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-01-04 02:12:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-01-04 02:12:40 +0000 |
| commit | 7ce2f8b265e5d170cecbe61ea7f4269876bf07ef (patch) | |
| tree | b13d88439c34dcbfc4f8c153aecc7b914b941d10 /lib/Transforms | |
| parent | e94d8b2f536cb9ec9a3a825a8b2bfbb000952b5e (diff) | |
| download | llvm-7ce2f8b265e5d170cecbe61ea7f4269876bf07ef.tar.gz llvm-7ce2f8b265e5d170cecbe61ea7f4269876bf07ef.tar.bz2 llvm-7ce2f8b265e5d170cecbe61ea7f4269876bf07ef.tar.xz | |
Enable a couple xforms for packed vectors (undef | v) -> -1 for packed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
| -rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 08c5d27cd5..4117480810 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -700,9 +700,10 @@ void SCCPSolver::visitBinaryOperator(Instruction &I) { // Could annihilate value. if (I.getOpcode() == Instruction::And) markConstant(IV, &I, Constant::getNullValue(I.getType())); - else if (Constant *Ones = ConstantInt::getAllOnesValue(I.getType())) { - markConstant(IV, &I, Ones); - } + else if (const PackedType *PT = dyn_cast<PackedType>(I.getType())) + markConstant(IV, &I, ConstantPacked::getAllOnesValue(PT)); + else + markConstant(IV, &I, ConstantInt::getAllOnesValue(I.getType())); return; } else { if (I.getOpcode() == Instruction::And) { @@ -1233,11 +1234,11 @@ bool SCCPSolver::ResolvedUndefsIn(Function &F) { case Instruction::Or: // undef | X -> -1. X could be -1. - if (Constant *Ones = ConstantInt::getAllOnesValue(ITy)) { - markForcedConstant(LV, I, Ones); - return true; - } - break; + if (const PackedType *PTy = dyn_cast<PackedType>(ITy)) + markForcedConstant(LV, I, ConstantPacked::getAllOnesValue(PTy)); + else + markForcedConstant(LV, I, ConstantInt::getAllOnesValue(ITy)); + return true; case Instruction::SDiv: case Instruction::UDiv: |
