diff options
author | Rik Huijzer <github@huijzer.xyz> | 2023-12-04 08:57:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 08:57:59 +0100 |
commit | c9c1b3c37fa5d5c617068afe67afcafacd58a241 (patch) | |
tree | 5621b20e29892cb206fedbcb196122b9b63bed49 /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | d49e9d88a27295b52f28cdcdcf5eb59d88dd99f9 (diff) | |
download | llvm-c9c1b3c37fa5d5c617068afe67afcafacd58a241.zip llvm-c9c1b3c37fa5d5c617068afe67afcafacd58a241.tar.gz llvm-c9c1b3c37fa5d5c617068afe67afcafacd58a241.tar.bz2 |
[mlir][memref] Fix an invalid dim loop motion crash (#74204)
Fixes https://github.com/llvm/llvm-project/issues/73382.
This PR suggests to replace two assertions that were introduced in
https://github.com/llvm/llvm-project/commit/adabce41185910227ca276a1cfd22e76443dd238
(https://reviews.llvm.org/D135748). According to the enum definition of
`NotSpeculatable`, an op that invokes undefined behavior is
`NotSpeculatable`.
https://github.com/llvm/llvm-project/blob/0c06e8745f131d867c566f4d35a7a04e24b4a075/mlir/include/mlir/Interfaces/SideEffectInterfaces.h#L248-L258
and both `tensor.dim` and `memref.dim` state that "If the dimension
index is out of bounds, the behavior is undefined."
So therefore it seems to me that `DimOp::getSpeculatability()` should
return `NotSpeculatable` if the dimension index is out of bounds.
The added test is just a simplified version of
https://github.com/llvm/llvm-project/issues/73382.
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions