Post #2937844
2026-05-14 02:13 UTC
@cda@macaw.social I could treat tiny structs like sized arrays & slices as pass-by-stack, but I'd rather have them be (nearly) as inexpensive as raw pointers would be, so I'm hoping to just keep them in registers all the way.
I gather LLVM's approach (to SSA generation) is start everything as memory hosted and them shuffle them up into registers, which does seem like it might simplify this sort of thing.
Though right now I'm implementing actual register allocation, so all this must wait a bit longer.
Replies (1)
-
@cda@macaw.social 2026-05-14 05:31
@swetland@chaos.social Speaking of... I just noticed this right now in an old experiment IR dump. Clang modified a function to take a decomposed struct...basic but along the lines of your topic...I guess I hadn't really thought through this level of things yet as I have mostly been playing with higher-level language ideas. ` void takes_val(struct str str_val) { ` (struct str is just an int and a pointer in this experiment)