[PATCH] D30422: Keep attributes, calling convention, etc, when remangling intrinsic

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 11:05:50 PST 2017


dberlin marked 3 inline comments as done.
dberlin 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");
----------------
sanjoy wrote:
> Don't you need a `break;` here?
No, this should return, sigh.


================
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);
----------------
sanjoy wrote:
> Spacing is a bit off here.
I'll clang format it again


================
Comment at: lib/IR/AutoUpgrade.cpp:1958
   case Intrinsic::objectsize:
     CI->replaceAllUsesWith(Builder.CreateCall(
         NewFn, {CI->getArgOperand(0), CI->getArgOperand(1)}, Name));
----------------
sanjoy wrote:
> Why did you leave the `replaceAllUsesWith` alone in this case?
Just got missed because it was multiline


https://reviews.llvm.org/D30422





More information about the llvm-commits mailing list