← Back to context

Comment by pizlonator

3 days ago

> There is a rematerialize pass, there is no real reason to couple it with register allocation

The reason to couple it to regalloc is that you only want to remat if it saves you a spill

Remat can produce a performance boost even when everything has a register.

Admittedly, this comes up more often in non-CPU backends.

  • > Remat can produce a performance boost even when everything has a register.

    Can you give an example?

    • Rematerializing 'safe' computation from across a barrier or thread sync/wait works wonders.

      Also loads and stores and function calls, but that's a bit finicky to tune. We usually tell people to update their programs when this is needed.

      1 reply →