[Mlir-commits] [mlir] d97d409 - [mlir] NFC: use ValueRange for BlockArgument in ConvertStandardToLLVM

Alex Zinenko llvmlistbot at llvm.org
Wed Feb 19 08:26:36 PST 2020


Author: Alex Zinenko
Date: 2020-02-19T17:26:30+01:00
New Revision: d97d409277278704b68382884b43fcc91f2b9962

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

LOG: [mlir] NFC: use ValueRange for BlockArgument in ConvertStandardToLLVM

When the conversion was implemented, ValueRange did not support
BlockArguments the code materialized a vector. This is no longer
necessary.

Added: 
    

Modified: 
    mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
index 97a6d618dd82..2a6e4f8529da 100644
--- a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
+++ b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
@@ -826,16 +826,11 @@ static void wrapExternalFunction(OpBuilder &builder, Location loc,
 
   builder.setInsertionPointToStart(newFuncOp.addEntryBlock());
 
-  // Get a ValueRange containing argument types. Note that ValueRange is
-  // currently not constructible from a pair of iterators pointing to
-  // BlockArgument.
+  // Get a ValueRange containing arguments.
   FunctionType type = funcOp.getType();
   SmallVector<Value, 8> args;
   args.reserve(type.getNumInputs());
-  auto wrapperArgIters = newFuncOp.getArguments();
-  SmallVector<Value, 8> wrapperArgs(wrapperArgIters.begin(),
-                                    wrapperArgIters.end());
-  ValueRange wrapperArgsRange(wrapperArgs);
+  ValueRange wrapperArgsRange(newFuncOp.getArguments());
 
   // Iterate over the inputs of the original function and pack values into
   // memref descriptors if the original type is a memref.


        


More information about the Mlir-commits mailing list