summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-08-02 20:17:37 +0000
committerPhilip Reames <listmail@philipreames.com>2019-08-02 20:17:37 +0000
commit511be2a158907c99ee3309e43e3d2a1031c83701 (patch)
treefe31fa26fbe477b338924df3809bb51f1d8c4485 /llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
parent196931a7dd0ae09a8cec7261d59dba28b23a4e3c (diff)
downloadbcm5719-llvm-511be2a158907c99ee3309e43e3d2a1031c83701.tar.gz
bcm5719-llvm-511be2a158907c99ee3309e43e3d2a1031c83701.zip
[Statepoints] Fix overalignment of loads in no-realign-stack functions
This really should have been part of 366765. For some reason, I forgot to handle the corresponding load side, and the readable test cases (using deopt vs statepoints) turned out to be overly reduced. Oops. As seen in the test change, the problem was that we were using a load with alignment expectations rather than the unaligned variant when the stack alignment was less than that prefered type alignment. llvm-svn: 367718
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index beacabe0c20..fad98b6f50d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -1016,20 +1016,27 @@ void SelectionDAGBuilder::visitGCRelocate(const GCRelocateInst &Relocate) {
return;
}
- SDValue SpillSlot =
- DAG.getTargetFrameIndex(*DerivedPtrLocation, getFrameIndexTy());
+ unsigned Index = *DerivedPtrLocation;
+ SDValue SpillSlot = DAG.getTargetFrameIndex(Index, getFrameIndexTy());
// Note: We know all of these reloads are independent, but don't bother to
// exploit that chain wise. DAGCombine will happily do so as needed, so
// doing it here would be a small compile time win at most.
SDValue Chain = getRoot();
- SDValue SpillLoad =
- DAG.getLoad(DAG.getTargetLoweringInfo().getValueType(DAG.getDataLayout(),
- Relocate.getType()),
- getCurSDLoc(), Chain, SpillSlot,
- MachinePointerInfo::getFixedStack(DAG.getMachineFunction(),
- *DerivedPtrLocation));
+ auto &MF = DAG.getMachineFunction();
+ auto &MFI = MF.getFrameInfo();
+ auto PtrInfo = MachinePointerInfo::getFixedStack(MF, Index);
+ auto *LoadMMO =
+ MF.getMachineMemOperand(PtrInfo, MachineMemOperand::MOLoad,
+ MFI.getObjectSize(Index),
+ MFI.getObjectAlignment(Index));
+
+ auto LoadVT = DAG.getTargetLoweringInfo().getValueType(DAG.getDataLayout(),
+ Relocate.getType());
+
+ SDValue SpillLoad = DAG.getLoad(LoadVT, getCurSDLoc(), Chain,
+ SpillSlot, LoadMMO);
DAG.setRoot(SpillLoad.getValue(1));
OpenPOWER on IntegriCloud