Replace AffineScope trait by its complement trait. Introduce
ExtendsAffineScope trait that is the complement of AffineScope and
remove the latter.
This change does not bring any additional representational power but
changes the "default" trait with respect to ops creating new affine
scopes.
Any region holding op now starts an affine scope. Ops like affine.for,
affine.if, affine.parallel further extend the affine scope either
started or extended by their enclosing op. affine.for,
affine.parallel, and affine.if now have the ExtendsAffineScope
trait.
As a result of this change:
- no additional trait is needed for a region holding op (like various FuncOp's, scf.for, scf.if, scf.execute_region, etc.) to allow affine load/stores/for/ifs in a larger set of cases; symbols that are defined in their bodies would be valid symbols for the affine ops.
- ops outside the affine dialect can add an ExtendsAffineScope trait in order to have their block arguments treated as dimensional identifiers.
Clean up documentation and code comments.
This change also has the benign affect of dimensions becoming symbols in
several contexts (since arbitrary region holding ops are able to define
symbols at their top-level): hence the several mechanical updates to
test cases.
Losely speaking, letting all region-holding ops by default
start an affine scope leads to more "symbols" by default, and admits
affine IR in a significantly larger set of use cases by default.
Some additional discussion:
https://llvm.discourse.group/t/should-linalg-indexed-generic-allow-for-affine-operations-on-its-body/2889/14
Should we leave an empty line between the title and the paragraph?