diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-04 02:46:44 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-04 02:46:44 +0000 |
commit | 575d95ce373f1e405e6c27ce8d9f244bba3bdd0d (patch) | |
tree | 7dbef38ce90d354f1eebb43931b7ecc2d12cf74e /include/llvm/Analysis/ScalarEvolutionExpander.h | |
parent | 56667123b7f6d6dda8b4dc178c8be4192299ae6e (diff) | |
download | external_llvm-575d95ce373f1e405e6c27ce8d9f244bba3bdd0d.zip external_llvm-575d95ce373f1e405e6c27ce8d9f244bba3bdd0d.tar.gz external_llvm-575d95ce373f1e405e6c27ce8d9f244bba3bdd0d.tar.bz2 |
Change inferred casts to explicit casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpander.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h index 163d357..7f0f96f 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpander.h +++ b/include/llvm/Analysis/ScalarEvolutionExpander.h @@ -115,12 +115,18 @@ namespace llvm { Value *visitTruncateExpr(SCEVTruncateExpr *S) { Value *V = expand(S->getOperand()); - return CastInst::createInferredCast(V, S->getType(), "tmp.", InsertPt); + Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() == + S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast : + Instruction::Trunc; + return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt); } Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) { Value *V = expandInTy(S->getOperand(),S->getType()->getUnsignedVersion()); - return CastInst::createInferredCast(V, S->getType(), "tmp.", InsertPt); + Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() == + S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast : + Instruction::ZExt; + return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt); } Value *visitAddExpr(SCEVAddExpr *S) { |