[LLVMdev] Querying instruction classes

Evandro Menezes emenezes at codeaurora.org
Mon Nov 28 18:44:58 PST 2011


Jim,

That's what I thought of initially, but with it I can only get to the 
InstrItinerary for a given instruction which is fine, but I can't call 
it by an arbitrary label.

The reason I need this is because the array of InstrItinerary is built 
arbitrarily by tablegen.  So while, say, ALU instructions are the 2nd 
item in this array, ALU instructions cannot be scheduled together with, 
say, loads, the 9th item in this array, I'd rather not hard-code the 
check for the result of getSchedClass to be "2" or "9", but something 
more readable like "MyALU" or "MyLD".

I think that I could provide this extra information as a bit-field in 
TSFlags.  But I was hoping that tablegen would give me an enum for the 
InstrInstClass corresponding to its position in the InstrItinerary array.

Thanks,

-- 
Evandro Menezes        Austin, TX        emenezes at codeaurora.org
Qualcomm Innovation Center, Inc is a member of Code Aurora Forum


On 11/28/11 19:21, Jim Grosbach wrote:
 > Hello,
 >
 > I believe MCInstrDesc::getSchedClass() is what you're looking for.
 >
 > -Jim
 >
 > On Nov 28, 2011, at 5:03 PM, Evandro Menezes wrote:
 >
 >> I'd appreciate some help in figuring out how to determine which
 >> InstrItinClass an instruction belongs to.
 >>
 >> For example, an InstrItinClass is defined in Schedule.td as:
 >>
 >> def FOO : InstrItinClass;
 >>
 >> Which is then used to build an InstrItinData in ProcessorItineraries and
 >> to specify the class of a particular instruction.
 >>
 >> I'd like to find out from a given instruction which class it belongs to,
 >> "FOO" or any other.
 >>
 >> TIA
 >>
 >> --
 >> Evandro Menezes        Austin, TX        emenezes at codeaurora.org
 >> Qualcomm Innovation Center, Inc is a member of Code Aurora Forum
 >>
 >> _______________________________________________
 >> LLVM Developers mailing list
 >> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
 >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
 >



More information about the llvm-dev mailing list