From: Sanjay Patel Date: Sun, 10 Dec 2017 16:43:34 +0000 (+0000) Subject: [InstCombine] add test for pow(x, 2.0) with FMF; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8235ce69fba7b378fef26c470987610999a5a463;p=llvm [InstCombine] add test for pow(x, 2.0) with FMF; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320309 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/pow-1.ll b/test/Transforms/InstCombine/pow-1.ll index 6fcb92a7cf0..6c9f39fc0e0 100644 --- a/test/Transforms/InstCombine/pow-1.ll +++ b/test/Transforms/InstCombine/pow-1.ll @@ -124,12 +124,24 @@ define double @test_simplify12(double %x) { ; Check pow(x, 2.0) -> x*x. -define float @test_simplify13(float %x) { -; CHECK-LABEL: @test_simplify13( - %retval = call float @powf(float %x, float 2.0) -; CHECK-NEXT: [[SQUARE:%[a-z0-9]+]] = fmul float %x, %x - ret float %retval -; CHECK-NEXT: ret float [[SQUARE]] +define float @pow2_strict(float %x) { +; CHECK-LABEL: @pow2_strict( +; CHECK-NEXT: [[POW2:%.*]] = fmul float %x, %x +; CHECK-NEXT: ret float [[POW2]] +; + %r = call float @powf(float %x, float 2.0) + ret float %r +} + +; FIXME: Don't drop the FMF - PR35601 ( https://bugs.llvm.org/show_bug.cgi?id=35601 ) + +define float @pow2_fast(float %x) { +; CHECK-LABEL: @pow2_fast( +; CHECK-NEXT: [[POW2:%.*]] = fmul float %x, %x +; CHECK-NEXT: ret float [[POW2]] +; + %r = call fast float @powf(float %x, float 2.0) + ret float %r } define double @test_simplify14(double %x) {