[Mlir-commits] [mlir] 652592c - [MLIR][Transform] Disambiguate ternary operator for MSVC

Benjamin Kramer llvmlistbot at llvm.org
Thu Dec 1 00:02:08 PST 2022


Author: Benjamin Kramer
Date: 2022-12-01T08:59:58+01:00
New Revision: 652592c5cadf7093b288779df1e77ae6afcde6c0

URL: https://github.com/llvm/llvm-project/commit/652592c5cadf7093b288779df1e77ae6afcde6c0
DIFF: https://github.com/llvm/llvm-project/commit/652592c5cadf7093b288779df1e77ae6afcde6c0.diff

LOG: [MLIR][Transform] Disambiguate ternary operator for MSVC

mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp(42): error C2446: ':': no conversion from 'OpTy' to 'OpTy'
        with
        [
            OpTy=mlir::scf::ForOp
        ]
        and
        [
            OpTy=mlir::AffineForOp
        ]
mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp(42): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp b/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
index ca057156c21bc..02c18c8d72a62 100644
--- a/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
+++ b/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp
@@ -38,9 +38,9 @@ transform::GetParentForOp::apply(transform::TransformResults &results,
   for (Operation *target : state.getPayloadOps(getTarget())) {
     Operation *loop, *current = target;
     for (unsigned i = 0, e = getNumLoops(); i < e; ++i) {
-      loop = getAffine() ? current->getParentOfType<AffineForOp>()
-                         : current->getParentOfType<scf::ForOp>();
-
+      loop = getAffine()
+                 ? current->getParentOfType<AffineForOp>().getOperation()
+                 : current->getParentOfType<scf::ForOp>().getOperation();
       if (!loop) {
         DiagnosedSilenceableFailure diag =
             emitSilenceableError()


        


More information about the Mlir-commits mailing list