[flang] [clang] [clang-tools-extra] [mlir] [compiler-rt] [llvm] [mlir] Verify non-negative `offset` and `size` (PR #72059)

Mehdi Amini via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 03:24:44 PST 2023


joker-eph wrote:

> > This looks like a good fix for the verifier, but we should also fix the canonicalization to **not** create invalid IR!
> 
> Then I think that I'll implement the suggestions from Matthias in this PR and leave the canonicalization for a future PR. For that future PR, could you tell me what the preferred result would be? What would be the valid IR here that the canonicalization should return?

It is related to this PR in the sense that we can’t create invalid IR: so if you make it illegal in the verifier then the canonicalizer can’t fold to this form and must check before doing so.
If we want to leave the canonicalizer folding, then the verifier should accept it instead.

Both options are correct, but they should be consistent. Not folding negative dimension seems like a straightforward thing I think?

https://github.com/llvm/llvm-project/pull/72059


More information about the cfe-commits mailing list