mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
C++: Cache and fix join order in 'hasIncompleteSsa'.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user