[PATCH] D129636: Fix a LSR debug invariance issue

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 01:03:26 PDT 2022


markus added a comment.

In D129636#3701940 <https://reviews.llvm.org/D129636#3701940>, @mkazantsev wrote:

> The connection between described problem (as far as I understood, the fact that debuginfo changes IR is treated as a problem) and the proposed fix is not clear to me. The patch absolutely needs a detailed explanation, why existing SCEVs is a problem, in the commit message.

I have update the review summary.

> Note that, in presence of potential poison values, SCEV as well as many transform passes should treat it correctly. Sometimes "correctly" means "very conservatively", and this is what most likely happened here. Look at this:
>
> https://godbolt.org/z/sbshjW1nM
> https://godbolt.org/z/3fM8Exq6x
>
> I've annotated the function's argument as `noundef`, and now there is no difference b/w presenting and not-presenting dbgs is in no-wrap flags in IR. This flag is there because poison argument of a call is UB by specification (didn't really check for dbg.value, but should be).
>
> The issue will be gone if you annotate incoming parameters as noundef. Does your frontent allow this for this function?

I'm afraid that I do not understand this part at all. AFAICT the no-wrap flags are unrelated.


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

https://reviews.llvm.org/D129636



More information about the llvm-commits mailing list