[PATCH] D123991: [LangRef] Clarify load/store of non-byte-sized types

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 04:50:17 PDT 2022


nlopes added a comment.

Well, here we are discussing the semantics of LLVM IR. It's ok for the semantics of SDAG to be different, as long as it's a refinement of LLVM IR's.
Padding at IR level is not observable normally. So we can define it as poison.

The only way to observe padding is through store/load of different types. But we specify that the location of padding is non-deterministic in the case of vectors. I don't see a reason for padding in integer types to be different.

The SDAG can happily assume that the padding is zero because stores at SDAG level enforce that. But we don't need to offer that semantics at IR level.

The only advantage of defining padding as zero would be, as the examples show, fold load+zext into a larger load. But for this to work we would need to define the memory layout, and I don't know if that's consistent across backends. And is it worth it?


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

https://reviews.llvm.org/D123991



More information about the llvm-commits mailing list