This case is handled in neither the folding or canonicalization
patterns. The folding pattern cannot generate new broadcast ops,
so it should be handled by the canonicalization pattern.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Vector/IR/VectorOps.cpp | ||
---|---|---|
1511 | I would expect this case to be handled by foldExtractFromBroadcast. It would be good to understand why this code didn't handle it: static Value foldExtractFromBroadcast(ExtractOp extractOp) { Operation *defOp = extractOp.getVector().getDefiningOp(); if (!defOp || !isa<vector::BroadcastOp, SplatOp>(defOp)) return Value(); Value source = defOp->getOperand(0); if (extractOp.getType() == source.getType()) return source; |
mlir/lib/Dialect/Vector/IR/VectorOps.cpp | ||
---|---|---|
1511 | The fold interface cannot generate new ops. As shown by the test, if the broadcast src and extract dst has the same type, we may need to generate a new broadcast (from -> vector<1x8xf32> to -> vector<8xf32>). That's not supported per fold constraints. |
mlir/lib/Dialect/Vector/IR/VectorOps.cpp | ||
---|---|---|
1511 | ... has the same rank... |
I would expect this case to be handled by foldExtractFromBroadcast.
It would be good to understand why this code didn't handle it: