[llvm] r187511 - TableGen: Enumerate Schedule Model too.

Tom Stellard tom at stellard.net
Wed Jul 31 13:51:21 PDT 2013


On Wed, Jul 31, 2013 at 07:31:21PM -0000, Vincent Lejeune wrote:
> Author: vljn
> Date: Wed Jul 31 14:31:20 2013
> New Revision: 187511
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=187511&view=rev
> Log:
> TableGen: Enumerate Schedule Model too.
> 

Hi Vincent,

I had to revert this plus two of the related R600 commits, because it
broke the build of the ARM target.  I think you will need to wrap the
SchedModel enum in its own namespace, because some of the ARM
SchedModels have the same name as instructions.

-Tom

> Modified:
>     llvm/trunk/docs/WritingAnLLVMBackend.rst
>     llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
> 
> Modified: llvm/trunk/docs/WritingAnLLVMBackend.rst
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMBackend.rst?rev=187511&r1=187510&r2=187511&view=diff
> ==============================================================================
> --- llvm/trunk/docs/WritingAnLLVMBackend.rst (original)
> +++ llvm/trunk/docs/WritingAnLLVMBackend.rst Wed Jul 31 14:31:20 2013
> @@ -952,6 +952,11 @@ XXXInstrInfo.h:
>      int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIndex);
>    } // End namespace XXX
>  
> +Instruction itineraries can be queried using MCDesc::getSchedClass(). The
> +value can be named by an enum generated by TableGen in XXXGenInstrInfo.inc.
> +The name of the schedule classes are the same as provided in XXXSchedule.td plus
> +a default NoIntinerary class.
> +
>  Instruction Relation Mapping
>  ----------------------------
>  
> 
> Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=187511&r1=187510&r2=187511&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Wed Jul 31 14:31:20 2013
> @@ -545,6 +545,13 @@ void InstrInfoEmitter::emitEnums(raw_ost
>         << "\t= " << i << ",\n";
>    }
>    OS << "    INSTRUCTION_LIST_END = " << NumberedInstructions.size() << "\n";
> +  OS << "  };\n";
> +  OS << "  enum {\n";
> +  for (unsigned i = 0, e = SchedModels.numInstrSchedClasses(); i != e; ++i) {
> +    OS << "    " << SchedModels.getSchedClass(i).Name
> +       << "\t= " << i << ",\n";
> +  }
> +  OS << "    SCHED_LIST_END = " << SchedModels.numInstrSchedClasses() << "\n";
>    OS << "  };\n}\n";
>    OS << "} // End llvm namespace \n";
>  
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list