[PATCH] D77292: [Alignment][NFC] Convert MachineIRBuilder::buildDynStackAlloc to Align
Clement Courbet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 04:18:42 PDT 2020
courbet added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:1889
+ Align Alignment = max(AI.getAlign(), DL->getPrefTypeAlign(Ty));
+ MaybeAlign DynStackAllocAlign = Alignment;
+ if (Alignment <= StackAlign)
----------------
I think using a ternary would be more readable.
================
Comment at: llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:1895
- MF->getFrameInfo().CreateVariableSizedObject(Align ? Align : 1, &AI);
+ MF->getFrameInfo().CreateVariableSizedObject(Alignment, &AI);
assert(MF->getFrameInfo().hasVarSizedObjects());
----------------
I'd like to get a knowledgeable pair of eye to look at this. We used to align anything smaller than the stack size to 1, now we align to max(AI.align, preftypealign). This sounds OK, but let's be on the safe side.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77292/new/
https://reviews.llvm.org/D77292
More information about the llvm-commits
mailing list