[llvm] 234a842 - [InstCombine] add test for min/max intrinsic with constant expression; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 17 07:38:31 PST 2022
Author: Sanjay Patel
Date: 2022-02-17T10:36:37-05:00
New Revision: 234a8422c912ec102e23cc06999245945b53182f
URL: https://github.com/llvm/llvm-project/commit/234a8422c912ec102e23cc06999245945b53182f
DIFF: https://github.com/llvm/llvm-project/commit/234a8422c912ec102e23cc06999245945b53182f.diff
LOG: [InstCombine] add test for min/max intrinsic with constant expression; NFC
Added:
Modified:
llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll b/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
index b264cbbc1f10a..4c95d45063f67 100644
--- a/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
+++ b/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
@@ -2352,3 +2352,14 @@ define i8 @smin_smin_smin_reassoc_constants(i8 %x, i8 %y) {
%m3 = call i8 @llvm.smin.i8(i8 %m2, i8 126)
ret i8 %m3
}
+
+define i8 @umax_umax_reassoc_constantexpr_sink(i8 %x, i8 %y) {
+; CHECK-LABEL: @umax_umax_reassoc_constantexpr_sink(
+; CHECK-NEXT: [[M1:%.*]] = call i8 @llvm.umax.i8(i8 [[X:%.*]], i8 42)
+; CHECK-NEXT: [[M2:%.*]] = call i8 @llvm.umax.i8(i8 [[M1]], i8 ptrtoint (i8 (i8, i8)* @umax_umax_reassoc_constantexpr_sink to i8))
+; CHECK-NEXT: ret i8 [[M2]]
+;
+ %m1 = call i8 @llvm.umax.i8(i8 %x, i8 42)
+ %m2 = call i8 @llvm.umax.i8(i8 %m1, i8 ptrtoint (i8 (i8, i8)* @umax_umax_reassoc_constantexpr_sink to i8))
+ ret i8 %m2
+}
More information about the llvm-commits
mailing list