[PATCH] D109553: [SCEV] Attempt to define what flags are legal on a SCEV

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 23:01:29 PDT 2021


mkazantsev added a comment.

I think it's too pessmistic with regard of users. Imagine the following situation: we have `%a` and `%b` which are `SCEVUnknown`, and the only their (SCEV) user is `a + b` which is guarded by conditions `a <u 100`, `b <u 100`.

We might have a right to say that `a + b` is `nuw` and `nsw`, since the only place where it is used is guarded by conditions that imply this. But in the suggested definition, basically, guarding conditions don't matter and we cannot infer any flags from them. It means that we can still prove some facts, but it will take us walking dom tree every time we need it.

On the other hand, I understand the motivation, and implications of alternative (use-based) approach for SCEV expander. So what I said is just a highlight of a problem we are going to inherit, not a con against this patch.

If everyone's agree then it's fine for me.



================
Comment at: llvm/include/llvm/Analysis/ScalarEvolution.h:118
+  /// that SCEV is defined.  A SCEV's scope is set of locations dominated by
+  /// a defining location, which is in turn describes by the following rules:
+  /// * A SCEVUnknown is at the point of definition of the Value.
----------------
described?


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

https://reviews.llvm.org/D109553



More information about the llvm-commits mailing list