On 11/13/26 3:36 PM, Trevor Saunders wrote:
A quick LLM investigation suggested that allmost all gen_<foo> callers
immediately pass the result to emit_* constructing the insn wrapper if
only a pattern is returned from gen_foo, so I wonder if we can switch
entirely to have the generated code return a complete insn not just the
pattern. A comment in genemit said returning just the pattern was to
save memory but that concern doesn't make much sense given the caller
per above allocates that extra memory for the insn in almost all cases
anyway? or am I missing something?
I think I've seen that comment at some point in the past. I don't think
you're missing anything -- that behavior has been around for multiple
decades. That doesn't mean we can't move forward, it just means there
was a time when this behavior was believed to be important. So we just
want to be careful and sensible.
The vast majority of the time I expect expanders are returning simple
patterns that we than pass along to emit_XXX.
jeff