diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-13 00:50:17 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-13 00:50:17 +0000 |
| commit | 7b06bd532d3324a2f76bbc856ae20ff89d8e0e92 (patch) | |
| tree | cbd629912f00b8d9d35e320842aca7e1cded803e /lib/CodeGen | |
| parent | 31b628ba6096d2b0bb5591b1231a8e4df4f6c8b8 (diff) | |
Replace CastInst::createInferredCast calls with more accurate cast
creation calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index c112b873b7..f3ae248574 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -3519,8 +3519,8 @@ static bool OptimizeNoopCopyExpression(CastInst *CI) { 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 @@ static Instruction *InsertGEPComputeCode(Instruction *&V, BasicBlock *BB, // 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 @@ static bool OptimizeGEPExpression(GetElementPtrInst *GEPI, // 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. |
