[Mlir-commits] [mlir] [mlir][Transforms] Add missing check in applyPermutation (PR #102099)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Aug 7 20:49:51 PDT 2024
================
@@ -202,6 +202,9 @@ SmallVector<T> applyPermutation(ArrayRef<T> input,
ArrayRef<int64_t> permutation) {
assert(input.size() == permutation.size() &&
"expected input rank to equal permutation rank");
+ assert(
----------------
DarshanRamakant wrote:
That change can be done. But that would lead to :
1) Changing the code of all the callers of "applyPermutation()" to take care of the failue path.
2) Each caller can throw different error message on failure, which can lead to bad user experience.
The original aim of this patch was to throw a meaningful error message.
I can change the function signature in a new patch if all the reviewers agrees for that.
https://github.com/llvm/llvm-project/pull/102099
More information about the Mlir-commits
mailing list