[PATCH] D113289: LICM: Hoist LOAD without STORE

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 24 07:15:46 PST 2021


djtodoro added a comment.

In D113289#3147618 <https://reviews.llvm.org/D113289#3147618>, @reames wrote:

> Ok, let me describe back to you what you're trying to do.  Give a case like:
>
>   loop {
>     a = *g;
>     if (a) break;
>     *g = a + 1
>   }
>
> Where g is some loop invariant address, you want to produce a form which looks like this:
>
>   a0 = *g
>   loop {
>     a1 = phi (a0, a2)
>     if (a1) break;
>     a2 = a1 + 1
>     *g = a2;
>   }

Yep, that's it!

> Assuming I've correctly described that, I agree this is valuable.  I'm honestly a bit shocked we didn't already handle it.  However, this should absolutely not be target dependent.  It should simply be always enabled.

Thanks! I totally agree, so I removed the flag and abandoned the second patch from the stack that was target-dependent.


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

https://reviews.llvm.org/D113289



More information about the llvm-commits mailing list