[llvm-bugs] [Bug 25342] New: [ppc] floating point var allocated to integer register
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Oct 28 15:12:23 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=25342
Bug ID: 25342
Summary: [ppc] floating point var allocated to integer register
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: PowerPC
Assignee: unassignedbugs at nondot.org
Reporter: carrot at google.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
Created attachment 15183
--> https://llvm.org/bugs/attachment.cgi?id=15183&action=edit
testcase
Compile the attached source code with options
~/llvm/obj/bin/clang++ --target=powerpc64le-grtev4-linux-gnu -O2
-fno-strict-aliasing -m64 -mvsx -mcpu=power8 -ffp-contract=fast
llvm generates following code for the inner loop
lfsu 1, 16(22)
addi 24, 24, -2
cmplwi 6, 24, 0
lfsu 2, 16(23)
lxsspx 4, 22, 5
lxsspx 3, 23, 5
stw 25, -112(1) // A
ori 2, 2, 0
lxsspx 5, 0, 6 // B
stw 26, -108(1) // C
xsmulsp 7, 3, 4
ori 2, 2, 0
lxsspx 6, 0, 7 // D
lxsspx 9, 23, 10
lxsspx 8, 22, 10
lxsspx 11, 23, 8
lxsspx 12, 22, 8
xsmaddasp 6, 2, 4
xsmulsp 10, 9, 8
xsmsubasp 7, 2, 1
xsmaddasp 6, 3, 1
xsmsubasp 10, 11, 12
xsaddsp 5, 5, 7
xsmaddasp 6, 11, 8
xsaddsp 13, 5, 10
xsmaddasp 6, 9, 12
stxsspx 13, 0, 11 // E
ori 2, 2, 0
lwz 25, -100(1) // F
stxsspx 6, 0, 12 // G
ori 2, 2, 0
lwz 26, -104(1) // H
bne 6, .LBB0_9
The variable std::complex<float> sum is allocated to integer registers r25,r26.
Before using it, instructions ABCD move it to floating point registers, after
generating new values, instructions EFGH move it back to integer registers.
GCC allocates sum to floating point registers directly.
On power8, llvm generated code is 4.5x slower than gcc.
--
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/20151028/6972a0b6/attachment.html>
More information about the llvm-bugs
mailing list