This is still fairly tricky code, but I tried to untangle it a bit.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Shape/IR/Shape.cpp | ||
---|---|---|
505 | I'm not sure if this optimization is really worth it? You could also make this return true here and change the name to hasAtMostSingleNonScalar if you want though. | |
mlir/lib/Dialect/Traits.cpp | ||
25 | Can you not have nested ArrayRef's? | |
26 | Maybe add an assert for shapes.size() | |
31 | Random thought: It would be nice to use zip_longest somehow for these loops, but it seems not feasible. | |
33 | Ideally a better name like nonOneDim (not that that's great either) or a comment indicating what this will be used for. | |
41 | super nit: stray '.' | |
41 | super nit 2: "rest are 1" |
I'm not sure if this optimization is really worth it? You could also make this return true here and change the name to hasAtMostSingleNonScalar if you want though.