mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-24 05:23:45 +02:00
a5c875d940
Fixes the crasher in PR25651 and related crashers using the same pattern. llvm-svn: 254145
29 lines
770 B
LLVM
29 lines
770 B
LLVM
; RUN: opt < %s -instcombine -S | FileCheck %s
|
|
|
|
define double @mypow(double %x, double %y) #0 {
|
|
entry:
|
|
%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: %mul = fmul fast double %x, %y
|
|
; CHECK: %exp = call double @exp(double %mul) #0
|
|
; CHECK: ret double %exp
|
|
; CHECK: }
|
|
|
|
define double @test2(double ()* %fptr, double %p1) #0 {
|
|
%call1 = call double %fptr()
|
|
%pow = call double @llvm.pow.f64(double %call1, double %p1)
|
|
ret double %pow
|
|
}
|
|
|
|
; CHECK-LABEL: @test2
|
|
; CHECK: llvm.pow.f64
|
|
|
|
declare double @exp(double) #1
|
|
declare double @llvm.pow.f64(double, double)
|
|
attributes #0 = { "unsafe-fp-math"="true" }
|
|
attributes #1 = { "unsafe-fp-math"="true" }
|