https://bugs.llvm.org/show_bug.cgi?id=47613
Bug ID: 47613
Summary: InstCombine leaves extra call to sqrtf from pow
transform
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Transformation Utilities
Assignee: unassignedb...@nondot.org
Reporter: hst...@ca.ibm.com
CC: llvm-bugs@lists.llvm.org, spatel+l...@rotateright.com
As noted in the review of D88066, there is an extra `sqrtf` call formed from
the call to `pow` in `shrink_pow_libcall_half` (below, extracted from
`llvm/test/Transforms/InstCombine/pow-4.ll`).
### SOURCE (<stdin>):
declare double @pow(double, double)
define float @shrink_pow_libcall_half(float %x) {
%dx = fpext float %x to double
%call = call fast double @pow(double %dx, double 0.5)
%fr = fptrunc double %call to float
ret float %fr
}
### LLVM INVOCATION:
opt -instcombine -S
### ACTUAL OUTPUT:
; ModuleID = '<stdin>'
source_filename = "<stdin>"
declare double @pow(double, double)
define float @shrink_pow_libcall_half(float %x) {
%sqrtf = call fast float @sqrtf(float %x)
%sqrtf1 = call fast float @sqrtf(float %x)
ret float %sqrtf1
}
declare float @powf(float, float)
declare double @sqrt(double)
declare float @sqrtf(float)
### EXPECTED OUTPUT:
(only one call to `sqrtf`)
### LLVM VERSION INFO (opt --version):
LLVM (http://llvm.org/):
LLVM version 12.0.0git
Optimized build.
Default target: x86_64-unknown-linux-gnu
Host CPU: sandybridge
### LLVM VERSION INFO:
https://github.com/llvm/llvm-project.git
a8b8a9374a3c555ac8528fc37b92935554083b9f
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs