[PATCH] D29074: Canonicalize guards for AND condition

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 01:46:14 PST 2017


apilipenko accepted this revision.
apilipenko added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:2889-2894
+      CallInst *GuardA = Builder->CreateCall(GuardIntrinsic, A,
+                                             {DeoptOB}, II->getName());
+      CallInst *GuardB = Builder->CreateCall(GuardIntrinsic, B,
+                                             {DeoptOB}, II->getName());
+      GuardA->setCallingConv(II->getCallingConv());
+      GuardB->setCallingConv(II->getCallingConv());
----------------
mkazantsev wrote:
> 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.
Not a big deal IMO, but I leave it up to you.


================
Comment at: test/Transforms/InstCombine/call-guard.ll:42
+
+define void @test_guard_and_cc99(i1 %A, i1 %B) {
+; CHECK-LABEL: @test_guard_and_cc99(
----------------
@test_guard_and_non_default_cc? There is nothing specific about cc99 in this test.


https://reviews.llvm.org/D29074





More information about the llvm-commits mailing list