[PATCH] D119689: [InstCombine] Add test reproducing PR53252 (NFC)
Ricky Zhou via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 13 22:34:00 PST 2022
rickyz created this revision.
rickyz added reviewers: spatel, nikic.
rickyz requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119689
Files:
llvm/test/Transforms/InstCombine/canonicalize-clamp-like-pattern-between-negative-and-positive-thresholds.ll
Index: llvm/test/Transforms/InstCombine/canonicalize-clamp-like-pattern-between-negative-and-positive-thresholds.ll
===================================================================
--- llvm/test/Transforms/InstCombine/canonicalize-clamp-like-pattern-between-negative-and-positive-thresholds.ll
+++ llvm/test/Transforms/InstCombine/canonicalize-clamp-like-pattern-between-negative-and-positive-thresholds.ll
@@ -131,6 +131,7 @@
%r = select i1 %t3, i32 %t1, i32 %x
ret i32 %r
}
+
define i32 @t7_ugt_sgt_neg1(i32 %x, i32 %replacement_low, i32 %replacement_high) {
; CHECK-LABEL: @t7_ugt_sgt_neg1(
; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[X:%.*]], -16
@@ -167,6 +168,7 @@
%r = select i1 %t3, i32 %x, i32 %t1
ret i32 %r
}
+
define i32 @n9_ult_slt_neg17(i32 %x, i32 %replacement_low, i32 %replacement_high) {
; CHECK-LABEL: @n9_ult_slt_neg17(
; CHECK-NEXT: [[T0:%.*]] = icmp slt i32 [[X:%.*]], -17
@@ -184,6 +186,22 @@
ret i32 %r
}
+define i32 @n10_ugt_slt(i32 %x, i32 %replacement_low, i32 %replacement_high) {
+; FIXME: This is incorrect, see PR53252.
+; CHECK-LABEL: @n10_ugt_slt(
+; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[X:%.*]], 0
+; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[X]], 128
+; CHECK-NEXT: [[TMP3:%.*]] = select i1 [[TMP1]], i32 [[REPLACEMENT_LOW:%.*]], i32 [[X]]
+; CHECK-NEXT: [[R:%.*]] = select i1 [[TMP2]], i32 [[REPLACEMENT_HIGH:%.*]], i32 [[TMP3]]
+; CHECK-NEXT: ret i32 [[R]]
+;
+ %t0 = icmp slt i32 %x, 0
+ %t1 = select i1 %t0, i32 %replacement_low, i32 %replacement_high
+ %t2 = icmp ugt i32 %x, 128
+ %r = select i1 %t2, i32 %x, i32 %t1
+ ret i32 %r
+}
+
;-------------------------------------------------------------------------------
declare void @use32(i32)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119689.408329.patch
Type: text/x-patch
Size: 1746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220214/97b6b748/attachment.bin>
More information about the llvm-commits
mailing list