summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-04 02:12:40 +0000
committerChris Lattner <sabre@nondot.org>2007-01-04 02:12:40 +0000
commit806adafd956332ea6003d6a6153a9dfb146ccad2 (patch)
tree2b01183d2b3f00c19a97fdb9270321b4ef280df7 /llvm/lib/Transforms
parent26f13eb1f3e7b2b0cb8dd6db3d0588ae4c627e28 (diff)
downloadbcm5719-llvm-806adafd956332ea6003d6a6153a9dfb146ccad2.tar.gz
bcm5719-llvm-806adafd956332ea6003d6a6153a9dfb146ccad2.zip
Enable a couple xforms for packed vectors (undef | v) -> -1 for packed.
llvm-svn: 32858
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 08c5d27cd51..41174808100 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/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:
OpenPOWER on IntegriCloud