[llvm] c72f49c - [InstSimplify] add test for select that should not be simplified; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 11:01:55 PDT 2020
Author: Sanjay Patel
Date: 2020-04-14T13:57:30-04:00
New Revision: c72f49cc57e9c3e6d4967d65f213660194421aa6
URL: https://github.com/llvm/llvm-project/commit/c72f49cc57e9c3e6d4967d65f213660194421aa6
DIFF: https://github.com/llvm/llvm-project/commit/c72f49cc57e9c3e6d4967d65f213660194421aa6.diff
LOG: [InstSimplify] add test for select that should not be simplified; NFC
See discussion in D77868
Added:
Modified:
llvm/test/Transforms/InstSimplify/select.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/select.ll b/llvm/test/Transforms/InstSimplify/select.ll
index bafcb96461ff..139f5e3c3c23 100644
--- a/llvm/test/Transforms/InstSimplify/select.ll
+++ b/llvm/test/Transforms/InstSimplify/select.ll
@@ -737,3 +737,16 @@ define i8 @and_cmps_wrong_type(i32 %x) {
%r = select i1 %cmp1, i8 %s, i8 0
ret i8 %r
}
+
+define i1 @y_might_be_poison(float %x, float %y) {
+; CHECK-LABEL: @y_might_be_poison(
+; CHECK-NEXT: [[C1:%.*]] = fcmp ord float 0.000000e+00, [[X:%.*]]
+; CHECK-NEXT: [[C2:%.*]] = fcmp ord float [[X]], [[Y:%.*]]
+; CHECK-NEXT: [[C3:%.*]] = select i1 [[C1]], i1 [[C2]], i1 false
+; CHECK-NEXT: ret i1 [[C3]]
+;
+ %c1 = fcmp ord float 0.0, %x
+ %c2 = fcmp ord float %x, %y
+ %c3 = select i1 %c1, i1 %c2, i1 false
+ ret i1 %c3
+}
More information about the llvm-commits
mailing list