[PATCH] D139295: [Coroutines] Don't mark the parameter attribute of resume function as noalias

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 10 00:50:41 PST 2022


nikic added a comment.

In D139295#3983358 <https://reviews.llvm.org/D139295#3983358>, @ChuanqiXu wrote:

> In D139295#3978335 <https://reviews.llvm.org/D139295#3978335>, @nikic wrote:
>
>> @ChuanqiXu Your first function already contains:
>>
>>   store i32 42, ptr %__promise.reload.addr.i.i, align 8, !tbaa !3, !alias.scope !18
>>   store ptr null, ptr %.reload.addr, align 8, !alias.scope !18
>>   %1 = load ptr, ptr %0, align 8
>>   musttail call fastcc void %1(ptr nonnull %0) #5, !noalias !18
>>
>> which says that the store and the call don't alias. I don't think the `noalias` argument on the function would even matter in that case. The incorrect noalias metadata must be introduced at some earlier point already.
>
> Oh, so I misunderstood the semantics of `!noalias` before. So this patch may not be correct. BTW, do you have any ideas why the `store` in the first function would't be optimized out?

This is because the caller may read it. After inlining, we see that it's an alloca that nobody reads afterwards.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139295/new/

https://reviews.llvm.org/D139295



More information about the llvm-commits mailing list