[llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp ValueMapper.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Apr 7 18:19:27 PDT 2006



Changes in directory llvm/lib/Transforms/Utils:

Local.cpp updated: 1.54 -> 1.55
ValueMapper.cpp updated: 1.24 -> 1.25
---
Log message:

Add supprot for shufflevector


---
Diffs of the changes:  (+10 -0)

 Local.cpp       |    5 +++++
 ValueMapper.cpp |    5 +++++
 2 files changed, 10 insertions(+)


Index: llvm/lib/Transforms/Utils/Local.cpp
diff -u llvm/lib/Transforms/Utils/Local.cpp:1.54 llvm/lib/Transforms/Utils/Local.cpp:1.55
--- llvm/lib/Transforms/Utils/Local.cpp:1.54	Sat Apr  1 21:35:01 2006
+++ llvm/lib/Transforms/Utils/Local.cpp	Fri Apr  7 20:19:12 2006
@@ -107,6 +107,11 @@
   case Instruction::InsertElement:
     if (Constant *Op2 = dyn_cast<Constant>(I->getOperand(2)))
       return ConstantExpr::getInsertElement(Op0, Op1, Op2);
+    return 0;
+  case Instruction::ShuffleVector:
+    if (Constant *Op2 = dyn_cast<Constant>(I->getOperand(2)))
+      return ConstantExpr::getShuffleVector(Op0, Op1, Op2);
+    return 0;
   case Instruction::GetElementPtr:
     std::vector<Constant*> IdxList;
     IdxList.reserve(I->getNumOperands()-1);


Index: llvm/lib/Transforms/Utils/ValueMapper.cpp
diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.24 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.25
--- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.24	Thu Apr  6 23:41:03 2006
+++ llvm/lib/Transforms/Utils/ValueMapper.cpp	Fri Apr  7 20:19:12 2006
@@ -94,6 +94,11 @@
         Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));
         Constant *MV2 = cast<Constant>(MapValue(CE->getOperand(1), VM));
         return VMSlot = ConstantExpr::getExtractElement(MV1, MV2);
+      } else if (CE->getOpcode() == Instruction::ShuffleVector) {
+        Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));
+        Constant *MV2 = cast<Constant>(MapValue(CE->getOperand(1), VM));
+        Constant *MV3 = cast<Constant>(CE->getOperand(2));
+        return VMSlot = ConstantExpr::getShuffleVector(MV1, MV2, MV3);
       } else {
         assert(CE->getNumOperands() == 2 && "Must be binary operator?");
         Constant *MV1 = cast<Constant>(MapValue(CE->getOperand(0), VM));






More information about the llvm-commits mailing list