diff options
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpander.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h index 7f0f96f..c3ea383 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpander.h +++ b/include/llvm/Analysis/ScalarEvolutionExpander.h @@ -115,18 +115,12 @@ namespace llvm { Value *visitTruncateExpr(SCEVTruncateExpr *S) { Value *V = expand(S->getOperand()); - Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() == - S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast : - Instruction::Trunc; - return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt); + return CastInst::createTruncOrBitCast(V, S->getType(), "tmp.", InsertPt); } Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) { Value *V = expandInTy(S->getOperand(),S->getType()->getUnsignedVersion()); - Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() == - S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast : - Instruction::ZExt; - return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt); + return CastInst::createZExtOrBitCast(V, S->getType(), "tmp.", InsertPt); } Value *visitAddExpr(SCEVAddExpr *S) { |