mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
[MLIR] Improve support for 0-dimensional Affine Maps.
Summary: Modified AffineMap::get to remove support for the overload which allowed an ArrayRef of AffineExpr but no context (and gathered the context from a presumed first entry, resulting in bugs when there were 0 results). Instead, we support only a ArrayRef and a context, and a version which takes a single AffineExpr. Additionally, removed some now needless case logic which previously special cased which call to AffineMap::get to use. Reviewers: flaub, bondhugula, rriddle!, nicolasvasilache, ftynse, ulysseB, mravishankar, antiagainst, aartbik Subscribers: mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78226
This commit is contained in:
@@ -1348,9 +1348,7 @@ private:
|
||||
auto targetExpr = getAffineDimExpr(idx < index ? idx : idx - 1, ctx);
|
||||
results.push_back(targetExpr);
|
||||
}
|
||||
// The (...) -> () affine map has its own factory method.
|
||||
return results.empty() ? AffineMap::get(map.getNumDims() - 1, 0, ctx)
|
||||
: AffineMap::get(map.getNumDims() - 1, 0, results);
|
||||
return AffineMap::get(map.getNumDims() - 1, 0, results, ctx);
|
||||
}
|
||||
|
||||
// Helper to drop dimension from vector type.
|
||||
|
||||
Reference in New Issue
Block a user