[LLVMdev] How to assign a constant to a register?

Arnaud Allard de Grandmaison Arnaud.AllardDeGrandMaison at dibcom.com
Tue Oct 19 00:19:59 PDT 2010


> But if the usage was in a loop it would be better (at the cost of
> register pressure) to materialise 5 into a register outside of the
> loop and use the register repeatedly in the loop.

Bouncing on this subject: you can not know before isel is over if the constants have to materialize into registers or not, as this is really dependent on the target's instruction set. Do we have any pass hoisting the constant loading out of the (inner) loops after isel ? I guess this could be beneficial for most targets --- assuming the pass does not increase the register pressure to some unreasonnable level.

--
Arnaud de Grandmaison




More information about the llvm-dev mailing list