return 0;
}
-CallInst* llvm::UpgradeIntrinsicCall(CallInst *CI) {
+Instruction* llvm::UpgradeIntrinsicCall(CallInst *CI) {
Function *F = CI->getCalledFunction();
if (const Type* Ty = get_type(F)) {
Function* newF = UpgradeIntrinsicFunction(F);
const Type* newTy = Ty->getUnsignedVersion();
newCI->setOperand(1,new CastInst(newCI->getOperand(1), newTy,
"autoupgrade_cast", newCI));
+ CastInst* final = new CastInst(newCI, Ty, "autoupgrade_uncast",newCI);
+ newCI->moveBefore(final);
+ return final;
}
return newCI;
}