[llvm] r359143 - [X86] Attempt to fix use-after-poison from r359121.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 24 14:48:24 PDT 2019
Author: ctopper
Date: Wed Apr 24 14:48:24 2019
New Revision: 359143
URL: http://llvm.org/viewvc/llvm-project?rev=359143&view=rev
Log:
[X86] Attempt to fix use-after-poison from r359121.
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=359143&r1=359142&r2=359143&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Apr 24 14:48:24 2019
@@ -2066,10 +2066,13 @@ bool X86DAGToDAGISel::selectAddr(SDNode
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
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;
}
More information about the llvm-commits
mailing list