[PATCH] D131776: [GVN] Fix miscompile shown in github issue #57025

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 02:54:24 PDT 2022


nikic added a comment.

I've spent a good bit of time looking into this, and I don't think this patch fixes the right issue.

The core problem seems to be that the store in `store.idx.0` is not reported as a def clobber, even though it clearly is on the first loop iteration. The reason we get this result is that we perform an AA query between `%arr` and `%arr.i` -- but `%arr.i` is in a block that that is guarded by `%i != 0`, so the two are NoAlias.

I'm not entirely sure who is at fault here yet, but probably we shouldn't be using `%arr.i` as the pointer value here -- while it has the correct value, it is located in an incorrect context.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131776



More information about the llvm-commits mailing list