C++: Cache and fix join order in 'hasIncompleteSsa'.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-05-13 13:41:15 +01:00
parent c3c18bdbd2
commit 0836f0b413
2 changed files with 28 additions and 24 deletions

View File

@@ -731,6 +731,20 @@ private module Cached {
or
instruction = getChi(result.(UninitializedGroupInstruction))
}
/**
* Holds if the def-use information for `f` may have been omitted because it
* was too expensive to compute. This happens if one of the memory allocations
* in `f` is a busy definition (i.e., it has many different overlapping uses).
*/
pragma[nomagic]
cached
predicate hasIncompleteSsa(IRFunction f) {
exists(Alias::MemoryLocation0 defLocation |
Alias::isBusyDef(pragma[only_bind_into](defLocation)) and
defLocation.getIRFunction() = f
)
}
}
private Instruction getNewInstruction(OldInstruction instr) { getOldInstruction(result) = instr }
@@ -1319,18 +1333,6 @@ predicate canReuseSsaForMemoryResult(Instruction instruction) {
// We don't support reusing SSA for any location that could create a `Chi` instruction.
}
/**
* Holds if the def-use information for `f` may have been omitted because it
* was too expensive to compute. This happens if one of the memory allocations
* in `f` is a busy definition (i.e., it has many different overlapping uses).
*/
predicate hasIncompleteSsa(IRFunction f) {
exists(Alias::MemoryLocation0 defLocation |
Alias::isBusyDef(defLocation) and
defLocation.getIRFunction() = f
)
}
/**
* Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the
* `DebugSsa` module, which is then imported by PrintSSA.

View File

@@ -731,6 +731,20 @@ private module Cached {
or
instruction = getChi(result.(UninitializedGroupInstruction))
}
/**
* Holds if the def-use information for `f` may have been omitted because it
* was too expensive to compute. This happens if one of the memory allocations
* in `f` is a busy definition (i.e., it has many different overlapping uses).
*/
pragma[nomagic]
cached
predicate hasIncompleteSsa(IRFunction f) {
exists(Alias::MemoryLocation0 defLocation |
Alias::isBusyDef(pragma[only_bind_into](defLocation)) and
defLocation.getIRFunction() = f
)
}
}
private Instruction getNewInstruction(OldInstruction instr) { getOldInstruction(result) = instr }
@@ -1319,18 +1333,6 @@ predicate canReuseSsaForMemoryResult(Instruction instruction) {
// We don't support reusing SSA for any location that could create a `Chi` instruction.
}
/**
* Holds if the def-use information for `f` may have been omitted because it
* was too expensive to compute. This happens if one of the memory allocations
* in `f` is a busy definition (i.e., it has many different overlapping uses).
*/
predicate hasIncompleteSsa(IRFunction f) {
exists(Alias::MemoryLocation0 defLocation |
Alias::isBusyDef(defLocation) and
defLocation.getIRFunction() = f
)
}
/**
* Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the
* `DebugSsa` module, which is then imported by PrintSSA.