This patch adds a folding to select operation between an all-true and all-false vector.
For now, only single element vectors (i.e., vector<1xi1>) are supported. Multi-element
cases are caught by InstCombine.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1079–1082 | it is probably better to do: return denseAttr.isSplat() && denseAttr.getSplatValue<bool>() == value; looping through all the elements can be expensive for large shapes. | |
1135 | should this be a vector.broadcast? That would generalize to any vector size? |
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1107 | There's not sign extension taking place here, is there? |
Comment Actions
LGTM, thanks!
I see that you have also addressed comments from Thomas, so IMHO it's OK to land this without waiting for further feedback.
it is probably better to do:
looping through all the elements can be expensive for large shapes.