[PATCH] D113888: [SDAG] Use UnknownSize for masked load/store MMO size

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 17 09:52:56 PST 2021


efriedma added a comment.

In D113888#3136093 <https://reviews.llvm.org/D113888#3136093>, @dmgreen wrote:

>> Does this mean any operation that's a mayload/maystore needs to have the size of the operand set to "unknown"?  I suspect we need to do significantly more work than just this patch if we want memory operands to work this way.  (e.g. type legalization, if conversion.)  What happens if we just say that size of a memory location is supposed to represent an upper bound, at least for now?
>
> Why would it be any operation, not just masked loads/stores? The problem is in this case the underlying object only had 10 dereferenceable chars, where as the entire vector width is 16bytes. I don't think that would apply to any normal load/store - it would already be UB at the llvm-ir level.

It's basically "masked" load/store operations.  At the IR level, those are rare, sure.  At the machine code level, there are operations other than llvm.masked.load that end up masked, though.  For example, the ARM instruction "strne".  Not sure how many places can end up with instructions like that off the top of my head.

The type legalization for llvm.masked.load also has the same issue as SelectionDAGBuilder.


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

https://reviews.llvm.org/D113888



More information about the llvm-commits mailing list