Skip to content

Commit 15dfd9c

Browse files
committed
[Xtensa] Implement pattern ordering for load from ConstnatPool.
1 parent b516d58 commit 15dfd9c

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

llvm/lib/Target/Xtensa/XtensaISelDAGToDAG.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ class XtensaDAGToDAGISel : public SelectionDAGISel {
5050
int Scale) {
5151
EVT ValTy = Addr.getValueType();
5252

53-
if (Addr.getOpcode() == XtensaISD::PCREL_WRAPPER) {
54-
Base = Addr.getOperand(0);
55-
if (Base.getOpcode() == ISD::TargetConstantPool)
56-
return false; // We want to select L32R instead.
57-
}
58-
5953
// if Address is FI, get the TargetFrameIndex.
6054
if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
6155
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), ValTy);

llvm/lib/Target/Xtensa/XtensaInstrInfo.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def S8I : Store_II8<0x04, "s8i", truncstorei8, addr_ish1, mem8>;
234234
def S16I : Store_II8<0x05, "s16i", truncstorei16, addr_ish2, mem16>;
235235
def S32I : Store_II8<0x06, "s32i", store, addr_ish4, mem32>;
236236

237+
let AddedComplexity = 10 in
237238
def L32R : RI16_Inst<0x01, (outs AR:$t), (ins L32Rtarget:$label),
238239
"l32r\t$t, $label", [(set AR:$t, (load (Xtensa_pcrel_wrapper tconstpool:$label)))]> {
239240
bits<16> label;
@@ -1318,6 +1319,7 @@ def WFR : RRR_Inst<0x00, 0x0A, 0x0f, (outs FPR:$r), (ins AR:$s),
13181319
let t = 0x05;
13191320
}
13201321

1322+
let AddedComplexity = 10 in
13211323
def : Pat<(f32 (load (Xtensa_pcrel_wrapper tconstpool:$in))),
13221324
(WFR (L32R tconstpool:$in))>;
13231325

0 commit comments

Comments
 (0)