[llvm] 3cc3870 - [NVPTX] Tweak fast-math tests to avoid select(binop(x,y),binop(x,z)) fold
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 15 07:47:21 PDT 2021
Author: Simon Pilgrim
Date: 2021-07-15T15:42:25+01:00
New Revision: 3cc38703d5ab05be0b01c31f829d19b47f183c5f
URL: https://github.com/llvm/llvm-project/commit/3cc38703d5ab05be0b01c31f829d19b47f183c5f
DIFF: https://github.com/llvm/llvm-project/commit/3cc38703d5ab05be0b01c31f829d19b47f183c5f.diff
LOG: [NVPTX] Tweak fast-math tests to avoid select(binop(x,y),binop(x,z)) fold
As suggested on D106058, tweak the tests to keep the combineRepeatedFPDivisors test coverage.
Added:
Modified:
llvm/test/CodeGen/NVPTX/fast-math.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/NVPTX/fast-math.ll b/llvm/test/CodeGen/NVPTX/fast-math.ll
index 49f8c142f923..8315aa03811d 100644
--- a/llvm/test/CodeGen/NVPTX/fast-math.ll
+++ b/llvm/test/CodeGen/NVPTX/fast-math.ll
@@ -149,11 +149,13 @@ define float @repeated_div_recip_allowed(i1 %pred, float %a, float %b, float %di
; CHECK: rcp.rn.f32
; CHECK: mul.rn.f32
; CHECK: mul.rn.f32
+; CHECK: mul.rn.f32
; CHECK: selp.f32
%x = fdiv arcp float %a, %divisor
%y = fdiv arcp float %b, %divisor
- %z = select i1 %pred, float %x, float %y
- ret float %z
+ %z = fmul float %x, %y
+ %w = select i1 %pred, float %z, float %y
+ ret float %w
}
; CHECK-LABEL: repeated_div_recip_allowed_ftz
@@ -161,11 +163,13 @@ define float @repeated_div_recip_allowed_ftz(i1 %pred, float %a, float %b, float
; CHECK: rcp.rn.ftz.f32
; CHECK: mul.rn.ftz.f32
; CHECK: mul.rn.ftz.f32
+; CHECK: mul.rn.ftz.f32
; CHECK: selp.f32
%x = fdiv arcp float %a, %divisor
%y = fdiv arcp float %b, %divisor
- %z = select i1 %pred, float %x, float %y
- ret float %z
+ %z = fmul float %x, %y
+ %w = select i1 %pred, float %z, float %y
+ ret float %w
}
; CHECK-LABEL: repeated_div_fast
@@ -173,11 +177,13 @@ define float @repeated_div_fast(i1 %pred, float %a, float %b, float %divisor) #0
; CHECK: rcp.approx.f32
; CHECK: mul.f32
; CHECK: mul.f32
+; CHECK: mul.f32
; CHECK: selp.f32
%x = fdiv float %a, %divisor
%y = fdiv float %b, %divisor
- %z = select i1 %pred, float %x, float %y
- ret float %z
+ %z = fmul float %x, %y
+ %w = select i1 %pred, float %z, float %y
+ ret float %w
}
; CHECK-LABEL: repeated_div_fast_ftz
@@ -185,11 +191,13 @@ define float @repeated_div_fast_ftz(i1 %pred, float %a, float %b, float %divisor
; CHECK: rcp.approx.ftz.f32
; CHECK: mul.ftz.f32
; CHECK: mul.ftz.f32
+; CHECK: mul.ftz.f32
; CHECK: selp.f32
%x = fdiv float %a, %divisor
%y = fdiv float %b, %divisor
- %z = select i1 %pred, float %x, float %y
- ret float %z
+ %z = fmul float %x, %y
+ %w = select i1 %pred, float %z, float %y
+ ret float %w
}
attributes #0 = { "unsafe-fp-math" = "true" }
More information about the llvm-commits
mailing list