diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-18 08:47:13 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-18 08:47:13 +0000 |
commit | 8a903db4990d57aadea5cdad601ff26e92899103 (patch) | |
tree | e0d11dd482aa821ec2e4eeed634ce22ad527dbbb /lib/CodeGen/IntrinsicLowering.cpp | |
parent | d97321ceb313f06fd9a824cf26b9dc5b80b3eb9d (diff) |
Convert the last uses of CastInst::createInferredCast to a normal cast
creation. These changes are still temporary but at least this pushes
knowledge of signedness out closer to where it can be determined properly
and allows signedness to be removed from VMCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index f18d5f9a4f..b57b27252f 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -66,9 +66,13 @@ static CallInst *ReplaceCallWith(const char *NewFn, CallInst *CI, if (castOpcodes[ArgNo]) Arg = CastInst::create(Instruction::CastOps(castOpcodes[ArgNo]), Arg, FT->getParamType(ArgNo), Arg->getName(), CI); - else - Arg = CastInst::createInferredCast(Arg, FT->getParamType(ArgNo), - Arg->getName(), CI); + else { + Instruction::CastOps opcode = CastInst::getCastOpcode(Arg, + Arg->getType()->isSigned(), FT->getParamType(ArgNo), + FT->getParamType(ArgNo)->isSigned()); + Arg = CastInst::create(opcode, Arg, FT->getParamType(ArgNo), + Arg->getName(), CI); + } Operands.push_back(Arg); } // Pass nulls into any additional arguments... @@ -80,8 +84,12 @@ static CallInst *ReplaceCallWith(const char *NewFn, CallInst *CI, CallInst *NewCI = new CallInst(FCache, Operands, Name, CI); if (!CI->use_empty()) { Value *V = NewCI; - if (CI->getType() != NewCI->getType()) - V = CastInst::createInferredCast(NewCI, CI->getType(), Name, CI); + if (CI->getType() != NewCI->getType()) { + Instruction::CastOps opcode = CastInst::getCastOpcode(NewCI, + NewCI->getType()->isSigned(), CI->getType(), + CI->getType()->isSigned()); + V = CastInst::create(opcode, NewCI, CI->getType(), Name, CI); + } CI->replaceAllUsesWith(V); } return NewCI; |