[llvm] r310101 - [InstCombine] auto-generate test checks; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 4 12:29:32 PDT 2017
Author: spatel
Date: Fri Aug 4 12:29:32 2017
New Revision: 310101
URL: http://llvm.org/viewvc/llvm-project?rev=310101&view=rev
Log:
[InstCombine] auto-generate test checks; NFC
Modified:
llvm/trunk/test/Transforms/InstCombine/fls.ll
Modified: llvm/trunk/test/Transforms/InstCombine/fls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/fls.ll?rev=310101&r1=310100&r2=310101&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/fls.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/fls.ll Fri Aug 4 12:29:32 2017
@@ -2,52 +2,49 @@
target triple = "x86_64-unknown-freebsd11.0"
-
-; CHECK-LABEL: define i32 @myfls(
-; CHECK: ret i32 6
-; CHECK: }
-
define i32 @myfls() {
-entry:
+; CHECK-LABEL: @myfls(
+; CHECK-NEXT: ret i32 6
+;
%call = call i32 @fls(i32 42)
ret i32 %call
}
-; CHECK-LABEL: define i32 @myflsl(
-; CHECK: ret i32 6
-; CHECK: }
-
define i32 @myflsl() {
+; CHECK-LABEL: @myflsl(
+; CHECK-NEXT: ret i32 6
+;
%patatino = call i32 @flsl(i64 42)
ret i32 %patatino
}
-; CHECK-LABEL: define i32 @myflsll(
-; CHECK: ret i32 6
-; CHECK: }
-
define i32 @myflsll() {
+; CHECK-LABEL: @myflsll(
+; CHECK-NEXT: ret i32 6
+;
%whatever = call i32 @flsll(i64 42)
ret i32 %whatever
}
; Lower to llvm.ctlz() if the argument is not a constant
-; CHECK-LABEL: define i32 @flsnotconst(
-; CHECK-NEXT: %ctlz = call i64 @llvm.ctlz.i64(i64 %z, i1 false)
-; CHECK-NEXT: %1 = sub nsw i64 64, %ctlz
-; CHECK-NEXT: %2 = trunc i64 %1 to i32
-; CHECK-NEXT: ret i32 %2
define i32 @flsnotconst(i64 %z) {
+; CHECK-LABEL: @flsnotconst(
+; CHECK-NEXT: [[CTLZ:%.*]] = call i64 @llvm.ctlz.i64(i64 %z, i1 false), !range !0
+; CHECK-NEXT: [[TMP1:%.*]] = sub nsw i64 64, [[CTLZ]]
+; CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[TMP1]] to i32
+; CHECK-NEXT: ret i32 [[TMP2]]
+;
%goo = call i32 @flsl(i64 %z)
ret i32 %goo
}
; Make sure we lower fls(0) to 0 and not to `undef`.
-; CHECK-LABEL: define i32 @flszero(
-; CHECK: ret i32 0
-; CHECK: }
+
define i32 @flszero() {
+; CHECK-LABEL: @flszero(
+; CHECK-NEXT: ret i32 0
+;
%zero = call i32 @fls(i32 0)
ret i32 %zero
}
More information about the llvm-commits
mailing list