[llvm] bc92045 - [NFC][InstCombine] Add two more tests to select-binop-foldable-floating-point.ll
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 7 03:16:10 PDT 2022
Author: David Sherwood
Date: 2022-06-07T11:16:04+01:00
New Revision: bc920450136acfec7342162eb95c39f52dc91a23
URL: https://github.com/llvm/llvm-project/commit/bc920450136acfec7342162eb95c39f52dc91a23
DIFF: https://github.com/llvm/llvm-project/commit/bc920450136acfec7342162eb95c39f52dc91a23.diff
LOG: [NFC][InstCombine] Add two more tests to select-binop-foldable-floating-point.ll
Pre-commit some tests as part of https://reviews.llvm.org/D126774
Added:
Modified:
llvm/test/Transforms/InstCombine/select-binop-foldable-floating-point.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/select-binop-foldable-floating-point.ll b/llvm/test/Transforms/InstCombine/select-binop-foldable-floating-point.ll
index b65bf26455d2d..00360b29b4533 100644
--- a/llvm/test/Transforms/InstCombine/select-binop-foldable-floating-point.ll
+++ b/llvm/test/Transforms/InstCombine/select-binop-foldable-floating-point.ll
@@ -133,6 +133,28 @@ define float @select_fsub_swapped_fast_math(i1 %cond, float %A, float %B) {
ret float %D
}
+define <4 x float> @select_nsz_fsub_v4f32(<4 x i1> %cond, <4 x float> %A, <4 x float> %B) {
+; CHECK-LABEL: @select_nsz_fsub_v4f32(
+; CHECK-NEXT: [[C:%.*]] = select <4 x i1> [[COND:%.*]], <4 x float> [[B:%.*]], <4 x float> zeroinitializer
+; CHECK-NEXT: [[D:%.*]] = fsub <4 x float> [[A:%.*]], [[C]]
+; CHECK-NEXT: ret <4 x float> [[D]]
+;
+ %C = fsub <4 x float> %A, %B
+ %D = select nsz <4 x i1> %cond, <4 x float> %C, <4 x float> %A
+ ret <4 x float> %D
+}
+
+define <vscale x 4 x float> @select_nsz_fsub_nxv4f32(<vscale x 4 x i1> %cond, <vscale x 4 x float> %A, <vscale x 4 x float> %B) {
+; CHECK-LABEL: @select_nsz_fsub_nxv4f32(
+; CHECK-NEXT: [[C:%.*]] = select <vscale x 4 x i1> [[COND:%.*]], <vscale x 4 x float> [[B:%.*]], <vscale x 4 x float> zeroinitializer
+; CHECK-NEXT: [[D:%.*]] = fsub <vscale x 4 x float> [[A:%.*]], [[C]]
+; CHECK-NEXT: ret <vscale x 4 x float> [[D]]
+;
+ %C = fsub <vscale x 4 x float> %A, %B
+ %D = select nsz <vscale x 4 x i1> %cond, <vscale x 4 x float> %C, <vscale x 4 x float> %A
+ ret <vscale x 4 x float> %D
+}
+
; 'fsub' can only fold on the amount subtracted.
define float @select_fsub_invalid(i1 %cond, float %A, float %B) {
; CHECK-LABEL: @select_fsub_invalid(
More information about the llvm-commits
mailing list