From 2dc897a75e0d18f7b9b64675243e1f5ab775c6a8 Mon Sep 17 00:00:00 2001 From: PhaneeshB Date: Wed, 15 Nov 2023 20:19:26 +0530 Subject: [PATCH] update deprecated AffineExpr casts --- .../Codegen/LLVMCPU/LLVMCPUFoldVectorContractUnitDims.cpp | 2 +- .../iree/compiler/Codegen/LLVMCPU/SetSpecialTilingConfigs.cpp | 2 +- .../compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp | 2 +- .../Preprocessing/Common/ConvertConvToChannelsLast.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/iree/compiler/Codegen/LLVMCPU/LLVMCPUFoldVectorContractUnitDims.cpp b/compiler/src/iree/compiler/Codegen/LLVMCPU/LLVMCPUFoldVectorContractUnitDims.cpp index 12388c2dd8f1..1096693c693d 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMCPU/LLVMCPUFoldVectorContractUnitDims.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMCPU/LLVMCPUFoldVectorContractUnitDims.cpp @@ -54,7 +54,7 @@ dropFoldableUnitIndices(PatternRewriter &rewriter, SmallVector dstShape; SmallVector dstExpr; for (const auto &expr : enumerate(map.getResults())) { - if (auto dimExpr = expr.value().dyn_cast()) { + if (auto dimExpr = llvm::dyn_cast(expr.value())) { if (!foldableDims.contains(dimExpr.getPosition())) { dstShape.push_back(contractShape[dimExpr.getPosition()]); unsigned numSkipped = 0; diff --git a/compiler/src/iree/compiler/Codegen/LLVMCPU/SetSpecialTilingConfigs.cpp b/compiler/src/iree/compiler/Codegen/LLVMCPU/SetSpecialTilingConfigs.cpp index 789d67a71351..0b016bd947eb 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMCPU/SetSpecialTilingConfigs.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMCPU/SetSpecialTilingConfigs.cpp @@ -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(); + auto expr = llvm::dyn_cast(res); return expr && expr.getPosition() == dimIdx; }); }; diff --git a/compiler/src/iree/compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp b/compiler/src/iree/compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp index 04a3aa7e7e76..0514e53cf8cf 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMCPU/VectorContractCustomKernels.cpp @@ -147,7 +147,7 @@ static bool isVectorTimesMatrixTransposed(vector::ContractionOp contractionOp, } for (int r = 0; r < expectedResults.size(); ++r) { int actualMapResult = - map.getResults()[r].cast().getPosition(); + llvm::cast(map.getResults()[r]).getPosition(); if (actualMapResult != expectedMapResults[m][r]) { return false; } diff --git a/compiler/src/iree/compiler/Preprocessing/Common/ConvertConvToChannelsLast.cpp b/compiler/src/iree/compiler/Preprocessing/Common/ConvertConvToChannelsLast.cpp index 4a8b833bfb1a..9c40792456a4 100644 --- a/compiler/src/iree/compiler/Preprocessing/Common/ConvertConvToChannelsLast.cpp +++ b/compiler/src/iree/compiler/Preprocessing/Common/ConvertConvToChannelsLast.cpp @@ -260,11 +260,11 @@ static TransposeIndices collectChannelTransposeIndices( AffineMap map, SmallVector> transposeDimTargets) { SmallVector channelIndices(transposeDimTargets.size()); for (auto [index, result] : llvm::enumerate(map.getResults())) { - if (result.isa()) { + if (llvm::isa(result)) { for (auto [channelVec, dimCategory] : llvm::zip_equal(channelIndices, transposeDimTargets)) { if (llvm::is_contained(dimCategory, - result.cast().getPosition())) { + llvm::cast(result).getPosition())) { channelVec.push_back(index); break; }