[LLVMdev] implicit register usage

Jim Grosbach grosbach at apple.com
Wed Feb 20 13:27:35 PST 2013


On Feb 20, 2013, at 1:22 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:

> 
> On Feb 20, 2013, at 11:44 AM, Jim Grosbach <grosbach at apple.com> wrote:
> 
>> I'm not sure. It certainly seems reasonable to me that the building could/should set default Define flags on operands based on the MCInstrDesc. Dunno why it doesn't.
> 
> Once you move beyond the fixed operands, it can't be determined automatically if the added register should be a use or a def.

Yes, very true. It seems the builder should use the information for the fixed operands, though? Or at least perhaps the machine verifier should check that they match what's actually on the operands (does it currently?). Right now it's pretty easy to construct an MI that's inconsistent with its MCInstrDesc information.
-Jim

> 
> But I think it would be convenient to add addUse() and addDef() methods to MachineInstrBuilder, instead of requiring the tedious addReg(..., RegState::Define).
> 
> /jakob
> 




More information about the llvm-dev mailing list