1435897b4Spython3kgae //===- DXILEmitter.cpp - DXIL operation Emitter ---------------------------===// 2435897b4Spython3kgae // 3435897b4Spython3kgae // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4435897b4Spython3kgae // See https://llvm.org/LICENSE.txt for license information. 5435897b4Spython3kgae // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6435897b4Spython3kgae // 7435897b4Spython3kgae //===----------------------------------------------------------------------===// 8435897b4Spython3kgae // 9435897b4Spython3kgae // DXILEmitter uses the descriptions of DXIL operation to construct enum and 10435897b4Spython3kgae // helper functions for DXIL operation. 11435897b4Spython3kgae // 12435897b4Spython3kgae //===----------------------------------------------------------------------===// 13435897b4Spython3kgae 140d2dde20SXiang Li #include "SequenceToOffsetTable.h" 15435897b4Spython3kgae #include "llvm/ADT/STLExtras.h" 16435897b4Spython3kgae #include "llvm/ADT/SmallVector.h" 17435897b4Spython3kgae #include "llvm/ADT/StringSet.h" 180d2dde20SXiang Li #include "llvm/ADT/StringSwitch.h" 19435897b4Spython3kgae #include "llvm/TableGen/Error.h" 20435897b4Spython3kgae #include "llvm/TableGen/Record.h" 21435897b4Spython3kgae 22435897b4Spython3kgae using namespace llvm; 23435897b4Spython3kgae 24435897b4Spython3kgae namespace { 25435897b4Spython3kgae 26435897b4Spython3kgae struct DXILShaderModel { 27435897b4Spython3kgae int Major; 28435897b4Spython3kgae int Minor; 29435897b4Spython3kgae }; 30435897b4Spython3kgae struct DXILParam { 31435897b4Spython3kgae int Pos; // position in parameter list 32435897b4Spython3kgae StringRef Type; // llvm type name, $o for overload, $r for resource 33435897b4Spython3kgae // type, $cb for legacy cbuffer, $u4 for u4 struct 34435897b4Spython3kgae StringRef Name; // short, unique name 35435897b4Spython3kgae StringRef Doc; // the documentation description of this parameter 36435897b4Spython3kgae bool IsConst; // whether this argument requires a constant value in the IR 37435897b4Spython3kgae StringRef EnumName; // the name of the enum type if applicable 38435897b4Spython3kgae int MaxValue; // the maximum value for this parameter if applicable 39435897b4Spython3kgae DXILParam(const Record *R) { 40435897b4Spython3kgae Name = R->getValueAsString("name"); 41435897b4Spython3kgae Pos = R->getValueAsInt("pos"); 42435897b4Spython3kgae Type = R->getValueAsString("llvm_type"); 43435897b4Spython3kgae if (R->getValue("doc")) 44435897b4Spython3kgae Doc = R->getValueAsString("doc"); 45435897b4Spython3kgae IsConst = R->getValueAsBit("is_const"); 46435897b4Spython3kgae EnumName = R->getValueAsString("enum_name"); 47435897b4Spython3kgae MaxValue = R->getValueAsInt("max_value"); 48435897b4Spython3kgae } 49435897b4Spython3kgae }; 50435897b4Spython3kgae 51435897b4Spython3kgae struct DXILOperationData { 52435897b4Spython3kgae StringRef Name; // short, unique name 53435897b4Spython3kgae 54435897b4Spython3kgae StringRef DXILOp; // name of DXIL operation 55435897b4Spython3kgae int DXILOpID; // ID of DXIL operation 56435897b4Spython3kgae StringRef DXILClass; // name of the opcode class 57435897b4Spython3kgae StringRef Category; // classification for this instruction 58435897b4Spython3kgae StringRef Doc; // the documentation description of this instruction 59435897b4Spython3kgae 60435897b4Spython3kgae SmallVector<DXILParam> Params; // the operands that this instruction takes 61435897b4Spython3kgae StringRef OverloadTypes; // overload types if applicable 62435897b4Spython3kgae StringRef FnAttr; // attribute shorthands: rn=does not access 63264c09b7SXiang Li // memory,ro=only reads from memory 64264c09b7SXiang Li StringRef Intrinsic; // The llvm intrinsic map to DXILOp. Default is "" which 65264c09b7SXiang Li // means no map exist 66435897b4Spython3kgae bool IsDeriv; // whether this is some kind of derivative 67435897b4Spython3kgae bool IsGradient; // whether this requires a gradient calculation 68435897b4Spython3kgae bool IsFeedback; // whether this is a sampler feedback op 69435897b4Spython3kgae bool IsWave; // whether this requires in-wave, cross-lane functionality 70435897b4Spython3kgae bool RequiresUniformInputs; // whether this operation requires that all 71435897b4Spython3kgae // of its inputs are uniform across the wave 72435897b4Spython3kgae SmallVector<StringRef, 4> 73435897b4Spython3kgae ShaderStages; // shader stages to which this applies, empty for all. 74435897b4Spython3kgae DXILShaderModel ShaderModel; // minimum shader model required 75435897b4Spython3kgae DXILShaderModel ShaderModelTranslated; // minimum shader model required with 76435897b4Spython3kgae // translation by linker 77435897b4Spython3kgae SmallVector<StringRef, 4> counters; // counters for this inst. 78435897b4Spython3kgae DXILOperationData(const Record *R) { 79435897b4Spython3kgae Name = R->getValueAsString("name"); 80435897b4Spython3kgae DXILOp = R->getValueAsString("dxil_op"); 81435897b4Spython3kgae DXILOpID = R->getValueAsInt("dxil_opid"); 82435897b4Spython3kgae DXILClass = R->getValueAsDef("op_class")->getValueAsString("name"); 83435897b4Spython3kgae Category = R->getValueAsDef("category")->getValueAsString("name"); 84435897b4Spython3kgae 85264c09b7SXiang Li if (R->getValue("llvm_intrinsic")) { 86264c09b7SXiang Li auto *IntrinsicDef = R->getValueAsDef("llvm_intrinsic"); 87264c09b7SXiang Li auto DefName = IntrinsicDef->getName(); 88264c09b7SXiang Li assert(DefName.startswith("int_") && "invalid intrinsic name"); 89264c09b7SXiang Li // Remove the int_ from intrinsic name. 90264c09b7SXiang Li Intrinsic = DefName.substr(4); 91264c09b7SXiang Li } 92264c09b7SXiang Li 93435897b4Spython3kgae Doc = R->getValueAsString("doc"); 94264c09b7SXiang Li 95435897b4Spython3kgae ListInit *ParamList = R->getValueAsListInit("ops"); 96435897b4Spython3kgae for (unsigned i = 0; i < ParamList->size(); ++i) { 97435897b4Spython3kgae Record *Param = ParamList->getElementAsRecord(i); 98435897b4Spython3kgae Params.emplace_back(DXILParam(Param)); 99435897b4Spython3kgae } 100435897b4Spython3kgae OverloadTypes = R->getValueAsString("oload_types"); 101435897b4Spython3kgae FnAttr = R->getValueAsString("fn_attr"); 102435897b4Spython3kgae } 103435897b4Spython3kgae }; 104435897b4Spython3kgae } // end anonymous namespace 105435897b4Spython3kgae 106435897b4Spython3kgae static void emitDXILOpEnum(DXILOperationData &DXILOp, raw_ostream &OS) { 107435897b4Spython3kgae // Name = ID, // Doc 108435897b4Spython3kgae OS << DXILOp.Name << " = " << DXILOp.DXILOpID << ", // " << DXILOp.Doc 109435897b4Spython3kgae << "\n"; 110435897b4Spython3kgae } 111435897b4Spython3kgae 112435897b4Spython3kgae static std::string buildCategoryStr(StringSet<> &Cetegorys) { 113435897b4Spython3kgae std::string Str; 114435897b4Spython3kgae raw_string_ostream OS(Str); 115435897b4Spython3kgae for (auto &It : Cetegorys) { 116435897b4Spython3kgae OS << " " << It.getKey(); 117435897b4Spython3kgae } 118435897b4Spython3kgae return OS.str(); 119435897b4Spython3kgae } 120435897b4Spython3kgae 121435897b4Spython3kgae // Emit enum declaration for DXIL. 122435897b4Spython3kgae static void emitDXILEnums(std::vector<DXILOperationData> &DXILOps, 123435897b4Spython3kgae raw_ostream &OS) { 124435897b4Spython3kgae // Sort by Category + OpName. 125*aba43035SDmitri Gribenko llvm::sort(DXILOps, [](DXILOperationData &A, DXILOperationData &B) { 126435897b4Spython3kgae // Group by Category first. 127435897b4Spython3kgae if (A.Category == B.Category) 128435897b4Spython3kgae // Inside same Category, order by OpName. 129435897b4Spython3kgae return A.DXILOp < B.DXILOp; 130435897b4Spython3kgae else 131435897b4Spython3kgae return A.Category < B.Category; 132435897b4Spython3kgae }); 133435897b4Spython3kgae 134435897b4Spython3kgae OS << "// Enumeration for operations specified by DXIL\n"; 135435897b4Spython3kgae OS << "enum class OpCode : unsigned {\n"; 136435897b4Spython3kgae 137435897b4Spython3kgae StringMap<StringSet<>> ClassMap; 138435897b4Spython3kgae StringRef PrevCategory = ""; 139435897b4Spython3kgae for (auto &DXILOp : DXILOps) { 140435897b4Spython3kgae StringRef Category = DXILOp.Category; 141435897b4Spython3kgae if (Category != PrevCategory) { 142435897b4Spython3kgae OS << "\n// " << Category << "\n"; 143435897b4Spython3kgae PrevCategory = Category; 144435897b4Spython3kgae } 145435897b4Spython3kgae emitDXILOpEnum(DXILOp, OS); 146435897b4Spython3kgae auto It = ClassMap.find(DXILOp.DXILClass); 147435897b4Spython3kgae if (It != ClassMap.end()) { 148435897b4Spython3kgae It->second.insert(DXILOp.Category); 149435897b4Spython3kgae } else { 150435897b4Spython3kgae ClassMap[DXILOp.DXILClass].insert(DXILOp.Category); 151435897b4Spython3kgae } 152435897b4Spython3kgae } 153435897b4Spython3kgae 154435897b4Spython3kgae OS << "\n};\n\n"; 155435897b4Spython3kgae 156435897b4Spython3kgae std::vector<std::pair<std::string, std::string>> ClassVec; 157435897b4Spython3kgae for (auto &It : ClassMap) { 158435897b4Spython3kgae ClassVec.emplace_back( 159435897b4Spython3kgae std::make_pair(It.getKey().str(), buildCategoryStr(It.second))); 160435897b4Spython3kgae } 161435897b4Spython3kgae // Sort by Category + ClassName. 162*aba43035SDmitri Gribenko llvm::sort(ClassVec, [](std::pair<std::string, std::string> &A, 163435897b4Spython3kgae std::pair<std::string, std::string> &B) { 164435897b4Spython3kgae StringRef ClassA = A.first; 165435897b4Spython3kgae StringRef CategoryA = A.second; 166435897b4Spython3kgae StringRef ClassB = B.first; 167435897b4Spython3kgae StringRef CategoryB = B.second; 168435897b4Spython3kgae // Group by Category first. 169435897b4Spython3kgae if (CategoryA == CategoryB) 170435897b4Spython3kgae // Inside same Category, order by ClassName. 171435897b4Spython3kgae return ClassA < ClassB; 172435897b4Spython3kgae else 173435897b4Spython3kgae return CategoryA < CategoryB; 174435897b4Spython3kgae }); 175435897b4Spython3kgae 176435897b4Spython3kgae OS << "// Groups for DXIL operations with equivalent function templates\n"; 177435897b4Spython3kgae OS << "enum class OpCodeClass : unsigned {\n"; 178435897b4Spython3kgae PrevCategory = ""; 179435897b4Spython3kgae for (auto &It : ClassVec) { 180435897b4Spython3kgae 181435897b4Spython3kgae StringRef Category = It.second; 182435897b4Spython3kgae if (Category != PrevCategory) { 183435897b4Spython3kgae OS << "\n// " << Category << "\n"; 184435897b4Spython3kgae PrevCategory = Category; 185435897b4Spython3kgae } 186435897b4Spython3kgae StringRef Name = It.first; 187435897b4Spython3kgae OS << Name << ",\n"; 188435897b4Spython3kgae } 189435897b4Spython3kgae OS << "\n};\n\n"; 190435897b4Spython3kgae } 191435897b4Spython3kgae 192264c09b7SXiang Li // Emit map from llvm intrinsic to DXIL operation. 1930d2dde20SXiang Li static void emitDXILIntrinsicMap(std::vector<DXILOperationData> &DXILOps, 194264c09b7SXiang Li raw_ostream &OS) { 195264c09b7SXiang Li OS << "\n"; 196264c09b7SXiang Li // FIXME: use array instead of SmallDenseMap. 197264c09b7SXiang Li OS << "static const SmallDenseMap<Intrinsic::ID, DXIL::OpCode> LowerMap = " 198264c09b7SXiang Li "{\n"; 199264c09b7SXiang Li for (auto &DXILOp : DXILOps) { 200264c09b7SXiang Li if (DXILOp.Intrinsic.empty()) 201264c09b7SXiang Li continue; 202264c09b7SXiang Li // {Intrinsic::sin, DXIL::OpCode::Sin}, 203264c09b7SXiang Li OS << " { Intrinsic::" << DXILOp.Intrinsic 204264c09b7SXiang Li << ", DXIL::OpCode::" << DXILOp.DXILOp << "},\n"; 205264c09b7SXiang Li } 206264c09b7SXiang Li OS << "};\n"; 207264c09b7SXiang Li OS << "\n"; 208264c09b7SXiang Li } 209264c09b7SXiang Li 2100d2dde20SXiang Li static std::string emitDXILOperationFnAttr(StringRef FnAttr) { 2110d2dde20SXiang Li return StringSwitch<std::string>(FnAttr) 2120d2dde20SXiang Li .Case("rn", "Attribute::ReadNone") 2130d2dde20SXiang Li .Case("ro", "Attribute::ReadOnly") 2140d2dde20SXiang Li .Default("Attribute::None"); 2150d2dde20SXiang Li } 2160d2dde20SXiang Li 2170d2dde20SXiang Li static std::string getOverloadKind(StringRef Overload) { 2180d2dde20SXiang Li return StringSwitch<std::string>(Overload) 2190d2dde20SXiang Li .Case("half", "OverloadKind::HALF") 2200d2dde20SXiang Li .Case("float", "OverloadKind::FLOAT") 2210d2dde20SXiang Li .Case("double", "OverloadKind::DOUBLE") 2220d2dde20SXiang Li .Case("i1", "OverloadKind::I1") 2230d2dde20SXiang Li .Case("i16", "OverloadKind::I16") 2240d2dde20SXiang Li .Case("i32", "OverloadKind::I32") 2250d2dde20SXiang Li .Case("i64", "OverloadKind::I64") 2260d2dde20SXiang Li .Case("udt", "OverloadKind::UserDefineType") 2270d2dde20SXiang Li .Case("obj", "OverloadKind::ObjectType") 2280d2dde20SXiang Li .Default("OverloadKind::VOID"); 2290d2dde20SXiang Li } 2300d2dde20SXiang Li 2310d2dde20SXiang Li static std::string getDXILOperationOverload(StringRef Overloads) { 2320d2dde20SXiang Li SmallVector<StringRef> OverloadStrs; 2330d2dde20SXiang Li Overloads.split(OverloadStrs, ';', /*MaxSplit*/ -1, /*KeepEmpty*/ false); 2340d2dde20SXiang Li // Format is: OverloadKind::FLOAT | OverloadKind::HALF 2350d2dde20SXiang Li assert(!OverloadStrs.empty() && "Invalid overloads"); 2360d2dde20SXiang Li auto It = OverloadStrs.begin(); 2370d2dde20SXiang Li std::string Result; 2380d2dde20SXiang Li raw_string_ostream OS(Result); 2390d2dde20SXiang Li OS << getOverloadKind(*It); 2400d2dde20SXiang Li for (++It; It != OverloadStrs.end(); ++It) { 2410d2dde20SXiang Li OS << " | " << getOverloadKind(*It); 2420d2dde20SXiang Li } 2430d2dde20SXiang Li return OS.str(); 2440d2dde20SXiang Li } 2450d2dde20SXiang Li 2460d2dde20SXiang Li static std::string lowerFirstLetter(StringRef Name) { 2470d2dde20SXiang Li if (Name.empty()) 2480d2dde20SXiang Li return ""; 2490d2dde20SXiang Li 2500d2dde20SXiang Li std::string LowerName = Name.str(); 2510d2dde20SXiang Li LowerName[0] = llvm::toLower(Name[0]); 2520d2dde20SXiang Li return LowerName; 2530d2dde20SXiang Li } 2540d2dde20SXiang Li 2550d2dde20SXiang Li static std::string getDXILOpClassName(StringRef DXILOpClass) { 2560d2dde20SXiang Li // Lower first letter expect for special case. 2570d2dde20SXiang Li return StringSwitch<std::string>(DXILOpClass) 2580d2dde20SXiang Li .Case("CBufferLoad", "cbufferLoad") 2590d2dde20SXiang Li .Case("CBufferLoadLegacy", "cbufferLoadLegacy") 2600d2dde20SXiang Li .Case("GSInstanceID", "gsInstanceID") 2610d2dde20SXiang Li .Default(lowerFirstLetter(DXILOpClass)); 2620d2dde20SXiang Li } 2630d2dde20SXiang Li 2640d2dde20SXiang Li static void emitDXILOperationTable(std::vector<DXILOperationData> &DXILOps, 2650d2dde20SXiang Li raw_ostream &OS) { 2660d2dde20SXiang Li // Sort by DXILOpID. 267*aba43035SDmitri Gribenko llvm::sort(DXILOps, [](DXILOperationData &A, DXILOperationData &B) { 2680d2dde20SXiang Li return A.DXILOpID < B.DXILOpID; 2690d2dde20SXiang Li }); 2700d2dde20SXiang Li 2710d2dde20SXiang Li // Collect Names. 2720d2dde20SXiang Li SequenceToOffsetTable<std::string> OpClassStrings; 2730d2dde20SXiang Li SequenceToOffsetTable<std::string> OpStrings; 2740d2dde20SXiang Li 2750d2dde20SXiang Li StringSet<> ClassSet; 2760d2dde20SXiang Li for (auto &DXILOp : DXILOps) { 2770d2dde20SXiang Li OpStrings.add(DXILOp.DXILOp.str()); 2780d2dde20SXiang Li 2790d2dde20SXiang Li if (ClassSet.find(DXILOp.DXILClass) != ClassSet.end()) 2800d2dde20SXiang Li continue; 2810d2dde20SXiang Li ClassSet.insert(DXILOp.DXILClass); 2820d2dde20SXiang Li OpClassStrings.add(getDXILOpClassName(DXILOp.DXILClass)); 2830d2dde20SXiang Li } 2840d2dde20SXiang Li 2850d2dde20SXiang Li // Layout names. 2860d2dde20SXiang Li OpStrings.layout(); 2870d2dde20SXiang Li OpClassStrings.layout(); 2880d2dde20SXiang Li 2890d2dde20SXiang Li // Emit the DXIL operation table. 2900d2dde20SXiang Li //{DXIL::OpCode::Sin, OpCodeNameIndex, OpCodeClass::Unary, 2910d2dde20SXiang Li // OpCodeClassNameIndex, 2920d2dde20SXiang Li // OverloadKind::FLOAT | OverloadKind::HALF, Attribute::AttrKind::ReadNone}, 2930d2dde20SXiang Li OS << "static const OpCodeProperty *getOpCodeProperty(DXIL::OpCode DXILOp) " 2940d2dde20SXiang Li "{\n"; 2950d2dde20SXiang Li 2960d2dde20SXiang Li OS << " static const OpCodeProperty OpCodeProps[] = {\n"; 2970d2dde20SXiang Li for (auto &DXILOp : DXILOps) { 2980d2dde20SXiang Li OS << " { DXIL::OpCode::" << DXILOp.DXILOp << ", " 2990d2dde20SXiang Li << OpStrings.get(DXILOp.DXILOp.str()) 3000d2dde20SXiang Li << ", OpCodeClass::" << DXILOp.DXILClass << ", " 3010d2dde20SXiang Li << OpClassStrings.get(getDXILOpClassName(DXILOp.DXILClass)) << ", " 3020d2dde20SXiang Li << getDXILOperationOverload(DXILOp.OverloadTypes) << ", " 3030d2dde20SXiang Li << emitDXILOperationFnAttr(DXILOp.FnAttr) << " },\n"; 3040d2dde20SXiang Li } 3050d2dde20SXiang Li OS << " };\n"; 3060d2dde20SXiang Li 3070d2dde20SXiang Li OS << " // FIXME: change search to indexing with\n"; 3080d2dde20SXiang Li OS << " // DXILOp once all DXIL op is added.\n"; 3090d2dde20SXiang Li OS << " OpCodeProperty TmpProp;\n"; 3100d2dde20SXiang Li OS << " TmpProp.OpCode = DXILOp;\n"; 3110d2dde20SXiang Li OS << " const OpCodeProperty *Prop =\n"; 3120d2dde20SXiang Li OS << " llvm::lower_bound(OpCodeProps, TmpProp,\n"; 3130d2dde20SXiang Li OS << " [](const OpCodeProperty &A, const " 3140d2dde20SXiang Li "OpCodeProperty &B) {\n"; 3150d2dde20SXiang Li OS << " return A.OpCode < B.OpCode;\n"; 3160d2dde20SXiang Li OS << " });\n"; 3170d2dde20SXiang Li OS << " assert(Prop && \"fail to find OpCodeProperty\");\n"; 3180d2dde20SXiang Li OS << " return Prop;\n"; 3190d2dde20SXiang Li OS << "}\n\n"; 3200d2dde20SXiang Li 3210d2dde20SXiang Li // Emit the string tables. 3220d2dde20SXiang Li OS << "static const char *getOpCodeName(DXIL::OpCode DXILOp) {\n\n"; 3230d2dde20SXiang Li 3240d2dde20SXiang Li OpStrings.emitStringLiteralDef(OS, 3250d2dde20SXiang Li " static const char DXILOpCodeNameTable[]"); 3260d2dde20SXiang Li 3270d2dde20SXiang Li OS << " auto *Prop = getOpCodeProperty(DXILOp);\n"; 3280d2dde20SXiang Li OS << " unsigned Index = Prop->OpCodeNameOffset;\n"; 3290d2dde20SXiang Li OS << " return DXILOpCodeNameTable + Index;\n"; 3300d2dde20SXiang Li OS << "}\n\n"; 3310d2dde20SXiang Li 3320d2dde20SXiang Li OS << "static const char *getOpCodeClassName(const OpCodeProperty &Prop) " 3330d2dde20SXiang Li "{\n\n"; 3340d2dde20SXiang Li 3350d2dde20SXiang Li OpClassStrings.emitStringLiteralDef( 3360d2dde20SXiang Li OS, " static const char DXILOpCodeClassNameTable[]"); 3370d2dde20SXiang Li 3380d2dde20SXiang Li OS << " unsigned Index = Prop.OpCodeClassNameOffset;\n"; 3390d2dde20SXiang Li OS << " return DXILOpCodeClassNameTable + Index;\n"; 3400d2dde20SXiang Li OS << "}\n "; 3410d2dde20SXiang Li } 3420d2dde20SXiang Li 343435897b4Spython3kgae namespace llvm { 344435897b4Spython3kgae 345435897b4Spython3kgae void EmitDXILOperation(RecordKeeper &Records, raw_ostream &OS) { 346435897b4Spython3kgae std::vector<Record *> Ops = Records.getAllDerivedDefinitions("dxil_op"); 347435897b4Spython3kgae OS << "// Generated code, do not edit.\n"; 348435897b4Spython3kgae OS << "\n"; 349435897b4Spython3kgae 350435897b4Spython3kgae std::vector<DXILOperationData> DXILOps; 351435897b4Spython3kgae DXILOps.reserve(Ops.size()); 352435897b4Spython3kgae for (auto *Record : Ops) { 353435897b4Spython3kgae DXILOps.emplace_back(DXILOperationData(Record)); 354435897b4Spython3kgae } 355435897b4Spython3kgae 356435897b4Spython3kgae OS << "#ifdef DXIL_OP_ENUM\n"; 357435897b4Spython3kgae emitDXILEnums(DXILOps, OS); 358435897b4Spython3kgae OS << "#endif\n\n"; 359435897b4Spython3kgae 360264c09b7SXiang Li OS << "#ifdef DXIL_OP_INTRINSIC_MAP\n"; 3610d2dde20SXiang Li emitDXILIntrinsicMap(DXILOps, OS); 362264c09b7SXiang Li OS << "#endif\n\n"; 363264c09b7SXiang Li 3640d2dde20SXiang Li OS << "#ifdef DXIL_OP_OPERATION_TABLE\n"; 3650d2dde20SXiang Li emitDXILOperationTable(DXILOps, OS); 3660d2dde20SXiang Li OS << "#endif\n\n"; 367264c09b7SXiang Li 368435897b4Spython3kgae OS << "\n"; 369435897b4Spython3kgae } 370435897b4Spython3kgae 371435897b4Spython3kgae } // namespace llvm 372