File tree 6 files changed +50
-0
lines changed
cpp/ql/lib/semmle/code/cpp/ir/implementation 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 {
58
58
* Gets all blocks in this function.
59
59
*/
60
60
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 ) }
61
69
}
Original file line number Diff line number Diff line change @@ -1319,6 +1319,18 @@ predicate canReuseSsaForMemoryResult(Instruction instruction) {
1319
1319
// We don't support reusing SSA for any location that could create a `Chi` instruction.
1320
1320
}
1321
1321
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
+
1322
1334
/**
1323
1335
* Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the
1324
1336
* `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 {
58
58
* Gets all blocks in this function.
59
59
*/
60
60
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 ( ) { Construct
8000
ion:: hasIncompleteSsa ( this ) }
61
69
}
Original file line number Diff line number Diff line change @@ -220,6 +220,8 @@ Instruction getMemoryOperandDefinition(
220
220
none ( )
221
221
}
222
222
223
+ predicate hasIncompleteSsa ( IRFunction f ) { none ( ) }
224
+
223
225
/**
224
226
* Holds if the operand totally overlaps with its definition and consumes the
225
227
* bit range `[startBitOffset, endBitOffset)`.
Original file line number Diff line number Diff line change @@ -58,4 +58,12 @@ class IRFunction extends IRFunctionBase {
58
58
* Gets all blocks in this function.
59
59
*/
60
60
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 ) }
61
69
}
Original file line number Diff line number Diff line change @@ -1319,6 +1319,18 @@ predicate canReuseSsaForMemoryResult(Instruction instruction) {
1319
1319
// We don't support reusing SSA for any location that could create a `Chi` instruction.
1320
1320
}
1321
1321
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
+
1322
1334
/**
1323
1335
* Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the
1324
1336
* `DebugSsa` module, which is then imported by PrintSSA.
You can’t perform that action at this time.
0 commit comments