[PATCH] D88872: [Coroutines] Refactor/Rewrite Spill and Alloca processing
Xun Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 9 08:32:40 PDT 2020
lxfind added a comment.
In D88872#2320823 <https://reviews.llvm.org/D88872#2320823>, @ChuanqiXu wrote:
> Thanks for your patch! It mentions some bugs about allocas we need to handle in the future.
>
> For this patch, I'm little confusing about why we need to separate alloca from spills. In my mind, a `spill` means something we need to put in the frame. And an alloca which would be in the frame is naturally a spill.
> I think the patch benefits from replacing
>
> using SpillInfo = SmallVector<Spill, 8>;
>
> to
>
> using SpillInfo = SmallMapVector<Value *, SmallVector<Instruction *, 2>, 8>;
Thanks for taking a look at the patch. If you look at the implementation, the handling of "Spills" and always different from the handling of allocas. They do share the same concept that they need to go to the frame (which is why they both belong to FrameDataInfo).
The primary reason to separate them (and hence set up the code for future fixes), is this one primary difference between them: A Spill is a direct def-use relationship that crosses suspension points; while an alloca may not be exposed to a direct def-use relationship that crosses suspension points but still need to go to the frame. The condition for them to go to the frame is fundamentally different.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88872/new/
https://reviews.llvm.org/D88872
More information about the llvm-commits
mailing list