[PATCH] D142445: [mlir][tensor|memref] Harden the checks on dim op

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 00:17:29 PST 2023


qcolombet added a comment.

> Yes but you can't prove this path will be executed at runtime...

Although true, I feel that if anything this change makes the verifier more consistent.
Right now, the verifier will reject dim ops that are known to be out-of-bound for non-0-ranked shapes. This patch extends the check to 0-ranked shapes.

If we follow the UB argument, we should not reject out-of-bound accesses for the non-0-ranked shapes either and instead generate unreachable.

What I am saying is I feel the UB semantic is usually our way out of things we can't check statically, but we actually don't stick to that when we can catch it in the verifier.

The bottom line is for me it feels arbitrary to decide that 0-ranked should produce unreachable whereas non-0-ranked don't.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142445



More information about the llvm-commits mailing list