[PATCH] D73429: [mlir][NFC] Update Operation::getResultTypes to use ArrayRef<Type> instead of iterator_range.

Jacques Pienaar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 08:16:02 PST 2020


jpienaar added inline comments.


================
Comment at: mlir/test/lib/TestDialect/TestPatterns.cpp:257
     // If the type is F32, change the type to F64.
-    if (!(*op->result_type_begin()).isF32())
+    if (!Type(*op->result_type_begin()).isF32())
       return matchFailure();
----------------
rriddle wrote:
> bondhugula wrote:
> > This pattern looks like a concern. Do we get a warning if we didn't use the Type ctor? It's not clear to me why we need it now. 
> It is necessary because the methods on Type are non-const and the result type range now returns  `const Type` elements, instead of a `Type`. 
Wouldn't this then result in us having multiple of these casts now? It seems like we'll end up adding more const casts just to query the types.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73429/new/

https://reviews.llvm.org/D73429





More information about the llvm-commits mailing list