mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-09 01:38:03 +00:00
Be a bit more paranoid about calling SelectNodeTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23982 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3393e80a06
commit
99ea9da872
@ -886,10 +886,15 @@ SDOperand PPCDAGToDAGISel::Select(SDOperand Op) {
|
||||
return SDOperand(N, 0);
|
||||
case ISD::FrameIndex: {
|
||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||
CurDAG->SelectNodeTo(N, PPC::ADDI, MVT::i32,
|
||||
CurDAG->getTargetFrameIndex(FI, MVT::i32),
|
||||
getI32Imm(0));
|
||||
return SDOperand(N, 0);
|
||||
if (N->hasOneUse()) {
|
||||
CurDAG->SelectNodeTo(N, PPC::ADDI, MVT::i32,
|
||||
CurDAG->getTargetFrameIndex(FI, MVT::i32),
|
||||
getI32Imm(0));
|
||||
return SDOperand(N, 0);
|
||||
}
|
||||
return CurDAG->getTargetNode(PPC::ADDI, MVT::i32,
|
||||
CurDAG->getTargetFrameIndex(FI, MVT::i32),
|
||||
getI32Imm(0));
|
||||
}
|
||||
case ISD::ConstantPool: {
|
||||
Constant *C = cast<ConstantPoolSDNode>(N)->get();
|
||||
@ -914,10 +919,9 @@ SDOperand PPCDAGToDAGISel::Select(SDOperand Op) {
|
||||
Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, GA);
|
||||
|
||||
if (GV->hasWeakLinkage() || GV->isExternal())
|
||||
CurDAG->SelectNodeTo(N, PPC::LWZ, MVT::i32, GA, Tmp);
|
||||
return CurDAG->getTargetNode(PPC::LWZ, MVT::i32, GA, Tmp);
|
||||
else
|
||||
CurDAG->SelectNodeTo(N, PPC::LA, MVT::i32, Tmp, GA);
|
||||
return SDOperand(N, 0);
|
||||
return CurDAG->getTargetNode(PPC::LA, MVT::i32, Tmp, GA);
|
||||
}
|
||||
|
||||
case PPCISD::FSEL: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user