[SCEV] Attempt to define what flags are legal on a SCEV
This is an attempt to define what the current semantics are closest too. Unfortunately, the current implementation does appear to be inconsistent with all semantic variants we've considered. This semantics is the one which seems to be closest to the spirit of the code, and that matched several long time contributors mental models of how the code "should work".
https://bugs.llvm.org/show_bug.cgi?id=51817 tracks the list of currently known violations of these rules. A series of follow up patches will be addressing each now that we've defined them to be bugs.
Differential Revision: https://reviews.llvm.org/D109553