[llvm-bugs] [Bug 31478] New: No optimization of 'round' when arguments are known constants.
llvm-bugs at lists.llvm.org
Tue Dec 27 03:35:36 PST 2016
Bug ID: 31478
Summary: No optimization of 'round' when arguments are known
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: brunojimen at gmail.com
CC: llvm-bugs at lists.llvm.org
When checking the assembly output of a program I discovered that calls to
'round' wouldn't get optimized away when the argument is a known constant.
For example, with this little test case (the printf is there so the compiler
wouldn't just remove the call to round)
int main(int argc, char *argv)
using `clang -O2 -S` I get that there's a call to round in the assembly, while
`gcc -O2 -S` can remove the call to round.
More interesting is the case with '1.' instead of '0.9', in which the assembly
shows '1.' as float, a call to roundf and a conversion from float to double.
This may be a duplicate of https://llvm.org/bugs/show_bug.cgi?id=22944 but that
is about simplifying the calls, while this is about constant propagation.
Thanks in advance!
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs