[PATCH] D78999: [SelectionDAGBuilder] Stop setting alignment to one for hidden sret values
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 28 15:40:44 PDT 2020
efriedma added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:1836
SmallVector<SDValue, 4> Chains(NumValues);
+ unsigned BaseAlign = DL.getABITypeAlignment(I.getOperand(0)->getType());
for (unsigned i = 0; i != NumValues; ++i) {
----------------
The alignment of the stack slot is computed using `Align Alignment = DL.getPrefTypeAlign(CLI.RetTy);`, Is there some reason to do something different here?
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:9287
DemoteStackIdx, Offsets[i]),
- /* Alignment = */ 1);
+ /* Alignment = */ MinAlign(HiddenSRetAlign.value(), Offsets[i]));
ReturnValues[i] = L;
----------------
You don't need to use min() here. The "alignment" argument of getLoad is actually the alignment of the object referred to by the MachinePointerInfo, excluding the offset.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78999/new/
https://reviews.llvm.org/D78999
More information about the llvm-commits
mailing list