[Mlir-commits] [mlir] 1e1a4a4 - [mlir] Take ValueRange instead of ArrayRef<Value> in StructuredIndexed

Alex Zinenko llvmlistbot at llvm.org
Mon Sep 7 06:17:46 PDT 2020


Author: Alex Zinenko
Date: 2020-09-07T15:17:39+02:00
New Revision: 1e1a4a481987f77fe3e6debc015c1d07af249258

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

LOG: [mlir] Take ValueRange instead of ArrayRef<Value> in StructuredIndexed

This was likely overlooked when ValueRange was first introduced. There is no
reason why StructuredIndexed needs specifically an ArrayRef so use ValueRange
for better type compatibility with the rest of the APIs.

Reviewed By: nicolasvasilache, mehdi_amini

Differential Revision: https://reviews.llvm.org/D87127

Added: 
    

Modified: 
    mlir/include/mlir/EDSC/Builders.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/EDSC/Builders.h b/mlir/include/mlir/EDSC/Builders.h
index 1f21af617e4d..70c948d99cda 100644
--- a/mlir/include/mlir/EDSC/Builders.h
+++ b/mlir/include/mlir/EDSC/Builders.h
@@ -190,7 +190,7 @@ class TemplatedIndexedValue {
   TemplatedIndexedValue operator()(Value index, Args... indices) {
     return TemplatedIndexedValue(value, index).append(indices...);
   }
-  TemplatedIndexedValue operator()(ArrayRef<Value> indices) {
+  TemplatedIndexedValue operator()(ValueRange indices) {
     return TemplatedIndexedValue(value, indices);
   }
 
@@ -319,7 +319,7 @@ class TemplatedIndexedValue {
   }
 
 private:
-  TemplatedIndexedValue(Value value, ArrayRef<Value> indices)
+  TemplatedIndexedValue(Value value, ValueRange indices)
       : value(value), indices(indices.begin(), indices.end()) {}
 
   TemplatedIndexedValue &append() { return *this; }


        


More information about the Mlir-commits mailing list