[llvm-bugs] [Bug 32550] New: GlobalISel -O0 for AArch64 moves floating point values through GPRs way too often
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Apr 6 04:13:04 PDT 2017
http://bugs.llvm.org/show_bug.cgi?id=32550
Bug ID: 32550
Summary: GlobalISel -O0 for AArch64 moves floating point values
through GPRs way too often
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: GlobalISel
Assignee: unassignedbugs at nondot.org
Reporter: kristof.beyls at gmail.com
CC: llvm-bugs at lists.llvm.org
Investigating the biggest performance and code size regressions I reported in
http://lists.llvm.org/pipermail/llvm-dev/2017-April/111713.html, it seems like
most boil down to floating point values being moved through general purpose
registers.
A very simple example is:
$ cat t3.c
double f(double r) {
return r*r;
}
$ clang -target aarch64 -O0 -o - -S t3.c
...
f: // @f
// BB#0: // %entry
sub sp, sp, #16 // =16
str d0, [sp, #8]
ldr d0, [sp, #8]
ldr d1, [sp, #8]
fmul d0, d0, d1
add sp, sp, #16 // =16
ret
...
$ clang -target aarch64 -mllvm -global-isel -O0 -o - -S t3.c
...
f: // @f
// BB#0: // %entry
sub sp, sp, #16 // =16
fmov x8, d0
str x8, [sp, #8]
ldr x8, [sp, #8]
ldr x9, [sp, #8]
fmov d0, x8
fmov d1, x9
fmul d0, d0, d1
add sp, sp, #16 // =16
ret
...
It might be that this happens "just" every time a floating point variable is
loaded/stored to the stack, or it may happen more generally.
I think this needs to be fixed first to get rid of the source of the most
severe performance and code size regressions when enabling global-isel at -O0.
After this is fixed, another round of investigation can be done to find the
remaining biggest code size and performance regressions.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170406/70e9781f/attachment.html>
More information about the llvm-bugs
mailing list