[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Reid Spencer reid at x10sys.com
Tue Dec 12 16:50:43 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.329 -> 1.330
---
Log message:

Replace CastInst::createInferredCast calls with more accurate cast
creation calls.


---
Diffs of the changes:  (+5 -5)

 SelectionDAGISel.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.329 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.330
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.329	Tue Dec 12 15:21:32 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Tue Dec 12 18:50:17 2006
@@ -3519,8 +3519,8 @@
       while (isa<PHINode>(InsertPt)) ++InsertPt;
       
       InsertedCast = 
-        CastInst::createInferredCast(CI->getOperand(0), CI->getType(), "", 
-                                     InsertPt);
+        CastInst::create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "", 
+                         InsertPt);
       MadeChange = true;
     }
     
@@ -3559,8 +3559,8 @@
   // operand).
   if (CastInst *CI = dyn_cast<CastInst>(Ptr))
     if (CI->getParent() != BB && isa<PointerType>(CI->getOperand(0)->getType()))
-      Ptr = CastInst::createInferredCast(CI->getOperand(0), CI->getType(), "",
-                                         InsertPt);
+      Ptr = CastInst::create(CI->getOpcode(), CI->getOperand(0), CI->getType(),
+                             "", InsertPt);
   
   // Add the offset, cast it to the right type.
   Ptr = BinaryOperator::createAdd(Ptr, PtrOffset, "", InsertPt);
@@ -3702,7 +3702,7 @@
       // Ptr = Ptr + Idx * ElementSize;
       
       // Cast Idx to UIntPtrTy if needed.
-      Idx = CastInst::createInferredCast(Idx, UIntPtrTy, "", GEPI);
+      Idx = CastInst::createIntegerCast(Idx, UIntPtrTy, true/*SExt*/, "", GEPI);
       
       uint64_t ElementSize = TD->getTypeSize(Ty);
       // Mask off bits that should not be set.






More information about the llvm-commits mailing list