summaryrefslogtreecommitdiff
path: root/docs/regalloc.md
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-04-29 15:54:37 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2025-04-29 15:54:37 -0400
commitf2c603a4994d4e12e97c7fcd1f910798b19ffa71 (patch)
tree94865058eac331363d741c6a4946cbe8364a4a64 /docs/regalloc.md
parent533955ebf67bb23976dc5f29a2726903fe861234 (diff)
Mention `ninja changes` in regalloc tutorial
Diffstat (limited to 'docs/regalloc.md')
-rw-r--r--docs/regalloc.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/regalloc.md b/docs/regalloc.md
index 7ea687e5..c0115db6 100644
--- a/docs/regalloc.md
+++ b/docs/regalloc.md
@@ -112,7 +112,9 @@ Sometimes, instead of writing a single line that does multiple things at once, y
Inlines can affect regalloc, so be sure that you're using the exact inlines mentioned in the debug maps. Also try using inlines used in other functions from the same object, or inlines used in similar functions from a different object.
-If you're sure that you're using the right inline, but there are still regswaps happening in the area of the function where the inline is used, the cause can sometimes be that the inline itself is implemented wrong. You may have to try modifying the inline and write the code inside it differently in order to fix the regalloc in the functions that use it. But when doing this, be careful that you don't break any already-matched functions that use the same inline you're modifying.
+If you're sure that you're using the right inline, but there are still regswaps happening in the area of the function where the inline is used, the cause can sometimes be that the inline itself is implemented wrong. You may have to try modifying the inline and write the code inside it differently in order to fix the regalloc in the functions that use it.
+
+But when modifying an existing inline, be careful that you don't break any already-matched functions that use the same inline. If you want to quickly check if you caused any regressions, first run `ninja baseline` on the main branch, then run `ninja changes` on your own branch, and any functions that decreased in match percent on your branch will be printed out.
## Const
@@ -132,4 +134,4 @@ However, `f32` is a primitive type. So the following is another possibility for
TVec3(const f32 x, const f32 y, const f32 z)
```
-You may need to try adding or removing const from inlines like this, but be careful that you don't break any already-matched functions that use the same inline you're modifying.
+You may need to try adding or removing const from inlines like this, but be careful that you don't break any already-matched functions that use the same inline you're modifying. Again, you can use `ninja changes` to check if you caused any regressions.