[PATCH] D110813: [LoopRotate] Forget SCEV values in RewriteUsesOfClonedInstructions

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 7 04:43:17 PDT 2021


fhahn accepted this revision.
fhahn added a comment.

In D110813#3047663 <https://reviews.llvm.org/D110813#3047663>, @mkazantsev wrote:

> That's exactly the kind of things I'm hunting. Thanks!
> There might be more of this type. It would be nice if we could somehow find and fix them.

Great to see issues like this being caught by the verification!

In D110813#3045494 <https://reviews.llvm.org/D110813#3045494>, @bjope wrote:

> In D110813#3045467 <https://reviews.llvm.org/D110813#3045467>, @bjope wrote:
>
>> In D110813#3041983 <https://reviews.llvm.org/D110813#3041983>, @fhahn wrote:
>>
>>> It looks like the crash/differences may be caused by stale entries in the loop disposition cache. Are those caught by the checks in D110385 <https://reviews.llvm.org/D110385>?
>>
>> Yep. I've downloaded D110385 <https://reviews.llvm.org/D110385>, and used `verify<scalar-evolution>` after loop-rotate instead of  `print<scalar-evolution>`. Then I see this:
>>
>>   Cached block disposition of SCEV (trunc i32 %wide to i16) for basic block: 
>>   loop.inner:                                       ; preds = %loop.inner, %loop.inner.ph
>>     %iv = phi i16 [ %narrow, %loop.inner.ph ], [ %iv.plus, %loop.inner ]
>>     %iv.promoted = zext i16 %iv to i32
>>     %gep = getelementptr inbounds [11263 x i32], [11263 x i32]* @array, i32 0, i32 %iv.promoted
>>     store i32 7, i32* %gep, align 1
>>     %iv.plus = add i16 %iv, 1
>>     %cmp = icmp ult i16 %iv.plus, 700
>>     br i1 %cmp, label %loop.inner, label %loop.outer.latch
>>    has changed!
>>   Cached: 2
>>   Actual: 0
>
> But only for the RUN-lines that uses `print<scalar-evolution>` before loop-rotate. When using `loop(canon-freeze)` I get the same kind of crash in the verifier as when using the print pass.

Thanks for checking!

LGTM!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110813



More information about the llvm-commits mailing list