aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2021-11-25 10:19:29 +0000
committerDavid Green <david.green@arm.com>2021-11-25 10:19:29 +0000
commit3a700cabdcbadb2a1a5961fd380a103cd7f867b3 (patch)
tree5aa97d3196ef9236394751557f3ce5bab9bb2645 /llvm/lib/CodeGen/MachineOperand.cpp
parent48107eaa07e26f9bc5b24af2d5351793cc64db46 (diff)
downloadllvm-3a700cabdcbadb2a1a5961fd380a103cd7f867b3.zip
llvm-3a700cabdcbadb2a1a5961fd380a103cd7f867b3.tar.gz
llvm-3a700cabdcbadb2a1a5961fd380a103cd7f867b3.tar.bz2
[SDAG] Allow Unknown sizes when refining MMO alignments. NFC
The changes in D113888 / 32b6c17b29079e7d altered the memory size of a masked store, as it will store an unknown number of bytes not the full vector size. We can have situations where the masked stores is legalized and then turned to a normal store, as the mask is known to be all ones. This creates a store with an unknown size MMO that was hitting this assert. The store created can be given a better size in a followup patch. This currently adjusts the assert to handle unknown sizes.
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOperand.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index 4d080e1..680dbe5 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -1071,7 +1071,9 @@ void MachineMemOperand::refineAlignment(const MachineMemOperand *MMO) {
// The Value and Offset may differ due to CSE. But the flags and size
// should be the same.
assert(MMO->getFlags() == getFlags() && "Flags mismatch!");
- assert(MMO->getSize() == getSize() && "Size mismatch!");
+ assert((MMO->getSize() == ~UINT64_C(0) || getSize() == ~UINT64_C(0) ||
+ MMO->getSize() == getSize()) &&
+ "Size mismatch!");
if (MMO->getBaseAlign() >= getBaseAlign()) {
// Update the alignment value.