Fix SimplifyAllocConst pattern when we have alloc of negative sizes
authorMehdi Amini <joker.eph@gmail.com>
Tue, 28 Feb 2023 20:00:45 +0000 (15:00 -0500)
committerMehdi Amini <joker.eph@gmail.com>
Tue, 28 Feb 2023 20:01:53 +0000 (15:01 -0500)
commitf35ac8a4ffbecd1fee09731e5a9a242e6425df80
tree048bedea553bc010ab12e3261d934d2c9b7a3297
parent9a9fce1fed6d2af3fb6d1d7073c4a0b3e00bc515
Fix SimplifyAllocConst pattern when we have alloc of negative sizes

This is UB, but we shouldn't crash the compiler either.

Fixes #61056

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D144978
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
mlir/test/Dialect/MemRef/canonicalize.mlir