[PATCH] D135736: [mlir][MemRef] Make reinterpret_cast(extract_strided_metadata) more robust

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 08:28:46 PDT 2022


qcolombet added inline comments.


================
Comment at: mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp:1748
+static bool sameValueOrConstantAtIdx(
+    ArrayRef<OpFoldResult> valuesA, ArrayRef<int64_t> constantsA,
+    ArrayRef<OpFoldResult> valuesB, ArrayRef<int64_t> constantsB,
----------------
nicolasvasilache wrote:
> This feels like a very clunky API to use .. 
> 
> Can we merge the OFR and int64_t into a single vector keeping the most static information and only directly compare equality ?
> 
> I can't tell offhand if whether this is possible or whether the logic allows for more complex mixings of Value vs int comparisons.
> Can we merge the OFR and int64_t into a single vector keeping the most static information and only directly compare equality ?

I don't know how much it would help API-wise in the sense that the tricky bit is to get this information to beginning with. (I.e., what is currently done in `sameValueOrConstant` and more particularly the lambda `getConstant`.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135736



More information about the llvm-commits mailing list