[llvm-commits] [llvm] r82503 - /llvm/trunk/lib/CodeGen/LowerSubregs.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Sep 23 12:09:15 PDT 2009


On 22/09/2009, at 08.23, Evan Cheng wrote:
> On Sep 21, 2009, at 9:50 PM, Jakob Stoklund Olesen wrote:
>
>> Evan Cheng <evan.cheng at apple.com> writes:
>>
>>> Minor bug fix. LowerSubregs should translate
>>> %S0<def> = EXTRACT_SUBREG %Q0<kill>, 1
>>> to
>>> %S0<def> = IMPLICIT_DEF %Q0<imp-use,kill>
>>>
>> Is IMPLICIT_DEF variadic? Otherwise, the machine code verifier should
>> have caught this.
>
> It's not variadic. I am not sure why the machine verifier didn't  
> catch this.

Here is why. In the verifier:

   if (!TI.isVariadic()) {
     if (MI->getNumExplicitOperands() > TI.getNumOperands()) {
       report("Too many operands", MI);

In MachineInstr:

unsigned MachineInstr::getNumExplicitOperands() const {
   unsigned NumOperands = TID->getNumOperands();
   if (!TID->isVariadic())
     return NumOperands;

I'll fix the verifier.

/stoklund




More information about the llvm-commits mailing list