diff options
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/fmul.ll | 11 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/fast-math.ll | 15 |
2 files changed, 15 insertions, 11 deletions
diff --git a/llvm/test/Transforms/InstCombine/fmul.ll b/llvm/test/Transforms/InstCombine/fmul.ll index 1c05475ba07..2eaa7c3e761 100644 --- a/llvm/test/Transforms/InstCombine/fmul.ll +++ b/llvm/test/Transforms/InstCombine/fmul.ll @@ -172,19 +172,8 @@ define float @test11(float %x, float %y) { ret float %c } -; PR21126: http://llvm.org/bugs/show_bug.cgi?id=21126 -; With unsafe/fast math, sqrt(X) * sqrt(X) is just X. declare double @llvm.sqrt.f64(double) -define double @sqrt_squared1(double %f) { -; CHECK-LABEL: @sqrt_squared1( -; CHECK-NEXT: ret double [[F:%.*]] -; - %sqrt = call double @llvm.sqrt.f64(double %f) - %mul = fmul fast double %sqrt, %sqrt - ret double %mul -} - ; With unsafe/fast math, sqrt(X) * sqrt(X) is just X, ; but make sure another use of the sqrt is intact. ; Note that the remaining fmul is altered but is not 'fast' diff --git a/llvm/test/Transforms/InstSimplify/fast-math.ll b/llvm/test/Transforms/InstSimplify/fast-math.ll index f4f31236e5c..dbf17a2fcee 100644 --- a/llvm/test/Transforms/InstSimplify/fast-math.ll +++ b/llvm/test/Transforms/InstSimplify/fast-math.ll @@ -203,3 +203,18 @@ define float @fdiv_neg_swapped2(float %f) { %div = fdiv nnan float %f, %neg ret float %div } + +; PR21126: http://llvm.org/bugs/show_bug.cgi?id=21126 +; With unsafe/fast math, sqrt(X) * sqrt(X) is just X. + +declare double @llvm.sqrt.f64(double) + +define double @sqrt_squared(double %f) { +; CHECK-LABEL: @sqrt_squared( +; CHECK-NEXT: ret double [[F:%.*]] +; + %sqrt = call double @llvm.sqrt.f64(double %f) + %mul = fmul fast double %sqrt, %sqrt + ret double %mul +} + |

