[PATCH] D106852: [SCEV] Fix getAddExpr for adding loop invariants into start of some AddRec

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 23:36:37 PDT 2021


mkazantsev added a comment.

> The problem here is that we're splitting the add into pieces. a+b+1 being nsw doesn't necessarily imply that a+1 is nsw in all contexts; the nsw only applies in contexts where b is defined. This is a little subtle, but it's the only interpretation that's consistent with some of the ways we try to prove nsw flags.

I think this is a self-contradictory interpretation. What if we instead computed `a+b+1-b <nsw>` and then decided to simplify `b` away, getting `a+1<nsw>` and no hint that it's only for `b`'s context?


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

https://reviews.llvm.org/D106852



More information about the llvm-commits mailing list