Commit 93b0629
authored
Simplify branch hint instrumentation (#8624)
The previous branch hint instrumentation logic would introduce a scratch
local to hold the condition so it could be passed into both the logging
function and the original branching instruction. The de-instrumentation
pass would then need to find this local and attempt to undo the data
flow change. Simplify all of this by having the logging function return
the condition value so it can interpose between the condition and the
branch without any new locals. De-instrumentation can now just replace
the call to the log function with its condition parameter.
To allow further simplification, also change the order of parameters to
the logging function so the condition value is the first parameter. This
ensures that we don't need to introduce a scratch local even when the
condition is a `pop`, because the pop will remain the leftmost leaf
expression in the catch body.1 parent b3650ea commit 93b0629
File tree
8 files changed
+158
-561
lines changed- scripts
- src
- passes
- tools
- test/lit
- passes
8 files changed
+158
-561
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2281 | 2281 | | |
2282 | 2282 | | |
2283 | 2283 | | |
2284 | | - | |
| 2284 | + | |
2285 | 2285 | | |
2286 | 2286 | | |
2287 | 2287 | | |
| |||
2443 | 2443 | | |
2444 | 2444 | | |
2445 | 2445 | | |
2446 | | - | |
| 2446 | + | |
2447 | 2447 | | |
2448 | 2448 | | |
2449 | 2449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
404 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| |||
0 commit comments