Before this patch we would normally use the ABI alignment which can be
to high for the context alginment.
For spilled values we don't need ABI alignment, since the frame entry's
address is not escaped.
rdar://79664965
Paths
| Differential D105288
[coro async] Cap the alignment of spilled values (vs. allocas) at the max frame alignment ClosedPublic Authored by aschwaighofer on Jul 1 2021, 7:55 AM.
Details Summary Before this patch we would normally use the ABI alignment which can be For spilled values we don't need ABI alignment, since the frame entry's rdar://79664965
Diff Detail
Event TimelineComment Actions Shouldn't there be a test case showing that a spilled value with high ABI alignment is placed in an appropriately-underaligned slot, and that the loads and stores to that slot have the necessary alignment? Because the alignment in this test is just coming from the alloca's explicit alignment. Comment Actions The spilled value from this test comes from trying to spill %vector_spill which is a value life across a suspend point. Because it has a value it has no alignment. It is misleading that we load the value from an alloca. It could also be the result of a computation. This test case crashes before the patch because we are assigning the abi alignment for the value '%vector_spill`. Comment Actions Oh my. You are right I should have verified that when we spill that value though we use the right alignment. Because we don't. :(. %vector_spill = load <4 x double>, <4 x double>* %vector, align 16 %vector_spill.spill.addr = getelementptr inbounds %my_async_function.Frame, %my_async_function.Frame* %FramePtr, i32 0, i32 1, !dbg !6 store <4 x double> %vector_spill, <4 x double>* %vector_spill.spill.addr, align 32, !dbg !6 The code that spills/reloads does not use the alignment we have computed for the spill slot. Builder.CreateStore(Def, G); Comment Actions Minor style request, but otherwise LGTM
Closed by commit rG2937f8d14840: [coro async] Cap the alignment of spilled values (vs. allocas) at the max… (authored by aschwaighofer). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 355883 llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/test/Transforms/Coroutines/coro-async.ll
|
I would assume from the name that this is something like the alignment of the type. Maybe SpillAlignment?