Commit 8c06a68
committed
C++ IR: Remove redundant check for same function
The check that an instruction is in the same function as its operands is
hopefully redundant and can be removed. Just to be sure, I've added the
check to a sanity query.
This check turned out to cause bad performance in the alias analysis
because it got inlined into `AliasAnalysis::resultEscapes` and then
pulled out to a loop-invariant predicate that got a bad join order. With
this check removed, the `ssa/AliasAnalysis.qll` file is orders of
magnitude faster.1 parent badb167 commit 8c06a68
File tree
3 files changed
+21
-3
lines changed- cpp/ql/src/semmle/code/cpp
- ir/internal
- ssa/internal
- aliased_ssa
- ssa
3 files changed
+21
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
| |||
302 | 309 | | |
303 | 310 | | |
304 | 311 | | |
305 | | - | |
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
| |||
302 | 309 | | |
303 | 310 | | |
304 | 311 | | |
305 | | - | |
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
| |||
302 | 309 | | |
303 | 310 | | |
304 | 311 | | |
305 | | - | |
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
| |||
0 commit comments