[PATCH] D29074: Canonicalize guards for AND condition

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 00:28:41 PST 2017


apilipenko added inline comments.


================
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());
----------------
Maybe:
```
auto CC = II->getCallingConv()
Builder->CreateCall(A)->setCallingConv(CC)
Builder->CreateCall(B)->setCallingConv(CC)
```


================
Comment at: test/Transforms/InstCombine/call-guard.ll:32
+
+define void @test_guard_and(i1 %A, i1 %B) {
+; CHECK-LABEL: @test_guard_and(
----------------
Please add a test with non-default calling convention


https://reviews.llvm.org/D29074





More information about the llvm-commits mailing list