[PATCH] D73894: [MLIR] Add mapping based on ValueRange to BlockAndValueMapper.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 08:13:16 PST 2020


rriddle accepted this revision.
rriddle added inline comments.
This revision is now accepted and ready to land.


================
Comment at: mlir/include/mlir/IR/BlockAndValueMapping.h:30
   /// it is overwritten.
-  void map(Block *from, Block *to) { valueMap[from] = to; }
-  void map(Value from, Value to) {
-    valueMap[from.getAsOpaquePointer()] = to.getAsOpaquePointer();
+  template <typename S, typename T,
+            std::enable_if_t<std::is_assignable<Value, S>::value &&
----------------
nit: I would just keep these the same for now. Is there a reason to templatize these yet?


================
Comment at: mlir/include/mlir/IR/BlockAndValueMapping.h:47
+                             !std::is_same<S, Block *>::value> * = nullptr>
+  void map(S from, T to) {
+    for (auto pair : llvm::zip(from, to))
----------------
nit: `S&&` and `T&&`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73894





More information about the llvm-commits mailing list