mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-13 08:56:04 +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);
|
return SDOperand(N, 0);
|
||||||
case ISD::FrameIndex: {
|
case ISD::FrameIndex: {
|
||||||
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
int FI = cast<FrameIndexSDNode>(N)->getIndex();
|
||||||
CurDAG->SelectNodeTo(N, PPC::ADDI, MVT::i32,
|
if (N->hasOneUse()) {
|
||||||
CurDAG->getTargetFrameIndex(FI, MVT::i32),
|
CurDAG->SelectNodeTo(N, PPC::ADDI, MVT::i32,
|
||||||
getI32Imm(0));
|
CurDAG->getTargetFrameIndex(FI, MVT::i32),
|
||||||
return SDOperand(N, 0);
|
getI32Imm(0));
|
||||||
|
return SDOperand(N, 0);
|
||||||
|
}
|
||||||
|
return CurDAG->getTargetNode(PPC::ADDI, MVT::i32,
|
||||||
|
CurDAG->getTargetFrameIndex(FI, MVT::i32),
|
||||||
|
getI32Imm(0));
|
||||||
}
|
}
|
||||||
case ISD::ConstantPool: {
|
case ISD::ConstantPool: {
|
||||||
Constant *C = cast<ConstantPoolSDNode>(N)->get();
|
Constant *C = cast<ConstantPoolSDNode>(N)->get();
|
||||||
@ -914,10 +919,9 @@ SDOperand PPCDAGToDAGISel::Select(SDOperand Op) {
|
|||||||
Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, GA);
|
Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, GA);
|
||||||
|
|
||||||
if (GV->hasWeakLinkage() || GV->isExternal())
|
if (GV->hasWeakLinkage() || GV->isExternal())
|
||||||
CurDAG->SelectNodeTo(N, PPC::LWZ, MVT::i32, GA, Tmp);
|
return CurDAG->getTargetNode(PPC::LWZ, MVT::i32, GA, Tmp);
|
||||||
else
|
else
|
||||||
CurDAG->SelectNodeTo(N, PPC::LA, MVT::i32, Tmp, GA);
|
return CurDAG->getTargetNode(PPC::LA, MVT::i32, Tmp, GA);
|
||||||
return SDOperand(N, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case PPCISD::FSEL: {
|
case PPCISD::FSEL: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user