[PATCH] D127202: [InlineFunction] Handle early exit during getUnderlyingObjects due to MaxLookup

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 03:44:41 PDT 2022


shchenz added inline comments.


================
Comment at: llvm/test/Transforms/Coroutines/coro-retcon-resume-values.ll:53
+; CHECK-NEXT:    store i32 2, i32* [[TMP4]], align 4
+; CHECK-NEXT:    [[FRAMEPTR_I1:%.*]] = load %f.Frame*, %f.Frame** [[TMP2]], align 8, !alias.scope !0
 ; CHECK-NEXT:    [[INPUT_RELOAD_ADDR13_I:%.*]] = getelementptr inbounds [[F_FRAME:%.*]], %f.Frame* [[FRAMEPTR_I1]], i64 0, i32 2
----------------
shchenz wrote:
> The change here seems like another bug fix.
> 
> Before the patch:
> ```
>   %2 = bitcast i8* %0 to %f.Frame**
> 
>   %FramePtr.i1 = load %f.Frame*, %f.Frame** %2, align 8, !alias.scope !3
> 
>   %input.reload.addr13.i = getelementptr inbounds %f.Frame, %f.Frame* %FramePtr.i1, i64 0, i32 2
>   %input.reload14.i = load i32, i32* %input.reload.addr13.i, align 4, !noalias !3
>   %n.val3.reload.addr11.i = getelementptr inbounds %f.Frame, %f.Frame* %FramePtr.i1, i64 0, i32 1
>   %n.val3.reload12.i = load i32, i32* %n.val3.reload.addr11.i, align 4, !noalias !3
> 
>   store i32 %sum7.i, i32* %n.val3.reload.addr11.i, align 4, !noalias !3
>   store i32 4, i32* %input.reload.addr13.i, align 4, !noalias !3
> ```
> 
> `%0` is a noalias argument when do inlining. So before the change all the latter loads/stores are not aliased to the noalias argument `%0`, but seems it is not right. The base for the loads/stores are exactly `%0` which is loaded from a pointer of pointer. The pointer of pointer is casted from `%0`.
> 
> `getUnderlyingObjects()` can not check underlying object inside loads for now.
Please ignore this comments. Seems the analysis is wrong. The latter loads/stores are not load/store from base `%0`.

So we now lose some alias info but have correct functionality.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127202



More information about the llvm-commits mailing list