forked from OSchip/llvm-project
[MemOperands] Clarify code around dropping memory operands [NFC]
Clarify a comment about what it means to drop memory operands from an instruction. While I'm adding change the name of the method slightly to make it a bit more clear what's going on when reading calling code. llvm-svn: 256346
This commit is contained in:
parent
9bc46b117b
commit
4e66c84722
|
@ -1185,8 +1185,11 @@ public:
|
||||||
assert(NumMemRefs == NewMemRefsEnd - NewMemRefs && "Too many memrefs");
|
assert(NumMemRefs == NewMemRefsEnd - NewMemRefs && "Too many memrefs");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clear this MachineInstr's memory reference descriptor list.
|
/// Clear this MachineInstr's memory reference descriptor list. This resets
|
||||||
void clearMemRefs() {
|
/// the memrefs to their most conservative state. This should be used only
|
||||||
|
/// as a last resort since it greatly pessimizes our knowledge of the memory
|
||||||
|
/// access performed by the instruction.
|
||||||
|
void dropMemRefs() {
|
||||||
MemRefs = nullptr;
|
MemRefs = nullptr;
|
||||||
NumMemRefs = 0;
|
NumMemRefs = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -793,7 +793,7 @@ removeMMOsFromMemoryOperations(MachineBasicBlock::iterator MBBIStartPos,
|
||||||
|
|
||||||
if (MBBICommon->mayLoad() || MBBICommon->mayStore())
|
if (MBBICommon->mayLoad() || MBBICommon->mayStore())
|
||||||
if (!hasIdenticalMMOs(&*MBBI, &*MBBICommon))
|
if (!hasIdenticalMMOs(&*MBBI, &*MBBICommon))
|
||||||
MBBICommon->clearMemRefs();
|
MBBICommon->dropMemRefs();
|
||||||
|
|
||||||
++MBBI;
|
++MBBI;
|
||||||
++MBBICommon;
|
++MBBICommon;
|
||||||
|
|
Loading…
Reference in New Issue