[llvm] 483ae09 - [InstCombine] add test for min/max intrinsic reassociation; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 16 06:16:53 PST 2022
Author: Sanjay Patel
Date: 2022-02-16T09:16:16-05:00
New Revision: 483ae099f0e729aaae6ed397ccbc67de8849d729
URL: https://github.com/llvm/llvm-project/commit/483ae099f0e729aaae6ed397ccbc67de8849d729
DIFF: https://github.com/llvm/llvm-project/commit/483ae099f0e729aaae6ed397ccbc67de8849d729.diff
LOG: [InstCombine] add test for min/max intrinsic reassociation; NFC
D119851
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 f3b9757b6a5a..a309c011f3a2 100644
--- a/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
+++ b/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
@@ -2270,6 +2270,19 @@ define i8 @smax_smax_smax_reassoc_constants(i8 %x, i8 %y) {
ret i8 %m3
}
+define i8 @smax_smax_smax_reassoc_constants_swap(i8 %x, i8 %y) {
+; CHECK-LABEL: @smax_smax_smax_reassoc_constants_swap(
+; CHECK-NEXT: [[M1:%.*]] = call i8 @llvm.smax.i8(i8 [[X:%.*]], i8 42)
+; CHECK-NEXT: [[M2:%.*]] = call i8 @llvm.smax.i8(i8 [[M1]], i8 [[Y:%.*]])
+; CHECK-NEXT: [[M3:%.*]] = call i8 @llvm.smax.i8(i8 [[M2]], i8 126)
+; CHECK-NEXT: ret i8 [[M3]]
+;
+ %m1 = call i8 @llvm.smax.i8(i8 %x, i8 42)
+ %m2 = call i8 @llvm.smax.i8(i8 %m1, i8 %y)
+ %m3 = call i8 @llvm.smax.i8(i8 %m2, i8 126)
+ ret i8 %m3
+}
+
define i8 @smin_smin_smin_reassoc_constants(i8 %x, i8 %y) {
; CHECK-LABEL: @smin_smin_smin_reassoc_constants(
; CHECK-NEXT: [[M1:%.*]] = call i8 @llvm.smin.i8(i8 [[X:%.*]], i8 42)
More information about the llvm-commits
mailing list