[Mlir-commits] [mlir] [mlir][affine] cleanup deprecated T.cast style functions (PR #71269)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Nov 9 22:05:35 PST 2023


================
@@ -438,14 +438,15 @@ SparseTensorEncodingAttr::tranlateShape(ArrayRef<int64_t> srcShape,
     // Do constant propagation on the affine map.
     AffineExpr evalExp =
         simplifyAffineExpr(exp.replaceDims(dimRep), srcShape.size(), 0);
-    if (auto c = evalExp.dyn_cast<AffineConstantExpr>()) {
+    // use llvm namespace here to avoid ambiguity
+    if (auto c = llvm::dyn_cast<AffineConstantExpr>(evalExp)) {
----------------
lipracer wrote:

if we did't use qualified name `llvm::dyn_cast` compiler found the Attribute's dyn_cast function and abort the name found.then report argument not match.I think this can safe remove untile all of the deprecated T.cast style functions removed.
name find rule: https://en.cppreference.com/w/cpp/language/lookup

https://github.com/llvm/llvm-project/pull/71269


More information about the Mlir-commits mailing list