[llvm] 8a09d88 - [InstCombine] Add test for PR64937 (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 24 06:21:53 PDT 2023
Author: Nikita Popov
Date: 2023-08-24T15:21:45+02:00
New Revision: 8a09d8893f52771d64518a1022b0c563ca3a7304
URL: https://github.com/llvm/llvm-project/commit/8a09d8893f52771d64518a1022b0c563ca3a7304
DIFF: https://github.com/llvm/llvm-project/commit/8a09d8893f52771d64518a1022b0c563ca3a7304.diff
LOG: [InstCombine] Add test for PR64937 (NFC)
Added:
Modified:
llvm/test/Transforms/InstCombine/minmax-fp.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/minmax-fp.ll b/llvm/test/Transforms/InstCombine/minmax-fp.ll
index 7ab9193ac0b22b..438219b53c27b3 100644
--- a/llvm/test/Transforms/InstCombine/minmax-fp.ll
+++ b/llvm/test/Transforms/InstCombine/minmax-fp.ll
@@ -449,3 +449,16 @@ define float @minnum_no_nnan(float %a, float %b) {
%f = select nsz i1 %cond, float %a, float %b
ret float %f
}
+
+define float @pr64937_preserve_min_idiom(float %a) {
+; CHECK-LABEL: @pr64937_preserve_min_idiom(
+; CHECK-NEXT: [[CMP:%.*]] = fcmp nnan olt float [[A:%.*]], 3.276700e+04
+; CHECK-NEXT: [[TMP1:%.*]] = fmul nnan float [[A]], 6.553600e+04
+; CHECK-NEXT: [[RES:%.*]] = select i1 [[CMP]], float [[TMP1]], float 0x41DFFFC000000000
+; CHECK-NEXT: ret float [[RES]]
+;
+ %cmp = fcmp nnan olt float %a, 3.276700e+04
+ %sel = select nnan i1 %cmp, float %a, float 3.276700e+04
+ %res = fmul nnan float %sel, 6.553600e+04
+ ret float %res
+}
More information about the llvm-commits
mailing list