C++: pull out hasMemoryOperandDefinition (slow)

This commit is contained in:
Robert Marsh
2020-01-08 13:45:59 -08:00
parent c7e62b4a35
commit d91bc4ba72

View File

@@ -75,6 +75,22 @@ private module Cached {
)
}
private predicate hasMemoryOperandDefinition (OldInstruction oldInstruction, OldIR::NonPhiMemoryOperand oldOperand,
Overlap overlap, Instruction instr) {
oldOperand = oldInstruction.getAnOperand() and
exists(
OldBlock useBlock, int useRank, Alias::MemoryLocation useLocation,
Alias::MemoryLocation defLocation, OldBlock defBlock, int defRank, int defOffset
|
useLocation = Alias::getOperandMemoryLocation(oldOperand) and
hasDefinitionAtRank(useLocation, defLocation, defBlock, defRank, defOffset) and
hasUseAtRank(useLocation, useBlock, useRank, oldInstruction) and
definitionReachesUse(useLocation, defBlock, defRank, useBlock, useRank) and
overlap = Alias::getOverlap(defLocation, useLocation) and
instr = getDefinitionOrChiInstruction(defBlock, defOffset, defLocation, _)
)
}
cached
Instruction getMemoryOperandDefinition(
Instruction instruction, MemoryOperandTag tag, Overlap overlap
@@ -87,17 +103,7 @@ private module Cached {
(
if exists(Alias::getOperandMemoryLocation(oldOperand))
then
exists(
OldBlock useBlock, int useRank, Alias::MemoryLocation useLocation,
Alias::MemoryLocation defLocation, OldBlock defBlock, int defRank, int defOffset
|
useLocation = Alias::getOperandMemoryLocation(oldOperand) and
hasDefinitionAtRank(useLocation, defLocation, defBlock, defRank, defOffset) and
hasUseAtRank(useLocation, useBlock, useRank, oldInstruction) and
definitionReachesUse(useLocation, defBlock, defRank, useBlock, useRank) and
overlap = Alias::getOverlap(defLocation, useLocation) and
result = getDefinitionOrChiInstruction(defBlock, defOffset, defLocation, _)
)
hasMemoryOperandDefinition(oldInstruction, oldOperand, overlap, result)
else (
result = instruction.getEnclosingIRFunction().getUnmodeledDefinitionInstruction() and
overlap instanceof MustTotallyOverlap