Skip to content

Commit

Permalink
[SDAG] Allow Unknown sizes when refining MMO alignments. NFC
Browse files Browse the repository at this point in the history
The changes in D113888 / 32b6c17 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.
  • Loading branch information
davemgreen committed Nov 25, 2021
1 parent 48107ea commit 3a700ca
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 123 deletions.
4 changes: 3 additions & 1 deletion llvm/lib/CodeGen/MachineOperand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 3a700ca

Please sign in to comment.