mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
Use the correct types when matching ADDRri patterns from frame indexes.
It doesn't seem like anybody is checking types this late in isel, so no test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179462 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9cbee63b1a
commit
41b585ca0e
@ -73,7 +73,7 @@ SDNode* SparcDAGToDAGISel::getGlobalBaseReg() {
|
|||||||
bool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
|
bool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
|
||||||
SDValue &Base, SDValue &Offset) {
|
SDValue &Base, SDValue &Offset) {
|
||||||
if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
|
if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
|
||||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
|
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), TLI.getPointerTy());
|
||||||
Offset = CurDAG->getTargetConstant(0, MVT::i32);
|
Offset = CurDAG->getTargetConstant(0, MVT::i32);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -87,7 +87,8 @@ bool SparcDAGToDAGISel::SelectADDRri(SDValue Addr,
|
|||||||
if (FrameIndexSDNode *FIN =
|
if (FrameIndexSDNode *FIN =
|
||||||
dyn_cast<FrameIndexSDNode>(Addr.getOperand(0))) {
|
dyn_cast<FrameIndexSDNode>(Addr.getOperand(0))) {
|
||||||
// Constant offset from frame ref.
|
// Constant offset from frame ref.
|
||||||
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
|
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(),
|
||||||
|
TLI.getPointerTy());
|
||||||
} else {
|
} else {
|
||||||
Base = Addr.getOperand(0);
|
Base = Addr.getOperand(0);
|
||||||
}
|
}
|
||||||
@ -130,7 +131,7 @@ bool SparcDAGToDAGISel::SelectADDRrr(SDValue Addr, SDValue &R1, SDValue &R2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
R1 = Addr;
|
R1 = Addr;
|
||||||
R2 = CurDAG->getRegister(SP::G0, MVT::i32);
|
R2 = CurDAG->getRegister(SP::G0, TLI.getPointerTy());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user