You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warn("Unknown profile for %s with f=%s in hot loop %s, NO NODE SOURCE POSITION%n\tPotential Action Item: Determine lack of node source position and profile.%n", ifNode,
299
+
warn(optionValues,
300
+
"Unknown profile for %s with relativeFrequency=%s in hot loop %s, NO NODE SOURCE POSITION%n\tPotential Action Item: Determine lack of node source position and profile.%n",
301
+
ifNode,
287
302
cfg.blockFor(inside).getRelativeFrequency(), l);
288
303
} else {
289
-
warn("Unknown profile for %s with f=%s in hot loop %s, nsp is %n%s%n\tPotential Action Item: Add profile to the top-of-stack source location.%n", ifNode,
304
+
warn(optionValues,
305
+
"Unknown profile for %s with relativeFrequency=%s in hot loop %s, node source position is %n%s%n\tPotential Action Item: Add profile to the top-of-stack source location.%n",
warn("If %s with condition %s is inside loop %s while condition is not%n\tPotential Action Item: Determine why compiler does not unswitch the loop.%n", ifNode, logicNode, l);
326
+
warn(logicNode.getOptions(), "If %s with condition %s is inside loop %s while condition is not%n\tPotential Action Item: Determine why compiler does not unswitch the loop.%n", ifNode,
327
+
logicNode, l);
310
328
}
311
329
}
312
330
}
313
331
314
332
/**
315
333
* Reports memory kill operations within a specified hot loop that target
warn("Node %s kills any and has relative f=%s in loop %s %n\tPotential Action Item: Determine if operation is required and replace with less intrusive memory effect if possible.%n",
353
+
warn(inside.getOptions(),
354
+
"Node %s kills any and has relative relativeFrequency=%s in loop %s %n\tPotential Action Item: Determine if operation is required and replace with less intrusive memory effect if possible.%n",
warn("Guard %s condition %s inside loop with iv %s and limit %s%n\tPotential Action Item: Determine why speculative guard movement does not consider them for optimization.%n", inside,
383
-
compare, iv, limit);
401
+
warn(inside.getOptions(),
402
+
"Guard %s condition %s inside loop with iv %s and limit %s%n\tPotential Action Item: Determine why speculative guard movement does not consider them for optimization.%n",
Copy file name to clipboardExpand all lines: truffle/docs/Optimizing.md
+5-8Lines changed: 5 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -805,7 +805,7 @@ The most common causes are:
805
805
806
806
The `--engine.TraceCompilation` option also shows CallTarget invalidations with an `[engine] opt inv.` prefix.
807
807
808
-
## Debugging Compiler Optimization Potential
808
+
## Uncovering Optimization Barriers: Compiler-Level Insights for Truffle Apps
809
809
810
810
Once you are comfortable profiling Truffle applications and analyzing results (see [Profiling](Profiling.md)), you may reach a point where you wonder, “Why is this benchmark slower than expected?”
811
811
After determining that the majority of execution time is spent in compiled code, the next step is a deeper analysis of the generated machine code.
@@ -826,19 +826,16 @@ To enable reporting of these metrics, launch your application with:
826
826
```
827
827
This prints warnings and hot spots to `stdout` for all compilation units.
828
828
829
-
To narrow output to specific methods or functions use known method names like:
829
+
To narrow the output to specific methods or functions, use known method names like `*wasm-function:5311*`:
[Hot Code Info] Hottest 1 local loops are Blocks=[Loop (depth=1) 4951258|LoopBegin] LocalLoopFrequencies=[241.99999999999716]
840
-
[Hot Code Info] Hottest 1 global loops are Blocks=[Loop (depth=1) 4951258|LoopBegin] BasicBlockFrequencies=[241.99984874999717]
841
-
[Hot Code Warning] Unknown profile for 704|If with f=241.99984874999717 in hot loop Loop (depth=1) 4951258|LoopBegin, nsp is
838
+
[Hot Code Warning] Unknown profile for 704|If with f=241.99984874999717 in hot loop Loop (depth=1) 4951258|LoopBegin, node source position is
842
839
at org.graalvm.wasm.nodes.WasmFunctionNode.executeBodyFromOffset(WasmFunctionNode.java:363) [bci: 1654]
843
840
at org.graalvm.wasm.nodes.WasmFunctionNode.execute(WasmFunctionNode.java:241) [bci: 15]
844
841
[...cut for brevity...]
@@ -850,7 +847,7 @@ Reporting hot metrics before HighTierLoweringPhase during compilation of wasm-fu
850
847
* “Local frequency” is the number of times the block is executed per loop iteration.
851
848
* “Global frequency” is across the entire method. A value of 1 means the basic block executes once per method invocation.
852
849
* `[Hot Code Warning]` denotes locations or IR patterns that may inhibit optimization.
853
-
* Warnings include, for example, missing profile data in hot paths (e.g., `unknown profile for 704|If …`), which is a common actionable warning.
850
+
* Warnings include, for example, missing profile data in hot paths (for example, `unknown profile for 704|If …`), which is a common actionable warning.
854
851
855
852
Some warnings may be actionable, while others are for informational purposes. If you encounter frequent or unexplained compiler warnings in your hottest methods and are unsure how to proceed, please reach out to the Truffle community via our Slack channels for advice.
0 commit comments