@pskocik tbh using an rsp clobber just to dirty the scratch space was always an awful sledgehammer. nice that prologue/epilogue gen leaves the leaf frame alone w.r.t frame pointers so CFA tracking doesnt implode just for a zero overhead ABI call
a girl no older than 10 came into my store and out of nowhere i heard her go "x86_64, x86_64, you can call me x86_64"
so, naturally, i walked over to her, bent down to her level and asked "are you larping, or can you tell me what prevents memory disambiguation?"
when she couldn't, i kicked her out #GateKEPT
keeping these speculative bc the same access pattern could be an array union packed object or interior pointer. the pass retains each load/store as provenance and rejects indexed addresses/phi merges unless every input resolves to the same base + displacement
extended on the scalar type pass with layout recovery that walks SSA def chains to normalise addresses into base + displacement then groups memory ops into field candidates keyed by offset and width. 64 bit loads reused as bases add edges between layout candidates
same constraint sensitivity shows up with type boundaries too btw. canonicalise folds memref.dim to 4 through a cast while the source still carries memref<?x4xf32> but once the function argument is already memref<?x?xf32> theres no static extent left to recover
disc handles the broader problem since it carries shape constraints explicitly across lowering so later optimisation/codegen still have them https://t.co/j1M6r711Wx
@CaptionOfNone like for example rn I'm inferring widths from loads but I want to track accesses through the same base pointer so their offsets and widths can start to suggest a struct layout
@CaptionOfNone for now yeah. the idea (or at least what I'm going for) is build on scalar hints with constraints from loads/stores to recover field layouts + pointer relationships
@theodorvaryag thanks chris :) i added OCaml primarily bc i wanted the recovered representation to be useful as an actual typed IR rather than just another pseudocode rendering so having something w ADTs/pattern matching makes writing transformations over it pretty natural (and less aids lmao)