[PATCH] D78415: Fix inlining multi-block callees with type conversion.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 20:44:57 PDT 2020


rriddle added a comment.

Thanks for fixing this!



================
Comment at: mlir/lib/Transforms/Inliner.cpp:32
 
+DEBUG_COUNTER(InlineFunction, "inliner-inline-function",
+              "Controls which inlinings we do.");
----------------
This should be camelCase as it defines a variable.


================
Comment at: mlir/lib/Transforms/Utils/InliningUtils.cpp:132
                                  ArrayRef<Value> resultsToReplace,
+                                 ArrayRef<Type> regionResultTypes,
                                  Optional<Location> inlineLoc,
----------------
Can you use TypeRange here instead? resultsToReplace should also be updated to ValueRange.


================
Comment at: mlir/lib/Transforms/Utils/InliningUtils.cpp:249
+  auto regionResultTypes = llvm::to_vector<6>(
+      llvm::map_range(resultsToReplace, [](Value v) { return v.getType(); }));
   // Call into the main region inliner function.
----------------
If you update the input types to ValueRange/TypeRange, you can just do `resultsToReplace.getTypes()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78415





More information about the llvm-commits mailing list