[PATCH] D71852: [Attributor] Reach optimistic fixpoint in AAValueSimplify when the value is constant or undef

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 04:51:46 PST 2019


baziotis added a comment.

I'm not super familiar with `AAValueSimplify`, but here's a perspective: The conceptual idea is that `AAValueSimplify` returns optimistic fixpoint if it actually changed the value.
We may not want to break that. Instead, keep the "contract" to whoever is using it to: Use that assuming that if you got a known value, then it means it changed from the original.
The implication being: Check for yourself if it is something that won't change (i.e. it is constant). One one hand that puts more logistics to the user. On the other hand, the code may become more
understandable as the check for constant (or undef) happens with regular LLVM values that anyone who is not familiar with the Attributor can understand what is happening (i.e. from looking the code, the reader knows that if the value is constant, it won't even go through `AAValueSimplify`).
**Edit**: Well, AFAIK obviously the user of `AAValueSimplify` will be another part of the Attributor, so the reader is supposed to be familiar with it. But still, I think the fact that we'll go through `AAValueSimplify` only if we have some kind of complicated value is makes the code more understandable.


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

https://reviews.llvm.org/D71852





More information about the llvm-commits mailing list