[PATCH] D30422: Keep attributes, calling convention, etc, when remangling intrinsic
Sanjoy Das via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 28 11:00:26 PST 2017
sanjoy added inline comments.
================
Comment at: lib/IR/AutoUpgrade.cpp:1920
assert(
(CI->getCalledFunction()->getName() != NewFn->getName()) &&
"Unknown function for CallInst upgrade and isn't just a name change");
----------------
Don't you need a `break;` here?
================
Comment at: lib/IR/AutoUpgrade.cpp:1953
"Mismatch between function args and call args");
- CI->replaceAllUsesWith(Builder.CreateCall(
- NewFn, {CI->getArgOperand(0), Builder.getFalse()}, Name));
- CI->eraseFromParent();
- return;
+ NewCall = Builder.CreateCall(NewFn, {CI->getArgOperand(0), Builder.getFalse()},
+ Name);
----------------
Spacing is a bit off here.
================
Comment at: lib/IR/AutoUpgrade.cpp:1958
case Intrinsic::objectsize:
CI->replaceAllUsesWith(Builder.CreateCall(
NewFn, {CI->getArgOperand(0), CI->getArgOperand(1)}, Name));
----------------
Why did you leave the `replaceAllUsesWith` alone in this case?
https://reviews.llvm.org/D30422
More information about the llvm-commits
mailing list