summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-18 08:47:13 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-18 08:47:13 +0000
commit668d90f2892ed5700faa78951c5686923f2a9d6e (patch)
tree31a8d79358950aa31145c73963241655e17ee1f1 /llvm/lib/CodeGen/IntrinsicLowering.cpp
parent4800c38a7546a8fc2435722b9e05470edb15d03e (diff)
downloadbcm5719-llvm-668d90f2892ed5700faa78951c5686923f2a9d6e.tar.gz
bcm5719-llvm-668d90f2892ed5700faa78951c5686923f2a9d6e.zip
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. llvm-svn: 32654
Diffstat (limited to 'llvm/lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/IntrinsicLowering.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp
index f18d5f9a4f7..b57b27252f2 100644
--- a/llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud