parent
b55705f6e9
commit
c8e3943e89
|
@ -1,3 +1,4 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; Test that the pow library call simplifier works correctly.
|
||||
;
|
||||
; RUN: opt < %s -instcombine -S | FileCheck %s
|
||||
|
@ -8,7 +9,10 @@ declare float @pow(double, double)
|
|||
|
||||
define float @test_no_simplify1(double %x) {
|
||||
; CHECK-LABEL: @test_no_simplify1(
|
||||
; CHECK-NEXT: [[RETVAL:%.*]] = call float @pow(double 1.000000e+00, double [[X:%.*]])
|
||||
; CHECK-NEXT: ret float [[RETVAL]]
|
||||
;
|
||||
%retval = call float @pow(double 1.0, double %x)
|
||||
; CHECK-NEXT: call float @pow(double 1.000000e+00, double %x)
|
||||
ret float %retval
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -instcombine -S | FileCheck %s
|
||||
|
||||
define double @mypow(double %x, double %y) #0 {
|
||||
entry:
|
||||
define double @mypow(double %x, double %y) {
|
||||
; CHECK-LABEL: @mypow(
|
||||
; CHECK-NEXT: [[CALL:%.*]] = call double @exp(double [[X:%.*]])
|
||||
; CHECK-NEXT: [[POW:%.*]] = call double @llvm.pow.f64(double [[CALL]], double [[Y:%.*]])
|
||||
; CHECK-NEXT: ret double [[POW]]
|
||||
;
|
||||
%call = call double @exp(double %x)
|
||||
%pow = call double @llvm.pow.f64(double %call, double %y)
|
||||
ret double %pow
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define double @mypow(
|
||||
; CHECK: %call = call double @exp(double %x)
|
||||
; CHECK: %pow = call double @llvm.pow.f64(double %call, double %y)
|
||||
; CHECK: ret double %pow
|
||||
; CHECK: }
|
||||
|
||||
declare double @exp(double) #1
|
||||
declare double @llvm.pow.f64(double, double)
|
||||
|
|
Loading…
Reference in New Issue