[llvm] 5013a78 - [InstCombine] adjust tests for pow(); NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 05:42:59 PDT 2020


Author: Sanjay Patel
Date: 2020-05-01T08:42:51-04:00
New Revision: 5013a788f8e1ed076509b3bafb0737fbcc68230b

URL: https://github.com/llvm/llvm-project/commit/5013a788f8e1ed076509b3bafb0737fbcc68230b
DIFF: https://github.com/llvm/llvm-project/commit/5013a788f8e1ed076509b3bafb0737fbcc68230b.diff

LOG: [InstCombine] adjust tests for pow(); NFC

D68231 would change this, but the existing test
doesn't cover what was probably intended (a libcall test).

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/pow-3.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/pow-3.ll b/llvm/test/Transforms/InstCombine/pow-3.ll
index d0edd4658751..4da026bc3545 100644
--- a/llvm/test/Transforms/InstCombine/pow-3.ll
+++ b/llvm/test/Transforms/InstCombine/pow-3.ll
@@ -1,13 +1,20 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; Test that the pow() won't get simplified to when it's disabled.
-;
 ; RUN: opt < %s -disable-simplify-libcalls -instcombine -S | FileCheck %s
 
 declare double @llvm.pow.f64(double, double)
 declare double @pow(double, double)
 
-define double @test_simplify_unavailable1(double %x) {
-; CHECK-LABEL: @test_simplify_unavailable1(
+define double @sqrt_libcall(double %x) {
+; CHECK-LABEL: @sqrt_libcall(
+; CHECK-NEXT:    [[RETVAL:%.*]] = call double @pow(double [[X:%.*]], double 5.000000e-01)
+; CHECK-NEXT:    ret double [[RETVAL]]
+;
+  %retval = call double @pow(double %x, double 0.5)
+  ret double %retval
+}
+
+define double @sqrt_intrinsic(double %x) {
+; CHECK-LABEL: @sqrt_intrinsic(
 ; CHECK-NEXT:    [[RETVAL:%.*]] = call double @llvm.pow.f64(double [[X:%.*]], double 5.000000e-01)
 ; CHECK-NEXT:    ret double [[RETVAL]]
 ;
@@ -17,8 +24,8 @@ define double @test_simplify_unavailable1(double %x) {
 
 ; Shrinking is disabled too.
 
-define float @test_simplify_unavailable2(float %f, float %g) {
-; CHECK-LABEL: @test_simplify_unavailable2(
+define float @shrink_libcall(float %f, float %g) {
+; CHECK-LABEL: @shrink_libcall(
 ; CHECK-NEXT:    [[DF:%.*]] = fpext float [[F:%.*]] to double
 ; CHECK-NEXT:    [[DG:%.*]] = fpext float [[G:%.*]] to double
 ; CHECK-NEXT:    [[CALL:%.*]] = call fast double @pow(double [[DF]], double [[DG]])
@@ -34,8 +41,8 @@ define float @test_simplify_unavailable2(float %f, float %g) {
 
 ; Shrinking is disabled for the intrinsic too.
 
-define float @test_simplify_unavailable3(float %f, float %g) {
-; CHECK-LABEL: @test_simplify_unavailable3(
+define float @shrink_intrinsic(float %f, float %g) {
+; CHECK-LABEL: @shrink_intrinsic(
 ; CHECK-NEXT:    [[DF:%.*]] = fpext float [[F:%.*]] to double
 ; CHECK-NEXT:    [[DG:%.*]] = fpext float [[G:%.*]] to double
 ; CHECK-NEXT:    [[CALL:%.*]] = call fast double @llvm.pow.f64(double [[DF]], double [[DG]])


        


More information about the llvm-commits mailing list