Skip to content

Commit

Permalink
update deprecated AffineExpr casts
Browse files Browse the repository at this point in the history
  • Loading branch information
PhaneeshB authored and github-actions[bot] committed Nov 30, 2023
1 parent 725570d commit 322f455
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dropFoldableUnitIndices(PatternRewriter &rewriter,
SmallVector<int64_t> dstShape;
SmallVector<AffineExpr> dstExpr;
for (const auto &expr : enumerate(map.getResults())) {
if (auto dimExpr = expr.value().dyn_cast<AffineDimExpr>()) {
if (auto dimExpr = llvm::dyn_cast<AffineDimExpr>(expr.value())) {
if (!foldableDims.contains(dimExpr.getPosition())) {
dstShape.push_back(contractShape[dimExpr.getPosition()]);
unsigned numSkipped = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static void setTileSizes(linalg::GenericOp intMatmul,
int out = 2;
auto hasDim = [&](int mapIdx, int dimIdx) -> bool {
return llvm::any_of(maps[mapIdx].getResults(), [&](AffineExpr res) {
auto expr = res.dyn_cast<AffineDimExpr>();
auto expr = llvm::dyn_cast<AffineDimExpr>(res);
return expr && expr.getPosition() == dimIdx;
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static bool isVectorTimesMatrixTransposed(vector::ContractionOp contractionOp,
}
for (int r = 0; r < expectedResults.size(); ++r) {
int actualMapResult =
map.getResults()[r].cast<AffineDimExpr>().getPosition();
llvm::cast<AffineDimExpr>(map.getResults()[r]).getPosition();
if (actualMapResult != expectedMapResults[m][r]) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ static TransposeIndices collectChannelTransposeIndices(
AffineMap map, SmallVector<SmallVector<unsigned, 2>> transposeDimTargets) {
SmallVector<TransposeIndices> channelIndices(transposeDimTargets.size());
for (auto [index, result] : llvm::enumerate(map.getResults())) {
if (result.isa<AffineDimExpr>()) {
if (llvm::isa<AffineDimExpr>(result)) {
for (auto [channelVec, dimCategory] :
llvm::zip_equal(channelIndices, transposeDimTargets)) {
if (llvm::is_contained(dimCategory,
result.cast<AffineDimExpr>().getPosition())) {
llvm::cast<AffineDimExpr>(result).getPosition())) {
channelVec.push_back(index);
break;
}
Expand Down

0 comments on commit 322f455

Please sign in to comment.