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