C++/C#: Sync identical files

This commit is contained in:
Mathias Vorreiter Pedersen
2020-02-14 16:11:57 +01:00
parent 4a7b865dc0
commit 8b8a8cae5b
4 changed files with 28 additions and 6 deletions

View File

@@ -61,14 +61,12 @@ newtype TValueNumber =
*/
class CongruentCopyInstruction extends CopyInstruction {
CongruentCopyInstruction() {
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustExactlyOverlap
}
}
class LoadTotalOverlapInstruction extends LoadInstruction {
LoadTotalOverlapInstruction() {
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustTotallyOverlap
}
}

View File

@@ -61,14 +61,12 @@ newtype TValueNumber =
*/
class CongruentCopyInstruction extends CopyInstruction {
CongruentCopyInstruction() {
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustExactlyOverlap
}
}
class LoadTotalOverlapInstruction extends LoadInstruction {
LoadTotalOverlapInstruction() {
strictcount(this.getSourceValueOperand().getDefinitionOverlap()) = 1 and
this.getSourceValueOperand().getDefinitionOverlap() instanceof MustTotallyOverlap
}
}

View File

@@ -96,7 +96,7 @@ private module Cached {
}
cached
Instruction getMemoryOperandDefinition(
private Instruction getMemoryOperandDefinition0(
Instruction instruction, MemoryOperandTag tag, Overlap overlap
) {
exists(OldInstruction oldInstruction, OldIR::NonPhiMemoryOperand oldOperand |
@@ -142,6 +142,19 @@ private module Cached {
overlap instanceof MustExactlyOverlap
}
cached
Instruction getMemoryOperandDefinition(
Instruction instruction, MemoryOperandTag tag, Overlap overlap
) {
// getMemoryOperandDefinition0 currently has a bug where it can match with multiple overlaps.
// This predicate ensures that the chosen overlap is the most conservative if there's any doubt.
result = getMemoryOperandDefinition0(instruction, tag, overlap) and
not (
overlap instanceof MustExactlyOverlap and
exists(MustTotallyOverlap o | exists(getMemoryOperandDefinition0(instruction, tag, o)))
)
}
/**
* Holds if `instr` is part of a cycle in the operand graph that doesn't go
* through a phi instruction and therefore should be impossible.