Skip to content

Commit 49722f1

Browse files
topperctru
authored andcommitted
[RISCV] Remove incorrect and untested FrameIndex support from SelectAddrRegImm9. (#148779)
To fold a FrameIndex, we need to teach eliminateFrameIndex to respect the uimm9 range. (cherry picked from commit 63d099a)
1 parent a0895b4 commit 49722f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,8 +2936,8 @@ bool RISCVDAGToDAGISel::SelectAddrRegImm(SDValue Addr, SDValue &Base,
29362936
/// Similar to SelectAddrRegImm, except that the offset is restricted to uimm9.
29372937
bool RISCVDAGToDAGISel::SelectAddrRegImm9(SDValue Addr, SDValue &Base,
29382938
SDValue &Offset) {
2939-
if (SelectAddrFrameIndex(Addr, Base, Offset))
2940-
return true;
2939+
// FIXME: Support FrameIndex. Need to teach eliminateFrameIndex that only
2940+
// a 9-bit immediate can be folded.
29412941

29422942
SDLoc DL(Addr);
29432943
MVT VT = Addr.getSimpleValueType();
@@ -2947,8 +2947,8 @@ bool RISCVDAGToDAGISel::SelectAddrRegImm9(SDValue Addr, SDValue &Base,
29472947
if (isUInt<9>(CVal)) {
29482948
Base = Addr.getOperand(0);
29492949

2950-
if (auto *FIN = dyn_cast<FrameIndexSDNode>(Base))
2951-
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), VT);
2950+
// FIXME: Support FrameIndex. Need to teach eliminateFrameIndex that only
2951+
// a 9-bit immediate can be folded.
29522952
Offset = CurDAG->getSignedTargetConstant(CVal, DL, VT);
29532953
return true;
29542954
}

0 commit comments

Comments
 (0)