Skip to content

Commit 4b55a13

Browse files
authored
[Codegen] Rewrite VectorLayoutAnalysis to a simpler implementation (#22420)
- Cleansup VectorLayoutAnalysis implementation to stop using upstream DataFlowAnalysis framework and instead use a simple worklist to track changes and propagate layout. This works very similar to the previous implementation, but is much less convoluted and much smaller. - Also fixes a bug in VectorLayoutAnalysis after the upstream DataFlowAnalysis framework moved to ProgramPoint. ProgramPoint tracks the Block iterator but we add operations during the propagation, which meant all ProgramPoint's were invalidated and the analysis was working out of pure luck. It just happened that we added almost everything to the worklist, making it run to fixpoint eventually. ci-extra: test_torch
1 parent ef639bb commit 4b55a13

File tree

2 files changed

+262
-1297
lines changed

2 files changed

+262
-1297
lines changed

compiler/src/iree/compiler/Codegen/Common/Transforms.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace IREE::VectorExt {
8181
class VectorLayoutInterface;
8282
} // namespace IREE::VectorExt
8383

84-
/// Analyzes the root op and it's nested ops to propagate vector layouts
84+
/// Analyzes the root op and its nested ops to propagate vector layouts
8585
/// originating from to_vector operations. Example:
8686
///
8787
/// %root = vector.transfer_read
@@ -95,8 +95,8 @@ class VectorLayoutInterface;
9595
/// |
9696
/// --> %root2, %b and %e must have the same layout
9797
///
98-
/// Here, the user provided an anchor point for %root, fixing it's layout to L.
99-
/// The layout then uses it's inference rules to find the layout of other
98+
/// Here, the user provided an anchor point for %root, fixing its layout to L.
99+
/// The layout then uses its inference rules to find the layout of other
100100
/// values:
101101
///
102102
/// %root = vector.transfer_read

0 commit comments

Comments
 (0)