[PATCH] D37093: [coroutines] Promote cleanup.dest.slot-like allocas to registers to avoid storing them in the coroutine frame

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 10:55:18 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D37093#860506, @GorNishanov wrote:

> > I still don't see what checking that the type is an integer or the value is a constant buys you. Why can't you look for allocas that are used after the call to llvm.coro.free? Isn't that the relevant factor?
>
> The problem this patch is fixing only occurs in -O0, at any other optimization levels, mem2reg pass during SROA eliminates all of the cleanup related allocas (and more).
>  I do not want to promote all promotable allocas, I only would like to target cleanup allocas (flags and dest.slot),


Why? It sounds like you're trying to optimize some aspect of the -O0 lowering.

> so I am looking for a pattern used in those, namely, those are integer allocas that have only constants stored in them.




https://reviews.llvm.org/D37093





More information about the llvm-commits mailing list