[llvm-commits] [llvm] r69382 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
Anton Korobeynikov
anton at korobeynikov.info
Fri Apr 17 13:46:28 PDT 2009
Hi, Bob
> +/// AddLiveIn - This helper function adds the specified physical register to the
> +/// MachineFunction as a live-in value. It also creates a corresponding virtual
> +/// register for it.
> +static unsigned AddLiveIn(MachineFunction &MF, unsigned PReg,
> + const TargetRegisterClass *RC) {
> + assert(RC->contains(PReg) && "Not the correct regclass!");
> + unsigned VReg = MF.getRegInfo().createVirtualRegister(RC);
> + MF.getRegInfo().addLiveIn(PReg, VReg);
> + return VReg;
> +}
The same function exists in x86 backend. And this sequence of actions
is pretty typical for ISD::FORMAL_NODE lowering. Maybe it's worth to
place it somewhere in common place?
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
More information about the llvm-commits
mailing list