forked from OSchip/llvm-project
[X86] Attempt to fix use-after-poison from r359121.
llvm-svn: 359143
This commit is contained in:
parent
28413dd87a
commit
6932abee2c
|
@ -2066,10 +2066,13 @@ bool X86DAGToDAGISel::selectAddr(SDNode *Parent, SDValue N, SDValue &Base,
|
|||
AM.Segment = CurDAG->getRegister(X86::SS, MVT::i16);
|
||||
}
|
||||
|
||||
// Save the DL and VT before calling matchAddress, it can invalidate N.
|
||||
SDLoc DL(N);
|
||||
MVT VT = N.getSimpleValueType();
|
||||
|
||||
if (matchAddress(N, AM))
|
||||
return false;
|
||||
|
||||
MVT VT = N.getSimpleValueType();
|
||||
if (AM.BaseType == X86ISelAddressMode::RegBase) {
|
||||
if (!AM.Base_Reg.getNode())
|
||||
AM.Base_Reg = CurDAG->getRegister(0, VT);
|
||||
|
@ -2078,7 +2081,7 @@ bool X86DAGToDAGISel::selectAddr(SDNode *Parent, SDValue N, SDValue &Base,
|
|||
if (!AM.IndexReg.getNode())
|
||||
AM.IndexReg = CurDAG->getRegister(0, VT);
|
||||
|
||||
getAddressOperands(AM, SDLoc(N), Base, Scale, Index, Disp, Segment);
|
||||
getAddressOperands(AM, DL, Base, Scale, Index, Disp, Segment);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue