diff options
Diffstat (limited to 'llvm/utils')
36 files changed, 198 insertions, 121 deletions
diff --git a/llvm/utils/TableGen/ARMTargetDefEmitter.cpp b/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp index 3b02f63e9490..4dea89ecbeff 100644 --- a/llvm/utils/TableGen/ARMTargetDefEmitter.cpp +++ b/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp @@ -162,14 +162,14 @@ static void emitARMTargetDef(const RecordKeeper &RK, raw_ostream &OS) { for (const Record *Rec : FMVExts) { OS << " I.emplace_back("; OS << "\"" << Rec->getValueAsString("Name") << "\""; - OS << ", " << Rec->getValueAsString("Bit"); + OS << ", " << Rec->getValueAsString("FeatureBit"); + OS << ", " << Rec->getValueAsString("PriorityBit"); auto FeatName = Rec->getValueAsString("BackendFeature"); const Record *FeatRec = ExtensionMap[FeatName]; if (FeatRec) OS << ", " << FeatRec->getValueAsString("ArchExtKindSpelling").upper(); else OS << ", std::nullopt"; - OS << ", " << (uint64_t)Rec->getValueAsInt("Priority"); OS << ");\n"; }; OS << " return I;\n" diff --git a/llvm/utils/TableGen/Attributes.cpp b/llvm/utils/TableGen/Basic/Attributes.cpp index 66ba25c6dcc8..66ba25c6dcc8 100644 --- a/llvm/utils/TableGen/Attributes.cpp +++ b/llvm/utils/TableGen/Basic/Attributes.cpp diff --git a/llvm/utils/TableGen/Basic/CMakeLists.txt b/llvm/utils/TableGen/Basic/CMakeLists.txt index 41d737e8d418..b058fba78eb0 100644 --- a/llvm/utils/TableGen/Basic/CMakeLists.txt +++ b/llvm/utils/TableGen/Basic/CMakeLists.txt @@ -9,8 +9,15 @@ set(LLVM_LINK_COMPONENTS ) add_llvm_library(LLVMTableGenBasic OBJECT EXCLUDE_FROM_ALL DISABLE_LLVM_LINK_LLVM_DYLIB + ARMTargetDefEmitter.cpp + Attributes.cpp CodeGenIntrinsics.cpp + DirectiveEmitter.cpp + IntrinsicEmitter.cpp + RISCVTargetDefEmitter.cpp SDNodeProperties.cpp + TableGen.cpp + VTEmitter.cpp ) # Users may include its headers as "Basic/*.h" diff --git a/llvm/utils/TableGen/DirectiveEmitter.cpp b/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp index fd815f4a31da..fd815f4a31da 100644 --- a/llvm/utils/TableGen/DirectiveEmitter.cpp +++ b/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp diff --git a/llvm/utils/TableGen/IntrinsicEmitter.cpp b/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp index 093602c3da80..fc2b8908a35b 100644 --- a/llvm/utils/TableGen/IntrinsicEmitter.cpp +++ b/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#include "Basic/CodeGenIntrinsics.h" -#include "Basic/SequenceToOffsetTable.h" +#include "CodeGenIntrinsics.h" +#include "SequenceToOffsetTable.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" diff --git a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp b/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp index 723f1d72b515..723f1d72b515 100644 --- a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp +++ b/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/Basic/TableGen.cpp index bea2a2e735db..80ac93f2b54f 100644 --- a/llvm/utils/TableGen/TableGen.cpp +++ b/llvm/utils/TableGen/Basic/TableGen.cpp @@ -6,10 +6,12 @@ // //===----------------------------------------------------------------------===// // -// This file contains the main function for LLVM's TableGen. +// This file contains the global defintions (mostly command line parameters) +// shared between llvm-tblgen and llvm-min-tblgen. // //===----------------------------------------------------------------------===// +#include "TableGen.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/InitLLVM.h" @@ -74,7 +76,7 @@ static TableGen::Emitter::Opt X[] = { {"print-sets", printSets, "Print expanded sets for testing DAG exprs"}, }; -int main(int argc, char **argv) { +int tblgen_main(int argc, char **argv) { InitLLVM X(argc, argv); cl::ParseCommandLineOptions(argc, argv); diff --git a/llvm/utils/TableGen/Basic/TableGen.h b/llvm/utils/TableGen/Basic/TableGen.h new file mode 100644 index 000000000000..630aea62fcf9 --- /dev/null +++ b/llvm/utils/TableGen/Basic/TableGen.h @@ -0,0 +1,13 @@ +//===- TableGen.h ---------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// Shared entry point for llvm-tblgen and llvm-min-tblgen. +// +//===----------------------------------------------------------------------===// + +int tblgen_main(int argc, char **argv); diff --git a/llvm/utils/TableGen/VTEmitter.cpp b/llvm/utils/TableGen/Basic/VTEmitter.cpp index d02932dd5e7f..d02932dd5e7f 100644 --- a/llvm/utils/TableGen/VTEmitter.cpp +++ b/llvm/utils/TableGen/Basic/VTEmitter.cpp diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt index ba1e4aa01b48..96a74c6fd89f 100644 --- a/llvm/utils/TableGen/CMakeLists.txt +++ b/llvm/utils/TableGen/CMakeLists.txt @@ -11,14 +11,13 @@ set(LLVM_LINK_COMPONENTS Support) # build llvm/include. It must not depend on TableGenCommon, as # TableGenCommon depends on this already to generate things such as # ValueType definitions. +# Sources included in both, llvm-min-tblgen and llvm-tblgen, must be included +# into LLVMTableGenBasic to avoid redundant compilation and problems with build +# caches. +# At least one source file must be included directly to avoid CMake problems. +# E.g. CMake derives which linker to use from the types of sources added. add_tablegen(llvm-min-tblgen LLVM_HEADERS - TableGen.cpp - ARMTargetDefEmitter.cpp - Attributes.cpp - DirectiveEmitter.cpp - IntrinsicEmitter.cpp - RISCVTargetDefEmitter.cpp - VTEmitter.cpp + llvm-min-tblgen.cpp $<TARGET_OBJECTS:obj.LLVMTableGenBasic> PARTIAL_SOURCES_INTENDED @@ -32,10 +31,8 @@ set(LLVM_LINK_COMPONENTS add_tablegen(llvm-tblgen LLVM DESTINATION "${LLVM_TOOLS_INSTALL_DIR}" EXPORT LLVM - ARMTargetDefEmitter.cpp AsmMatcherEmitter.cpp AsmWriterEmitter.cpp - Attributes.cpp CallingConvEmitter.cpp CodeEmitterGen.cpp CodeGenMapTable.cpp @@ -48,7 +45,6 @@ add_tablegen(llvm-tblgen LLVM DecoderEmitter.cpp DFAEmitter.cpp DFAPacketizerEmitter.cpp - DirectiveEmitter.cpp DisassemblerEmitter.cpp DXILEmitter.cpp ExegesisEmitter.cpp @@ -57,18 +53,15 @@ add_tablegen(llvm-tblgen LLVM GlobalISelEmitter.cpp InstrDocsEmitter.cpp InstrInfoEmitter.cpp - IntrinsicEmitter.cpp + llvm-tblgen.cpp MacroFusionPredicatorEmitter.cpp OptionParserEmitter.cpp OptionRSTEmitter.cpp PseudoLoweringEmitter.cpp RegisterBankEmitter.cpp RegisterInfoEmitter.cpp - RISCVTargetDefEmitter.cpp SearchableTableEmitter.cpp SubtargetEmitter.cpp - TableGen.cpp - VTEmitter.cpp WebAssemblyDisassemblerEmitter.cpp X86InstrMappingEmitter.cpp X86DisassemblerTables.cpp @@ -79,6 +72,8 @@ add_tablegen(llvm-tblgen LLVM $<TARGET_OBJECTS:obj.LLVMTableGenBasic> $<TARGET_OBJECTS:obj.LLVMTableGenCommon> + PARTIAL_SOURCES_INTENDED + DEPENDS intrinsics_gen # via llvm-min-tablegen ) diff --git a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp index 619e7a4790c8..a81f2b53f284 100644 --- a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp +++ b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp @@ -1723,7 +1723,6 @@ OperandMatcher &InstructionMatcher::addPhysRegInput(const Record *Reg, OperandMatcher *OM = new OperandMatcher(*this, OpIdx, "", TempOpIdx); Operands.emplace_back(OM); Rule.definePhysRegOperand(Reg, *OM); - PhysRegInputs.emplace_back(Reg, OpIdx); return *OM; } diff --git a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h index 48ce71be677c..8e6de80d6083 100644 --- a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h +++ b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h @@ -19,6 +19,7 @@ #include "Common/CodeGenDAGPatterns.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/MapVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" @@ -492,9 +493,11 @@ protected: /// the renderers. StringMap<OperandMatcher *> DefinedOperands; + using PhysRegOperandsTy = SmallMapVector<const Record *, OperandMatcher *, 1>; + /// A map of anonymous physical register operands defined by the matchers that /// may be referenced by the renderers. - DenseMap<const Record *, OperandMatcher *> PhysRegOperands; + PhysRegOperandsTy PhysRegOperands; /// ID for the next instruction variable defined with /// implicitlyDefineInsnVar() @@ -695,6 +698,10 @@ public: unsigned allocateOutputInsnID() { return NextOutputInsnID++; } unsigned allocateTempRegID() { return NextTempRegID++; } + iterator_range<PhysRegOperandsTy::const_iterator> physoperands() const { + return make_range(PhysRegOperands.begin(), PhysRegOperands.end()); + } + iterator_range<MatchersTy::iterator> insnmatchers() { return make_range(Matchers.begin(), Matchers.end()); } @@ -1756,11 +1763,6 @@ protected: unsigned InsnVarID; bool AllowNumOpsCheck; - /// PhysRegInputs - List list has an entry for each explicitly specified - /// physreg input to the pattern. The first elt is the Register node, the - /// second is the recorded slot number the input pattern match saved it in. - SmallVector<std::pair<const Record *, unsigned>, 2> PhysRegInputs; - bool canAddNumOperandsCheck() const { // Add if it's allowed, and: // - We don't have a variadic operand @@ -1802,10 +1804,6 @@ public: OperandMatcher &addPhysRegInput(const Record *Reg, unsigned OpIdx, unsigned TempOpIdx); - ArrayRef<std::pair<const Record *, unsigned>> getPhysRegInputs() const { - return PhysRegInputs; - } - StringRef getSymbolicName() const { return SymbolicName; } unsigned getNumOperandMatchers() const { return Operands.size(); } diff --git a/llvm/utils/TableGen/DXILEmitter.cpp b/llvm/utils/TableGen/DXILEmitter.cpp index a0c93bed5ad8..7488c8de5788 100644 --- a/llvm/utils/TableGen/DXILEmitter.cpp +++ b/llvm/utils/TableGen/DXILEmitter.cpp @@ -218,8 +218,10 @@ static StringRef getOverloadKindStr(const Record *R) { .Case("Int64Ty", "OverloadKind::I64") .Case("ResRetHalfTy", "OverloadKind::HALF") .Case("ResRetFloatTy", "OverloadKind::FLOAT") + .Case("ResRetDoubleTy", "OverloadKind::DOUBLE") .Case("ResRetInt16Ty", "OverloadKind::I16") - .Case("ResRetInt32Ty", "OverloadKind::I32"); + .Case("ResRetInt32Ty", "OverloadKind::I32") + .Case("ResRetInt64Ty", "OverloadKind::I64"); } /// Return a string representation of valid overload information denoted diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp index f0fb11625883..3b334ea4ce15 100644 --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -418,7 +418,8 @@ private: const TreePatternNode &N) const; Error importLeafNodeRenderer(RuleMatcher &M, BuildMIAction &MIBuilder, - const TreePatternNode &N) const; + const TreePatternNode &N, + action_iterator InsertPt) const; Error importXFormNodeRenderer(RuleMatcher &M, BuildMIAction &MIBuilder, const TreePatternNode &N) const; @@ -431,9 +432,6 @@ private: const TreePatternNode &N, action_iterator &InsertPt) const; - Error importDefaultOperandRenderers(action_iterator InsertPt, RuleMatcher &M, - BuildMIAction &DstMIBuilder, - const DAGDefaultOperand &DefaultOp) const; Error importImplicitDefRenderers(BuildMIAction &DstMIBuilder, ArrayRef<const Record *> ImplicitDefs) const; @@ -1291,7 +1289,8 @@ Error GlobalISelEmitter::importNamedNodeRenderer( // Equivalent of MatcherGen::EmitResultLeafAsOperand. Error GlobalISelEmitter::importLeafNodeRenderer( - RuleMatcher &M, BuildMIAction &MIBuilder, const TreePatternNode &N) const { + RuleMatcher &M, BuildMIAction &MIBuilder, const TreePatternNode &N, + action_iterator InsertPt) const { if (const auto *II = dyn_cast<IntInit>(N.getLeafValue())) { MIBuilder.addRenderer<ImmRenderer>(II->getValue()); return Error::success(); @@ -1300,11 +1299,29 @@ Error GlobalISelEmitter::importLeafNodeRenderer( if (const auto *DI = dyn_cast<DefInit>(N.getLeafValue())) { const Record *R = DI->getDef(); - if (R->isSubClassOf("Register")) { + if (R->isSubClassOf("Register") || R->getName() == "zero_reg") { MIBuilder.addRenderer<AddRegisterRenderer>(Target, R); return Error::success(); } + if (R->getName() == "undef_tied_input") { + std::optional<LLTCodeGen> OpTyOrNone = MVTToLLT(N.getSimpleType(0)); + if (!OpTyOrNone) + return failedImport("unsupported type"); + + unsigned TempRegID = M.allocateTempRegID(); + M.insertAction<MakeTempRegisterAction>(InsertPt, *OpTyOrNone, TempRegID); + + auto I = M.insertAction<BuildMIAction>( + InsertPt, M.allocateOutputInsnID(), + &Target.getInstruction(RK.getDef("IMPLICIT_DEF"))); + auto &ImpDefBuilder = static_cast<BuildMIAction &>(**I); + ImpDefBuilder.addRenderer<TempRegRenderer>(TempRegID, /*IsDef=*/true); + + MIBuilder.addRenderer<TempRegRenderer>(TempRegID); + return Error::success(); + } + if (R->isSubClassOf("SubRegIndex")) { const CodeGenSubRegIndex *SubRegIndex = CGRegs.getSubRegIdx(R); MIBuilder.addRenderer<ImmRenderer>(SubRegIndex->EnumValue); @@ -1386,7 +1403,7 @@ Error GlobalISelEmitter::importNodeRenderer(RuleMatcher &M, return importNamedNodeRenderer(M, MIBuilder, N); if (N.isLeaf()) - return importLeafNodeRenderer(M, MIBuilder, N); + return importLeafNodeRenderer(M, MIBuilder, N, InsertPt); if (N.getOperator()->isSubClassOf("SDNodeXForm")) return importXFormNodeRenderer(M, MIBuilder, N); @@ -1412,15 +1429,15 @@ Expected<BuildMIAction &> GlobalISelEmitter::createAndImportInstructionRenderer( action_iterator InsertPt = InsertPtOrError.get(); BuildMIAction &DstMIBuilder = *static_cast<BuildMIAction *>(InsertPt->get()); - for (auto PhysInput : InsnMatcher.getPhysRegInputs()) { + for (auto PhysOp : M.physoperands()) { InsertPt = M.insertAction<BuildMIAction>( InsertPt, M.allocateOutputInsnID(), &Target.getInstruction(RK.getDef("COPY"))); BuildMIAction &CopyToPhysRegMIBuilder = *static_cast<BuildMIAction *>(InsertPt->get()); - CopyToPhysRegMIBuilder.addRenderer<AddRegisterRenderer>( - Target, PhysInput.first, true); - CopyToPhysRegMIBuilder.addRenderer<CopyPhysRegRenderer>(PhysInput.first); + CopyToPhysRegMIBuilder.addRenderer<AddRegisterRenderer>(Target, + PhysOp.first, true); + CopyToPhysRegMIBuilder.addRenderer<CopyPhysRegRenderer>(PhysOp.first); } if (auto Error = importExplicitDefRenderers(InsertPt, M, DstMIBuilder, Dst, @@ -1707,11 +1724,11 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers( // This is a predicate or optional def operand which the pattern has not // overridden, or which we aren't letting it override; emit the 'default // ops' operands. - - const Record *OperandNode = DstI->Operands[InstOpNo].Rec; - if (auto Error = importDefaultOperandRenderers( - InsertPt, M, DstMIBuilder, CGP.getDefaultOperand(OperandNode))) - return std::move(Error); + for (const TreePatternNode &OpNode : + make_pointee_range(CGP.getDefaultOperand(OperandNode).DefaultOps)) { + if (Error Err = importNodeRenderer(M, DstMIBuilder, OpNode, InsertPt)) + return Err; + } ++NumDefaultOps; continue; @@ -1734,47 +1751,6 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers( return InsertPt; } -Error GlobalISelEmitter::importDefaultOperandRenderers( - action_iterator InsertPt, RuleMatcher &M, BuildMIAction &DstMIBuilder, - const DAGDefaultOperand &DefaultOp) const { - for (const auto &Op : DefaultOp.DefaultOps) { - const auto &N = *Op; - if (!N.isLeaf()) - return failedImport("Could not add default op"); - - const auto *DefaultOp = N.getLeafValue(); - - if (const DefInit *DefaultDefOp = dyn_cast<DefInit>(DefaultOp)) { - std::optional<LLTCodeGen> OpTyOrNone = MVTToLLT(N.getSimpleType(0)); - auto *Def = DefaultDefOp->getDef(); - if (Def->getName() == "undef_tied_input") { - unsigned TempRegID = M.allocateTempRegID(); - M.insertAction<MakeTempRegisterAction>(InsertPt, *OpTyOrNone, - TempRegID); - InsertPt = M.insertAction<BuildMIAction>( - InsertPt, M.allocateOutputInsnID(), - &Target.getInstruction(RK.getDef("IMPLICIT_DEF"))); - BuildMIAction &IDMIBuilder = - *static_cast<BuildMIAction *>(InsertPt->get()); - IDMIBuilder.addRenderer<TempRegRenderer>(TempRegID); - DstMIBuilder.addRenderer<TempRegRenderer>(TempRegID); - } else { - DstMIBuilder.addRenderer<AddRegisterRenderer>(Target, Def); - } - continue; - } - - if (const IntInit *DefaultIntOp = dyn_cast<IntInit>(DefaultOp)) { - DstMIBuilder.addRenderer<ImmRenderer>(DefaultIntOp->getValue()); - continue; - } - - return failedImport("Could not add default op"); - } - - return Error::success(); -} - Error GlobalISelEmitter::importImplicitDefRenderers( BuildMIAction &DstMIBuilder, ArrayRef<const Record *> ImplicitDefs) const { if (!ImplicitDefs.empty()) diff --git a/llvm/utils/TableGen/llvm-min-tblgen.cpp b/llvm/utils/TableGen/llvm-min-tblgen.cpp new file mode 100644 index 000000000000..79fce5c555f6 --- /dev/null +++ b/llvm/utils/TableGen/llvm-min-tblgen.cpp @@ -0,0 +1,18 @@ +//===- llvm-min-tblgen.cpp ------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file contains the main function for LLVM's TableGen. +// +//===----------------------------------------------------------------------===// + +#include "Basic/TableGen.h" + +/// Command line parameters are shared between llvm-tblgen and llvm-min-tblgen. +/// The indirection to tblgen_main exists to ensure that the static variables +/// for the llvm::cl:: mechanism are linked into both executables. +int main(int argc, char **argv) { return tblgen_main(argc, argv); } diff --git a/llvm/utils/TableGen/llvm-tblgen.cpp b/llvm/utils/TableGen/llvm-tblgen.cpp new file mode 100644 index 000000000000..a38382472a99 --- /dev/null +++ b/llvm/utils/TableGen/llvm-tblgen.cpp @@ -0,0 +1,18 @@ +//===- llvm-tblgen.cpp ----------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file contains the main function for LLVM's TableGen. +// +//===----------------------------------------------------------------------===// + +#include "Basic/TableGen.h" + +/// Command line parameters are shared between llvm-tblgen and llvm-min-tblgen. +/// The indirection to tblgen_main exists to ensure that the static variables +/// for the llvm::cl:: mechanism are linked into both executables. +int main(int argc, char **argv) { return tblgen_main(argc, argv); } diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index b108a21dbc52..e1cc02e1a608 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -1396,7 +1396,7 @@ def find_diff_matching(lhs: List[str], rhs: List[str]) -> List[tuple]: backlinks.append(None) # Commit to names in the matching by walking the backlinks. Recursively - # attempt to fill in more matches in-betweem. + # attempt to fill in more matches in-between. match_idx = table_candidate_idx[-1] while match_idx is not None: current = candidates[match_idx] diff --git a/llvm/utils/emacs/llvm-mode.el b/llvm/utils/emacs/llvm-mode.el index dab37833ff63..660d0718f098 100644 --- a/llvm/utils/emacs/llvm-mode.el +++ b/llvm/utils/emacs/llvm-mode.el @@ -32,7 +32,7 @@ `(,(regexp-opt '("alwaysinline" "argmemonly" "allocsize" "builtin" "cold" "convergent" "dereferenceable" "dereferenceable_or_null" "hot" "immarg" "inaccessiblememonly" "inaccessiblemem_or_argmemonly" "inalloca" "inlinehint" "jumptable" "minsize" "mustprogress" "naked" "nobuiltin" "nonnull" "nocapture" - "nocallback" "nocf_check" "noduplicate" "nofree" "noimplicitfloat" "noinline" "nomerge" "nonlazybind" "noprofile" "noredzone" "noreturn" + "nocallback" "nocf_check" "noduplicate" "noext" "nofree" "noimplicitfloat" "noinline" "nomerge" "nonlazybind" "noprofile" "noredzone" "noreturn" "norecurse" "nosync" "noundef" "nounwind" "nosanitize_bounds" "nosanitize_coverage" "null_pointer_is_valid" "optdebug" "optforfuzzing" "optnone" "optsize" "preallocated" "readnone" "readonly" "returned" "returns_twice" "shadowcallstack" "signext" "speculatable" "speculative_load_hardening" "ssp" "sspreq" "sspstrong" "safestack" "sanitize_address" "sanitize_hwaddress" "sanitize_memtag" "sanitize_thread" "sanitize_memory" "strictfp" "swifterror" "uwtable" "vscale_range" "willreturn" "writeonly" "zeroext") 'symbols) . font-lock-constant-face) diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone/BUILD.gn index 61e4f8da3c04..670f24c242a8 100644 --- a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone/BUILD.gn +++ b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone/BUILD.gn @@ -54,6 +54,7 @@ static_library("bugprone") { "MultiLevelImplicitPointerConversionCheck.cpp", "MultipleNewInOneExpressionCheck.cpp", "MultipleStatementMacroCheck.cpp", + "NarrowingConversionsCheck.cpp", "NoEscapeCheck.cpp", "NonZeroEnumToBoolConversionCheck.cpp", "NondeterministicPointerIterationOrderCheck.cpp", diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/cppcoreguidelines/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/cppcoreguidelines/BUILD.gn index be444d47aa12..a06b2f11b452 100644 --- a/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/cppcoreguidelines/BUILD.gn +++ b/llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/cppcoreguidelines/BUILD.gn @@ -28,7 +28,6 @@ static_library("cppcoreguidelines") { "MacroUsageCheck.cpp", "MisleadingCaptureDefaultByValueCheck.cpp", "MissingStdForwardCheck.cpp", - "NarrowingConversionsCheck.cpp", "NoMallocCheck.cpp", "NoSuspendWithLockCheck.cpp", "OwningMemoryCheck.cpp", diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn index 7deefe9dc061..c79d5ad662b7 100644 --- a/llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn +++ b/llvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn @@ -80,6 +80,7 @@ unittest("ClangdTests") { "GlobalCompilationDatabaseTests.cpp", "HeaderSourceSwitchTests.cpp", "HeadersTests.cpp", + "HeuristicResolverTests.cpp", "HoverTests.cpp", "IncludeCleanerTests.cpp", "IndexActionTests.cpp", diff --git a/llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn b/llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn index c945c8ac42e4..d8c4d8abdfd1 100644 --- a/llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn +++ b/llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn @@ -95,10 +95,18 @@ clang_tablegen("BuiltinsRISCV") { args = [ "-gen-clang-builtins" ] } +clang_tablegen("BuiltinsSPIRV") { + args = [ "-gen-clang-builtins" ] +} + clang_tablegen("BuiltinsX86") { args = [ "-gen-clang-builtins" ] } +clang_tablegen("BuiltinsX86_64") { + args = [ "-gen-clang-builtins" ] +} + # ARM CDE, MVE, and NEON. clang_tablegen("arm_neon") { diff --git a/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn index d18a10d50310..d759ff4429a9 100644 --- a/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn +++ b/llvm/utils/gn/secondary/clang/lib/Basic/BUILD.gn @@ -26,7 +26,9 @@ static_library("Basic") { "//clang/include/clang/Basic:Builtins", "//clang/include/clang/Basic:BuiltinsBPF", "//clang/include/clang/Basic:BuiltinsRISCV", + "//clang/include/clang/Basic:BuiltinsSPIRV", "//clang/include/clang/Basic:BuiltinsX86", + "//clang/include/clang/Basic:BuiltinsX86_64", "//clang/include/clang/Basic:DiagnosticGroups", "//clang/include/clang/Basic:RegularKeywordAttrInfo", "//clang/include/clang/Basic:arm_cde_builtins", diff --git a/llvm/utils/gn/secondary/clang/lib/Driver/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/Driver/BUILD.gn index 615c11b6b8d6..5b0b680e078c 100644 --- a/llvm/utils/gn/secondary/clang/lib/Driver/BUILD.gn +++ b/llvm/utils/gn/secondary/clang/lib/Driver/BUILD.gn @@ -94,6 +94,8 @@ static_library("Driver") { "ToolChains/PS4CPU.cpp", "ToolChains/RISCVToolchain.cpp", "ToolChains/SPIRV.cpp", + "ToolChains/SPIRVOpenMP.cpp", + "ToolChains/SYCL.cpp", "ToolChains/Solaris.cpp", "ToolChains/TCE.cpp", "ToolChains/UEFI.cpp", diff --git a/llvm/utils/gn/secondary/clang/lib/Sema/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/Sema/BUILD.gn index bcd36779b85e..fd2ac5871466 100644 --- a/llvm/utils/gn/secondary/clang/lib/Sema/BUILD.gn +++ b/llvm/utils/gn/secondary/clang/lib/Sema/BUILD.gn @@ -100,6 +100,7 @@ static_library("Sema") { "SemaPPC.cpp", "SemaPseudoObject.cpp", "SemaRISCV.cpp", + "SemaSPIRV.cpp", "SemaSYCL.cpp", "SemaStmt.cpp", "SemaStmtAsm.cpp", diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn index 67343297fae4..d1048259bcd4 100644 --- a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn +++ b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn @@ -299,6 +299,7 @@ static_library("builtins") { "mulxc3.c", "powixf2.c", "trunctfxf2.c", + "truncxfhf2.c", ] } } diff --git a/llvm/utils/gn/secondary/lldb/source/Host/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Host/BUILD.gn index 7c9edfb016d7..d74de409858b 100644 --- a/llvm/utils/gn/secondary/lldb/source/Host/BUILD.gn +++ b/llvm/utils/gn/secondary/lldb/source/Host/BUILD.gn @@ -16,6 +16,7 @@ static_library("Host") { ] public_deps = [ "//llvm/utils/gn/build/libs/xml" ] sources = [ + "aix/HostInfoAIX.cpp", "common/Alarm.cpp", "common/File.cpp", "common/FileAction.cpp", diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/RISCV/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/RISCV/BUILD.gn index c334b54a833b..7c6cdd0a34d2 100644 --- a/llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/RISCV/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/RISCV/BUILD.gn @@ -1,6 +1,14 @@ +import("//llvm/utils/TableGen/tablegen.gni") + +tablegen("RISCVGenExegesis") { + args = [ "-gen-exegesis" ] + td_file = "//llvm/lib/Target/RISCV/RISCV.td" +} + static_library("RISCV") { output_name = "LLVMExegesisRISCV" deps = [ + ":RISCVGenExegesis", "//llvm/lib/CodeGen", "//llvm/lib/IR", "//llvm/lib/Support", diff --git a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn index 78875ea98102..0d01bfa98017 100644 --- a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn @@ -102,7 +102,10 @@ group("unittests") { ] } if (llvm_build_RISCV) { - deps += [ "Target/RISCV:RISCVTests" ] + deps += [ + "Target/RISCV:RISCVTests", + "tools/llvm-exegesis/RISCV:LLVMExegesisRISCVTests", + ] } if (llvm_build_SystemZ) { deps += [ "MC/SystemZ:SystemZAsmLexerTests" ] diff --git a/llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn index 47b03b42d096..bf6a0b752327 100644 --- a/llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/unittests/Support/BUILD.gn @@ -73,6 +73,7 @@ unittest("SupportTests") { "ProcessTest.cpp", "ProgramTest.cpp", "RISCVAttributeParserTest.cpp", + "RecyclerTest.cpp", "RegexTest.cpp", "ReplaceFileTest.cpp", "ReverseIterationTest.cpp", diff --git a/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-exegesis/RISCV/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-exegesis/RISCV/BUILD.gn new file mode 100644 index 000000000000..d1db867c79f5 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-exegesis/RISCV/BUILD.gn @@ -0,0 +1,26 @@ +import("//third-party/unittest/unittest.gni") + +unittest("LLVMExegesisRISCVTests") { + deps = [ + "//llvm/lib/DebugInfo/Symbolize", + "//llvm/lib/MC", + "//llvm/lib/MC/MCParser", + "//llvm/lib/Object", + "//llvm/lib/Support", + "//llvm/lib/Target/RISCV", + + # Exegesis reaches inside the Target/RISCV tablegen internals and must + # depend on these Target/RISCV-internal build targets. + "//llvm/lib/Target/RISCV/MCTargetDesc", + "//llvm/tools/llvm-exegesis/lib", + "//llvm/tools/llvm-exegesis/lib/RISCV", + ] + include_dirs = [ + "//llvm/lib/Target/RISCV", + "//llvm/tools/llvm-exegesis/lib", + ] + sources = [ + "SnippetGeneratorTest.cpp", + "TargetTest.cpp", + ] +} diff --git a/llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn b/llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn index ba52a97f39d8..e2daa1e9b73c 100644 --- a/llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn @@ -1,29 +1,13 @@ -source_set("llvm-min-tblgen-sources") { - sources = [ - "ARMTargetDefEmitter.cpp", - "Attributes.cpp", - "DirectiveEmitter.cpp", - "IntrinsicEmitter.cpp", - "RISCVTargetDefEmitter.cpp", - "TableGen.cpp", - "VTEmitter.cpp", - ] - deps = [ - "Basic", - "//llvm/lib/Support", - ] -} - executable("llvm-min-tblgen") { + sources = [ "llvm-min-tblgen.cpp" ] deps = [ - ":llvm-min-tblgen-sources", "Basic", + "//llvm/lib/Support", ] } executable("llvm-tblgen") { deps = [ - ":llvm-min-tblgen-sources", "Basic", "Common", "//llvm/include/llvm/Config:llvm-config", @@ -55,6 +39,7 @@ executable("llvm-tblgen") { "GlobalISelEmitter.cpp", "InstrDocsEmitter.cpp", "InstrInfoEmitter.cpp", + "llvm-tblgen.cpp", "MacroFusionPredicatorEmitter.cpp", "OptionParserEmitter.cpp", "OptionRSTEmitter.cpp", diff --git a/llvm/utils/gn/secondary/llvm/utils/TableGen/Basic/BUILD.gn b/llvm/utils/gn/secondary/llvm/utils/TableGen/Basic/BUILD.gn index 2ebe393fa0fd..ef6d6e44b6f8 100644 --- a/llvm/utils/gn/secondary/llvm/utils/TableGen/Basic/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/utils/TableGen/Basic/BUILD.gn @@ -1,10 +1,17 @@ -static_library("Basic") { +source_set("Basic") { deps = [ "//llvm/lib/Support", "//llvm/lib/TableGen", ] sources = [ + "ARMTargetDefEmitter.cpp", + "Attributes.cpp", "CodeGenIntrinsics.cpp", + "DirectiveEmitter.cpp", + "IntrinsicEmitter.cpp", + "RISCVTargetDefEmitter.cpp", "SDNodeProperties.cpp", + "TableGen.cpp", + "VTEmitter.cpp", ] } diff --git a/llvm/utils/gn/secondary/llvm/utils/TableGen/Common/BUILD.gn b/llvm/utils/gn/secondary/llvm/utils/TableGen/Common/BUILD.gn index c46e7cb1dc8b..db11e56e550f 100644 --- a/llvm/utils/gn/secondary/llvm/utils/TableGen/Common/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/utils/TableGen/Common/BUILD.gn @@ -1,4 +1,5 @@ static_library("Common") { + output_name = "LLVMTableGenCommon" deps = [ "//llvm/include/llvm/CodeGen:GenVT", "//llvm/lib/CodeGenTypes", diff --git a/llvm/utils/lit/tests/shtest-format.py b/llvm/utils/lit/tests/shtest-format.py index 3a1959549e5d..fda3ef52e804 100644 --- a/llvm/utils/lit/tests/shtest-format.py +++ b/llvm/utils/lit/tests/shtest-format.py @@ -18,7 +18,7 @@ # CHECK: Command Output (stderr): # CHECK-NEXT: -- # CHECK-NOT: -- -# CHECK: cat{{(_64)?(\.exe)?}}: {{cannot open does-not-exist|does-not-exist: No such file or directory}} +# CHECK: cat{{(_64)?(\.exe)?}}: {{(cannot open does-not-exist|.*does-not-exist.*: No such file or directory)}} # CHECK: -- # CHECK: FAIL: shtest-format :: external_shell/fail_with_bad_encoding.txt diff --git a/llvm/utils/mlgo-utils/CMakeLists.txt b/llvm/utils/mlgo-utils/CMakeLists.txt index 2f3920644b73..d9b2bdc9bf60 100644 --- a/llvm/utils/mlgo-utils/CMakeLists.txt +++ b/llvm/utils/mlgo-utils/CMakeLists.txt @@ -1,9 +1,11 @@ -configure_lit_site_cfg( - "${CMAKE_CURRENT_SOURCE_DIR}/tests/lit.site.cfg.in" - "${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg" -) +if(LLVM_INCLUDE_TESTS) + configure_lit_site_cfg( + "${CMAKE_CURRENT_SOURCE_DIR}/tests/lit.site.cfg.in" + "${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg" + ) -add_lit_testsuite(check-mlgo-utils "Running mlgo-utils tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS "FileCheck" "not" "count" "split-file" "yaml2obj" "llvm-objcopy" -) + add_lit_testsuite(check-mlgo-utils "Running mlgo-utils tests" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS "FileCheck" "not" "count" "split-file" "yaml2obj" "llvm-objcopy" + ) +endif() |
