Skip to content

Commit a47b379

Browse files
committed
DAG: Set MachinePointerInfo for stack when expanding divrem libcall
1 parent 0006cd6 commit a47b379

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,8 +2407,11 @@ SelectionDAGLegalize::ExpandDivRemLibCall(SDNode *Node,
24072407
std::pair<SDValue, SDValue> CallInfo = TLI.LowerCallTo(CLI);
24082408

24092409
// Remainder is loaded back from the stack frame.
2410-
SDValue Rem =
2411-
DAG.getLoad(RetVT, dl, CallInfo.second, FIPtr, MachinePointerInfo());
2410+
int FI = cast<FrameIndexSDNode>(FIPtr)->getIndex();
2411+
MachinePointerInfo PtrInfo =
2412+
MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI);
2413+
2414+
SDValue Rem = DAG.getLoad(RetVT, dl, CallInfo.second, FIPtr, PtrInfo);
24122415
Results.push_back(CallInfo.first);
24132416
Results.push_back(Rem);
24142417
}

0 commit comments

Comments
 (0)