[llvm] r289959 - [InstCombine] auto-generate checks; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 08:58:54 PST 2016
Author: spatel
Date: Fri Dec 16 10:58:54 2016
New Revision: 289959
URL: http://llvm.org/viewvc/llvm-project?rev=289959&view=rev
Log:
[InstCombine] auto-generate checks; NFC
Modified:
llvm/trunk/test/Transforms/InstCombine/call_nonnull_arg.ll
Modified: llvm/trunk/test/Transforms/InstCombine/call_nonnull_arg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/call_nonnull_arg.ll?rev=289959&r1=289958&r2=289959&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/call_nonnull_arg.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/call_nonnull_arg.ll Fri Dec 16 10:58:54 2016
@@ -1,11 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
; InstCombine should mark null-checked argument as nonnull at callsite
declare void @dummy(i32*, i32)
define void @test(i32* %a, i32 %b) {
-; CHECK-LABEL: @test
-; CHECK: call void @dummy(i32* nonnull %a, i32 %b)
+; CHECK-LABEL: @test(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[COND1:%.*]] = icmp eq i32* %a, null
+; CHECK-NEXT: br i1 [[COND1]], label %dead, label %not_null
+; CHECK: not_null:
+; CHECK-NEXT: [[COND2:%.*]] = icmp eq i32 %b, 0
+; CHECK-NEXT: br i1 [[COND2]], label %dead, label %not_zero
+; CHECK: not_zero:
+; CHECK-NEXT: call void @dummy(i32* nonnull %a, i32 %b)
+; CHECK-NEXT: ret void
+; CHECK: dead:
+; CHECK-NEXT: unreachable
+;
entry:
%cond1 = icmp eq i32* %a, null
br i1 %cond1, label %dead, label %not_null
@@ -18,3 +30,4 @@ not_zero:
dead:
unreachable
}
+
More information about the llvm-commits
mailing list