File tree Expand file tree Collapse file tree 6 files changed +50
-0
lines changed
cpp/ql/lib/semmle/code/cpp/ir/implementation Expand file tree Collapse file tree 6 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -58,4 +58,12 @@ class IRFunction extends IRFunctionBase {
5858 * Gets all blocks in this function.
5959 */
6060 final IRBlock getABlock ( ) { result .getEnclosingIRFunction ( ) = this }
61+
62+ /**
63+ * Holds if this function may have incomplete def-use information.
64+ *
65+ * Def-use information may be omitted for a function when it is too expensive
66+ * to compute.
67+ */
68+ final predicate hasIncompleteSsa ( ) { Construction:: hasIncompleteSsa ( this ) }
6169}
Original file line number Diff line number Diff line change @@ -1319,6 +1319,18 @@ predicate canReuseSsaForMemoryResult(Instruction instruction) {
13191319 // We don't support reusing SSA for any location that could create a `Chi` instruction.
13201320}
13211321
1322+ /**
1323+ * Holds if the def-use information for `f` may have been omitted because it
1324+ * was too expensive to compute. This happens if one of the memory allocations
1325+ * in `f` is a busy definition (i.e., it has many different overlapping uses).
1326+ */
1327+ predicate hasIncompleteSsa ( IRFunction f ) {
1328+ exists ( Alias:: MemoryLocation0 defLocation |
1329+ Alias:: isBusyDef ( defLocation ) and
1330+ defLocation .getIRFunction ( ) = f
1331+ )
1332+ }
1333+
13221334/**
13231335 * Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the
13241336 * `DebugSsa` module, which is then imported by PrintSSA.
Original file line number Diff line number Diff line change @@ -58,4 +58,12 @@ class IRFunction extends IRFunctionBase {
5858 * Gets all blocks in this function.
5959 */
6060 final IRBlock getABlock ( ) { result .getEnclosingIRFunction ( ) = this }
61+
62+ /**
63+ * Holds if this function may have incomplete def-use information.
64+ *
65+ * Def-use information may be omitted for a function when it is too expensive
66+ * to compute.
67+ */
68+ final predicate hasIncompleteSsa ( ) { Construction:: hasIncompleteSsa ( this ) }
6169}
Original file line number Diff line number Diff line change @@ -220,6 +220,8 @@ Instruction getMemoryOperandDefinition(
220220 none ( )
221221}
222222
223+ predicate hasIncompleteSsa ( IRFunction f ) { none ( ) }
224+
223225/**
224226 * Holds if the operand totally overlaps with its definition and consumes the
225227 * bit range `[startBitOffset, endBitOffset)`.
Original file line number Diff line number Diff line change @@ -58,4 +58,12 @@ class IRFunction extends IRFunctionBase {
5858 * Gets all blocks in this function.
5959 */
6060 final IRBlock getABlock ( ) { result .getEnclosingIRFunction ( ) = this }
61+
62+ /**
63+ * Holds if this function may have incomplete def-use information.
64+ *
65+ * Def-use information may be omitted for a function when it is too expensive
66+ * to compute.
67+ */
68+ final predicate hasIncompleteSsa ( ) { Construction:: hasIncompleteSsa ( this ) }
6169}
Original file line number Diff line number Diff line change @@ -1319,6 +1319,18 @@ predicate canReuseSsaForMemoryResult(Instruction instruction) {
13191319 // We don't support reusing SSA for any location that could create a `Chi` instruction.
13201320}
13211321
1322+ /**
1323+ * Holds if the def-use information for `f` may have been omitted because it
1324+ * was too expensive to compute. This happens if one of the memory allocations
1325+ * in `f` is a busy definition (i.e., it has many different overlapping uses).
1326+ */
1327+ predicate hasIncompleteSsa ( IRFunction f ) {
1328+ exists ( Alias:: MemoryLocation0 defLocation |
1329+ Alias:: isBusyDef ( defLocation ) and
1330+ defLocation .getIRFunction ( ) = f
1331+ )
1332+ }
1333+
13221334/**
13231335 * Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the
13241336 * `DebugSsa` module, which is then imported by PrintSSA.
You can’t perform that action at this time.
0 commit comments