File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
mlir/lib/Dialect/Vector/Transforms Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -205,11 +205,13 @@ struct Gather1DToConditionalLoads : OpRewritePattern<vector::GatherOp> {
205205 Value condMask = op.getMask ();
206206 Value base = op.getBase ();
207207
208- // vector.load requires the most minor memref dim to have unit stride
208+ // vector.load requires the most minor memref dim to have unit stride,
209+ // or the result vector type to have only one element
209210 if (auto memType = dyn_cast<MemRefType>(base.getType ())) {
210211 if (auto stridesAttr =
211212 dyn_cast_if_present<StridedLayoutAttr>(memType.getLayout ())) {
212- if (stridesAttr.getStrides ().back () != 1 )
213+ if (stridesAttr.getStrides ().back () != 1 &&
214+ resultTy.getNumElements () != 1 )
213215 return failure ();
214216 }
215217 }
You can’t perform that action at this time.
0 commit comments