This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Remove the match pattern in the definition of LXSDX/STXSDX
ClosedPublic

Authored by steven.zhang on May 21 2018, 10:13 PM.

Details

Summary

The match pattern in the definition of LXSDX is xoaddr, which make the Pseudo instruction XFLOADf64 never selected. And XFLOADf64 will be expanded to LXSDX/LFDX post RA basing on the register pressure. To avoid the ambiguous, we need to remove the select pattern for LXSDX, just the same as what we did for LXSD. The same issue also happen for STXSDX.

This is the example to show this change:

cat a.ll
define double @_Z3foov() {
ret double 4.220000e+00
}
llc a.ll -mcpu=pwr8
cat a.s
_Z3foov: # @_Z3foov
.Lfunc_begin0:
.cfi_startproc
.Lfunc_gep0:
addis 2, 12, .TOC.-.Lfunc_gep0@ha
addi 2, 2, .TOC.-.Lfunc_gep0@l
.Lfunc_lep0:
.localentry _Z3foov, .Lfunc_lep0-.Lfunc_gep0
; %bb.0:
addis 3, 2, .LCPI0_0@toc@ha
addi 3, 3, .LCPI0_0@toc@l
lxsdx 1, 0, 3 <----- LXSDX is selected in instruction selection phase.
blr
The right process should be, XFLOADf64--> LXSDX/LFDX --> LFDX

Diff Detail

Repository
rL LLVM

Event Timeline

steven.zhang created this revision.May 21 2018, 10:13 PM
steven.zhang edited the summary of this revision. (Show Details)May 22 2018, 12:12 AM
hfinkel accepted this revision.May 22 2018, 6:59 AM

LGTM

This revision is now accepted and ready to land.May 22 2018, 6:59 AM

I need someone to commit the change for me as I didn't have the permission to commit the code. Thank you.

lei added a subscriber: lei.May 23 2018, 8:02 PM

I will commit the change for you.

This revision was automatically updated to reflect the committed changes.