Small fixes to soa.h and fixed_point.h - #442
Merged
Merged
Conversation
Changes from pragma unrolled loops into recursive tail call functions in order to make the debugging info created for these lines simpler. With pragma unroll, I noticed that the debug info could not resolve the soa inlined accessors properly because the unrolling destroyed the line information during an optimization pass. This new approach performs identically (as LLVM properly unrolls the recursion) and retains the debug information in my testing.
This allows users to use the FixedPoint class in classes that require trivial types such as Soa structs. This is safe because the previous constructors only did a byte for byte copy anyway (the default behavior)
This was silently broken before due to the infrequent use of division on the platform
mysterymath
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See each commit for a description of the changes made. I did not add any new llvm-lit tests for the soa.h changes, but I did write some in case we want to add that. llvm-mos/llvm-test-suite#19 For the fixed_point.h changes, I added some new division tests here.
This fixes a few issues I've ran into over the years that I've patched locally and decided to finally stop being lazy and upstream them.
Some extra notes
soa.hstructs.array[1] = 0x10;for instance, that would have no line information afaict (i could also just be bad at understanding dwarf, but this change kept the same optimized output, while retaining source info in my testing)