[llvm] 732a90d - [InstCombine] precommit pr49688.ll (NFC)

Juneyoung Lee via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 3 21:29:53 PDT 2021


Author: Juneyoung Lee
Date: 2021-04-04T13:29:36+09:00
New Revision: 732a90da785de2f61dbbf09d6c5fe55937d194b6

URL: https://github.com/llvm/llvm-project/commit/732a90da785de2f61dbbf09d6c5fe55937d194b6
DIFF: https://github.com/llvm/llvm-project/commit/732a90da785de2f61dbbf09d6c5fe55937d194b6.diff

LOG: [InstCombine] precommit pr49688.ll (NFC)

This is going to be fixed by D99674

Added: 
    llvm/test/Transforms/InstCombine/pr49688.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/pr49688.ll b/llvm/test/Transforms/InstCombine/pr49688.ll
new file mode 100644
index 000000000000..0de6a7f67b07
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/pr49688.ll
@@ -0,0 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+define i1 @f(i32 %i1) {
+; CHECK-LABEL: @f(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[SHR:%.*]] = lshr i32 7, [[I1:%.*]]
+; CHECK-NEXT:    [[TMP0:%.*]] = icmp ult i32 [[SHR]], [[I1]]
+; CHECK-NEXT:    ret i1 [[TMP0]]
+;
+entry:
+  %cmp = icmp slt i32 %i1, 0
+  %shr = ashr i32 7, %i1
+  %cmp4 = icmp sgt i32 %i1, %shr
+  %i2 = select i1 %cmp, i1 true, i1 %cmp4
+  ret i1 %i2
+}
+
+define i32 @f2(i32 signext %g, i32 zeroext %h) {
+; CHECK-LABEL: @f2(
+; CHECK-NEXT:    [[SHR:%.*]] = lshr i32 7, [[H:%.*]]
+; CHECK-NEXT:    [[TMP1:%.*]] = icmp ult i32 [[SHR]], [[G:%.*]]
+; CHECK-NEXT:    [[LOR_EXT:%.*]] = zext i1 [[TMP1]] to i32
+; CHECK-NEXT:    ret i32 [[LOR_EXT]]
+;
+  %cmp = icmp slt i32 %g, 0
+  %shr = ashr i32 7, %h
+  %cmp1 = icmp sgt i32 %g, %shr
+  %.0 = select i1 %cmp, i1 true, i1 %cmp1
+  %lor.ext = zext i1 %.0 to i32
+  ret i32 %lor.ext
+}


        


More information about the llvm-commits mailing list