[PATCH] D29075: Canonicalize guards for NOT OR condition

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 01:01:11 PST 2017


mkazantsev added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:2900-2905
+      CallInst *GuardA = Builder->CreateCall(GuardIntrinsic, Builder->CreateNot(A),
+                                             {DeoptOB}, II->getName());
+      CallInst *GuardB = Builder->CreateCall(GuardIntrinsic, Builder->CreateNot(B),
+                                             {DeoptOB}, II->getName());
+      GuardA->setCallingConv(II->getCallingConv());
+      GuardB->setCallingConv(II->getCallingConv());
----------------
apilipenko wrote:
> Maybe:
> ```
> auto CC = II->getCallingConv()
> Builder->CreateCall(A)->setCallingConv(CC)
> Builder->CreateCall(B)->setCallingConv(CC)
> ```
I would rather not do call creation and setting the convention in one line, because in case if we want to do to them something more than setting the CC in future, this code will need to be changed.


https://reviews.llvm.org/D29075





More information about the llvm-commits mailing list