[SDAG] Use UnknownSize for masked load/store MMO size
authorDavid Green <david.green@arm.com>
Tue, 23 Nov 2021 09:47:56 +0000 (09:47 +0000)
committerDavid Green <david.green@arm.com>
Tue, 23 Nov 2021 09:47:56 +0000 (09:47 +0000)
commit32b6c17b29079e7d2ac61cdc90b10983ee97d78d
tree0eae70720c2fa5a9b853962f8ca14915c6f2a821
parent59f4b3d3081535b61609f12ea5f638905616fcbc
[SDAG] Use UnknownSize for masked load/store MMO size

A masked load or store will load a potentially unknown number of bytes
from a memory location - that is not generally known at compile time.
They do not necessarily load/store the entire vector width, and treating
them as such can lead to incorrect aliasing information (for example, if
the underlying object is smaller than the size of the vector).

This makes sure that the MMO is given an unknown size to represent this.
which is less accurate that "may load/store from up to 16 bytes", but
less incorrect that "will load/store from 16 bytes".

Differential Revision: https://reviews.llvm.org/D113888
llvm/include/llvm/CodeGen/MachineFunction.h
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp
llvm/test/CodeGen/Thumb2/mve-masked-store-mmo.ll
llvm/test/CodeGen/X86/masked_compressstore.ll
llvm/test/CodeGen/X86/vmaskmov-offset.ll