[llvm] 114e964 - [InstCombine] auto-generate complete test checks; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 1 10:44:42 PDT 2020
Author: Sanjay Patel
Date: 2020-10-01T13:44:31-04:00
New Revision: 114e964dce9f18e8f3c25a3a4136e59ead9ae50c
URL: https://github.com/llvm/llvm-project/commit/114e964dce9f18e8f3c25a3a4136e59ead9ae50c
DIFF: https://github.com/llvm/llvm-project/commit/114e964dce9f18e8f3c25a3a4136e59ead9ae50c.diff
LOG: [InstCombine] auto-generate complete test checks; NFC
Added:
Modified:
llvm/test/Transforms/InstCombine/bitreverse-known-bits.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/bitreverse-known-bits.ll b/llvm/test/Transforms/InstCombine/bitreverse-known-bits.ll
index cd1523a3b06b..b8702f64dfdc 100644
--- a/llvm/test/Transforms/InstCombine/bitreverse-known-bits.ll
+++ b/llvm/test/Transforms/InstCombine/bitreverse-known-bits.ll
@@ -1,11 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -S -instcombine | FileCheck %s
declare i8 @llvm.bitreverse.i8(i8)
declare i32 @llvm.bitreverse.i32(i32)
-; CHECK-LABEL: @test1
-; CHECK: ret i1 true
define i1 @test1(i32 %arg) {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: ret i1 true
+;
%a = or i32 %arg, 4294901760
%b = call i32 @llvm.bitreverse.i32(i32 %a)
%and = and i32 %b, 65535
@@ -13,9 +15,10 @@ define i1 @test1(i32 %arg) {
ret i1 %res
}
-; CHECK-LABEL: @test2
-; CHECK: ret i1 true
define i1 @test2(i32 %arg) {
+; CHECK-LABEL: @test2(
+; CHECK-NEXT: ret i1 true
+;
%a = or i32 %arg, 1
%b = call i32 @llvm.bitreverse.i32(i32 %a)
%c = and i32 %b, 2147483648
@@ -24,9 +27,10 @@ define i1 @test2(i32 %arg) {
ret i1 %res
}
-; CHECK-LABEL: @test3
-; CHECK: ret i1 false
define i1 @test3(i32 %arg) {
+; CHECK-LABEL: @test3(
+; CHECK-NEXT: ret i1 false
+;
%a = or i32 %arg, 65536
%b = call i32 @llvm.bitreverse.i32(i32 %a)
%and = and i32 %b, 32768
@@ -34,18 +38,22 @@ define i1 @test3(i32 %arg) {
ret i1 %res
}
-; CHECK-LABEL: @add_bitreverse
-; Make sure we process range metadata on bitreverse
+; known bits for the bitreverse will say the result is in the range [0, 64)
+; but the metadata says [0, 16). So make sure the range metadata wins.
+; add %reverse, 1111 0000
+; should become
+; or %reverse, 1111 0000
+
define i8 @add_bitreverse(i8 %a) {
+; CHECK-LABEL: @add_bitreverse(
+; CHECK-NEXT: [[B:%.*]] = and i8 [[A:%.*]], -4
+; CHECK-NEXT: [[REVERSE:%.*]] = call i8 @llvm.bitreverse.i8(i8 [[B]]), [[RNG0:!range !.*]]
+; CHECK-NEXT: [[C:%.*]] = or i8 [[REVERSE]], -16
+; CHECK-NEXT: ret i8 [[C]]
+;
%b = and i8 %a, 252
- ; known bits for the bitreverse will say the result is in the range [0, 64)
- ; but the metadata says [0, 16). So make sure the range metadata wins.
- ; add %reverse, 1111 0000
- ; should become
- ; or %reverse, 1111 0000
%reverse = call i8 @llvm.bitreverse.i8(i8 %b), !range !1
%c = add i8 %reverse, -16
-; CHECK: or i8 %reverse, -16
ret i8 %c
}
!1 = !{i8 0, i8 16}
More information about the llvm-commits
mailing list