Search Issue Tracker
By Design
By Design in 1.8.X
Votes
1
Found in [Package]
1.8.19
Issue ID
BUR-2819
Regression
No
Burst Compiler Fails To Inline Generic Type Method
Reproduction steps:
1. Open the attached “IN-89539_Burst Inline Bug.zip“ project
2. Open Burst Inspector (Jobs > Burst > Open Inspector…)
3. Select the “NoiseTestJob32“ under the “NoiseTesting” category
4. Observe
Expected result: Functions are inlined
Actual result: Functions are not inlined, nearing the bottom “bl“ calls are seen
Reproducible with: 1.8.19 (2022.3.57f1, 6000.0.37f1, 6000.1.0b5, 6000.2.0a2)
Reproducible on: Windows 10 (User’s platform), M1 Max MacOS 15.1.1 (Tested by CQA)
Not reproducible on: No other environment tested
Comments (2)
-
chadfranklin47
Feb 20, 2025 00:17
Just some added context:
Burst changelog [1.0.1]:
(the link should be allowed according to the list of validated links, but it gives me an error when trying to include it)
states “Add support for MethodImplOptions.AggressiveInlining to force inlining.“Inlining optimizations are a necessity here.
-
chadfranklin47
Feb 07, 2025 22:35
It seems this issue has been placed in the wrong package. It should be in the Burst package.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "DirectoryNotFoundException" is thrown and Shader Graph does not open when opening a .shadegraph from a long path
- “Full Screen Pass Renderer Feature_Old GUID” text is cut off in Renderer Features window
- "Undo: Already found nextRootTransform, but with different state cached" error thrown when undoing changes made to the Hierarchy using a script
- "No GUI Implemented" is displayed when using PhysicsMask with a CustomEditor
- "Report is from another project" popup warning is shown on domain reload when Project Auditor was previously ran in a different project
Resolution Note:
In the provided code, the interface is implemented implicitly. This causes the C# compiler to generate an intermediate forwarding method, which does not have the AggressiveInlining attribute. As a result, Burst treats it as a regular method, and the underlying LLVM compiler does not force inlining.
To address this issue, we recommend explicitly implementing the interface. Explicit implementation eliminates the need for a forwarding method, ensuring that it does not prevent inlining.
Keep in mind that Burst provides the LLVM compiler a strong hint to inline methods marked with the AggressiveInlining attribute, but it does not guarantee that they will get inlined.
Resolution Note (1.8.X):
In the provided code, the interface is implemented implicitly. This causes the C# compiler to generate an intermediate forwarding method, which does not have the AggressiveInlining attribute. As a result, Burst treats it as a regular method, and the underlying LLVM compiler does not force inlining.
To address this issue, we recommend explicitly implementing the interface. Explicit implementation eliminates the need for a forwarding method, ensuring that it does not prevent inlining.
Keep in mind that Burst provides the LLVM compiler a strong hint to inline methods marked with the AggressiveInlining attribute, but it does not guarantee that they will get inlined.