diff --git a/llvm/lib/Target/CMakeLists.txt b/llvm/lib/Target/CMakeLists.txt --- a/llvm/lib/Target/CMakeLists.txt +++ b/llvm/lib/Target/CMakeLists.txt @@ -2,6 +2,8 @@ list(APPEND LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_SRC_DIR}/lib/Target) +set(LLVM_TABLEGEN_EXE llvm-cg-tblgen) + add_llvm_component_library(LLVMTarget Target.cpp TargetIntrinsicInfo.cpp diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt --- a/llvm/test/CMakeLists.txt +++ b/llvm/test/CMakeLists.txt @@ -72,6 +72,7 @@ llvm-c-test llvm-cat llvm-cfi-verify + llvm-cg-tblgen llvm-config llvm-cov llvm-cvtres diff --git a/llvm/test/TableGen/AliasAsmString.td b/llvm/test/TableGen/AliasAsmString.td --- a/llvm/test/TableGen/AliasAsmString.td +++ b/llvm/test/TableGen/AliasAsmString.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-asm-writer -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-asm-writer -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/AllowDuplicateRegisterNames.td b/llvm/test/TableGen/AllowDuplicateRegisterNames.td --- a/llvm/test/TableGen/AllowDuplicateRegisterNames.td +++ b/llvm/test/TableGen/AllowDuplicateRegisterNames.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s // Check that MatchRegisterName and MatchRegisterAltName are generated // correctly when multiple registers are defined with the same name and diff --git a/llvm/test/TableGen/AsmPredicateCombining.td b/llvm/test/TableGen/AsmPredicateCombining.td --- a/llvm/test/TableGen/AsmPredicateCombining.td +++ b/llvm/test/TableGen/AsmPredicateCombining.td @@ -1,8 +1,8 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | \ +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../include %s | \ // RUN: FileCheck --check-prefix=DISASS %s -// RUN: llvm-tblgen -gen-asm-matcher -I %p/../../include %s | \ +// RUN: %llvm-cg-tblgen -gen-asm-matcher -I %p/../../include %s | \ // RUN: FileCheck --check-prefix=MATCHER %s -// RUN: llvm-tblgen -gen-asm-writer -I %p/../../include %s | \ +// RUN: %llvm-cg-tblgen -gen-asm-writer -I %p/../../include %s | \ // RUN: FileCheck --check-prefix=WRITER %s // Check that combining conditions in AssemblerPredicate generates the correct diff --git a/llvm/test/TableGen/AsmPredicateCombiningRISCV.td b/llvm/test/TableGen/AsmPredicateCombiningRISCV.td --- a/llvm/test/TableGen/AsmPredicateCombiningRISCV.td +++ b/llvm/test/TableGen/AsmPredicateCombiningRISCV.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-compress-inst-emitter -I %p/../../include %s | \ +// RUN: %llvm-cg-tblgen -gen-compress-inst-emitter -I %p/../../include %s | \ // RUN: FileCheck --check-prefix=COMPRESS %s // Check that combining conditions in AssemblerPredicate generates the correct diff --git a/llvm/test/TableGen/AsmPredicateCondsEmission.td b/llvm/test/TableGen/AsmPredicateCondsEmission.td --- a/llvm/test/TableGen/AsmPredicateCondsEmission.td +++ b/llvm/test/TableGen/AsmPredicateCondsEmission.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s // Check that we don't generate invalid code of the form "( && Cond2)" when // emitting AssemblerPredicate conditions. In the example below, the invalid diff --git a/llvm/test/TableGen/AsmVariant.td b/llvm/test/TableGen/AsmVariant.td --- a/llvm/test/TableGen/AsmVariant.td +++ b/llvm/test/TableGen/AsmVariant.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s // Check that specifying AsmVariant works correctly diff --git a/llvm/test/TableGen/AsmWriterPCRelOp.td b/llvm/test/TableGen/AsmWriterPCRelOp.td --- a/llvm/test/TableGen/AsmWriterPCRelOp.td +++ b/llvm/test/TableGen/AsmWriterPCRelOp.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-asm-writer -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-asm-writer -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/BigEncoder.td b/llvm/test/TableGen/BigEncoder.td --- a/llvm/test/TableGen/BigEncoder.td +++ b/llvm/test/TableGen/BigEncoder.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-emitter -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-emitter -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/BitOffsetDecoder.td b/llvm/test/TableGen/BitOffsetDecoder.td --- a/llvm/test/TableGen/BitOffsetDecoder.td +++ b/llvm/test/TableGen/BitOffsetDecoder.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/CodeGenSchedule-duplicate-instrw.td b/llvm/test/TableGen/CodeGenSchedule-duplicate-instrw.td --- a/llvm/test/TableGen/CodeGenSchedule-duplicate-instrw.td +++ b/llvm/test/TableGen/CodeGenSchedule-duplicate-instrw.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen --gen-subtarget -I %p/../../include -I %p/Common %s -o - 2>&1 | FileCheck %s +// RUN: not %llvm-cg-tblgen --gen-subtarget -I %p/../../include -I %p/Common %s -o - 2>&1 | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/CompressWriteLatencyEntry.td b/llvm/test/TableGen/CompressWriteLatencyEntry.td --- a/llvm/test/TableGen/CompressWriteLatencyEntry.td +++ b/llvm/test/TableGen/CompressWriteLatencyEntry.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s // Make sure that ReadAdvance entries are correctly processed. // Not all ProcReadAdvance definitions implicitly inherit from SchedRead. diff --git a/llvm/test/TableGen/ConcatenatedSubregs.td b/llvm/test/TableGen/ConcatenatedSubregs.td --- a/llvm/test/TableGen/ConcatenatedSubregs.td +++ b/llvm/test/TableGen/ConcatenatedSubregs.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -register-info-debug -I %p/../../include %s -o /dev/null 2>&1 | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -register-info-debug -I %p/../../include %s -o /dev/null 2>&1 | FileCheck %s // Checks that tablegen correctly and completely infers subregister relations. include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/ConstraintChecking1.td b/llvm/test/TableGen/ConstraintChecking1.td --- a/llvm/test/TableGen/ConstraintChecking1.td +++ b/llvm/test/TableGen/ConstraintChecking1.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s +// RUN: not %llvm-cg-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s include "ConstraintChecking.inc" diff --git a/llvm/test/TableGen/ConstraintChecking2.td b/llvm/test/TableGen/ConstraintChecking2.td --- a/llvm/test/TableGen/ConstraintChecking2.td +++ b/llvm/test/TableGen/ConstraintChecking2.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s +// RUN: not %llvm-cg-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s include "ConstraintChecking.inc" diff --git a/llvm/test/TableGen/ConstraintChecking3.td b/llvm/test/TableGen/ConstraintChecking3.td --- a/llvm/test/TableGen/ConstraintChecking3.td +++ b/llvm/test/TableGen/ConstraintChecking3.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s +// RUN: not %llvm-cg-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s include "ConstraintChecking.inc" diff --git a/llvm/test/TableGen/ConstraintChecking4.td b/llvm/test/TableGen/ConstraintChecking4.td --- a/llvm/test/TableGen/ConstraintChecking4.td +++ b/llvm/test/TableGen/ConstraintChecking4.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s +// RUN: not %llvm-cg-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s include "ConstraintChecking.inc" diff --git a/llvm/test/TableGen/ConstraintChecking5.td b/llvm/test/TableGen/ConstraintChecking5.td --- a/llvm/test/TableGen/ConstraintChecking5.td +++ b/llvm/test/TableGen/ConstraintChecking5.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s +// RUN: not %llvm-cg-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s include "ConstraintChecking.inc" diff --git a/llvm/test/TableGen/ConstraintChecking6.td b/llvm/test/TableGen/ConstraintChecking6.td --- a/llvm/test/TableGen/ConstraintChecking6.td +++ b/llvm/test/TableGen/ConstraintChecking6.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s +// RUN: not %llvm-cg-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s include "ConstraintChecking.inc" diff --git a/llvm/test/TableGen/ConstraintChecking7.td b/llvm/test/TableGen/ConstraintChecking7.td --- a/llvm/test/TableGen/ConstraintChecking7.td +++ b/llvm/test/TableGen/ConstraintChecking7.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s +// RUN: not %llvm-cg-tblgen -gen-asm-writer -I %p -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s include "ConstraintChecking.inc" diff --git a/llvm/test/TableGen/ContextlessPredicates.td b/llvm/test/TableGen/ContextlessPredicates.td --- a/llvm/test/TableGen/ContextlessPredicates.td +++ b/llvm/test/TableGen/ContextlessPredicates.td @@ -1,6 +1,6 @@ -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common -optimize-match-table=false %s -o %T/context-non-optimized.cpp +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common -optimize-match-table=false %s -o %T/context-non-optimized.cpp // RUN: FileCheck %s --check-prefixes=CHECK_NOPT -input-file=%T/context-non-optimized.cpp -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common -optimize-match-table=true %s -o %T/context-optimized.cpp +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common -optimize-match-table=true %s -o %T/context-optimized.cpp // RUN: FileCheck %s --check-prefixes=CHECK_OPT -input-file=%T/context-optimized.cpp diff --git a/llvm/test/TableGen/DAGDefaultOps.td b/llvm/test/TableGen/DAGDefaultOps.td --- a/llvm/test/TableGen/DAGDefaultOps.td +++ b/llvm/test/TableGen/DAGDefaultOps.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include %s -o %t +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include %s -o %t // RUN: FileCheck --check-prefix=ADD %s < %t // RUN: FileCheck --check-prefix=ADDINT %s < %t // RUN: FileCheck --check-prefix=SUB %s < %t diff --git a/llvm/test/TableGen/DefaultOpsGlobalISel.td b/llvm/test/TableGen/DefaultOpsGlobalISel.td --- a/llvm/test/TableGen/DefaultOpsGlobalISel.td +++ b/llvm/test/TableGen/DefaultOpsGlobalISel.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/DuplicateFieldValues.td b/llvm/test/TableGen/DuplicateFieldValues.td --- a/llvm/test/TableGen/DuplicateFieldValues.td +++ b/llvm/test/TableGen/DuplicateFieldValues.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-instr-info -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-instr-info -I %p/../../include %s | FileCheck %s // CHECK: ABCForm_A // CHECK-NOT: ABCForm_A diff --git a/llvm/test/TableGen/FastISelEmitter.td b/llvm/test/TableGen/FastISelEmitter.td --- a/llvm/test/TableGen/FastISelEmitter.td +++ b/llvm/test/TableGen/FastISelEmitter.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen --gen-fast-isel -I %p/../../include %s 2>&1 | FileCheck %s +// RUN: %llvm-cg-tblgen --gen-fast-isel -I %p/../../include %s 2>&1 | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/FixedLenDecoderEmitter/InitValue.td b/llvm/test/TableGen/FixedLenDecoderEmitter/InitValue.td --- a/llvm/test/TableGen/FixedLenDecoderEmitter/InitValue.td +++ b/llvm/test/TableGen/FixedLenDecoderEmitter/InitValue.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/FixedLenDecoderEmitter/MultiOps.td b/llvm/test/TableGen/FixedLenDecoderEmitter/MultiOps.td --- a/llvm/test/TableGen/FixedLenDecoderEmitter/MultiOps.td +++ b/llvm/test/TableGen/FixedLenDecoderEmitter/MultiOps.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-disassembler -I %p/../../../include %s 2>&1 | FileCheck %s --implicit-check-not=error: +// RUN: not %llvm-cg-tblgen -gen-disassembler -I %p/../../../include %s 2>&1 | FileCheck %s --implicit-check-not=error: include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/FixedLenDecoderEmitter/conflict.td b/llvm/test/TableGen/FixedLenDecoderEmitter/conflict.td --- a/llvm/test/TableGen/FixedLenDecoderEmitter/conflict.td +++ b/llvm/test/TableGen/FixedLenDecoderEmitter/conflict.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../../include %s -o - 2>%t +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../../include %s -o - 2>%t // RUN: FileCheck %s < %t include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/GICombinerEmitter/defs-invalid.td b/llvm/test/TableGen/GICombinerEmitter/defs-invalid.td --- a/llvm/test/TableGen/GICombinerEmitter/defs-invalid.td +++ b/llvm/test/TableGen/GICombinerEmitter/defs-invalid.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -I %p/../../../include -gen-global-isel-combiner \ +// RUN: not %llvm-cg-tblgen -I %p/../../../include -gen-global-isel-combiner \ // RUN: -combiners=MyCombiner %s 2>&1 | \ // RUN: FileCheck -implicit-check-not=error: %s diff --git a/llvm/test/TableGen/GICombinerEmitter/match-invalid.td b/llvm/test/TableGen/GICombinerEmitter/match-invalid.td --- a/llvm/test/TableGen/GICombinerEmitter/match-invalid.td +++ b/llvm/test/TableGen/GICombinerEmitter/match-invalid.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -I %p/../../../include -gen-global-isel-combiner \ +// RUN: not %llvm-cg-tblgen -I %p/../../../include -gen-global-isel-combiner \ // RUN: -combiners=MyCombiner %s 2>&1 | \ // RUN: FileCheck -implicit-check-not=error: %s diff --git a/llvm/test/TableGen/GICombinerEmitter/match-tree.td b/llvm/test/TableGen/GICombinerEmitter/match-tree.td --- a/llvm/test/TableGen/GICombinerEmitter/match-tree.td +++ b/llvm/test/TableGen/GICombinerEmitter/match-tree.td @@ -1,8 +1,8 @@ -// RUN: llvm-tblgen -I %p/../../../include -gen-global-isel-combiner \ +// RUN: %llvm-cg-tblgen -I %p/../../../include -gen-global-isel-combiner \ // RUN: -combiners=MyCombinerHelper -gicombiner-stop-after-build %s \ // RUN: -o %t.inc | FileCheck %s // -// RUN: llvm-tblgen -I %p/../../../include -gen-global-isel-combiner \ +// RUN: %llvm-cg-tblgen -I %p/../../../include -gen-global-isel-combiner \ // RUN: -combiners=MyCombinerHelper %s | \ // RUN: FileCheck --check-prefix=CODE %s diff --git a/llvm/test/TableGen/GICombinerEmitter/parse-match-pattern.td b/llvm/test/TableGen/GICombinerEmitter/parse-match-pattern.td --- a/llvm/test/TableGen/GICombinerEmitter/parse-match-pattern.td +++ b/llvm/test/TableGen/GICombinerEmitter/parse-match-pattern.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -I %p/../../../include -gen-global-isel-combiner \ +// RUN: %llvm-cg-tblgen -I %p/../../../include -gen-global-isel-combiner \ // RUN: -combiners=MyCombiner -gicombiner-stop-after-parse %s \ // RUN: -o /dev/null -debug 2>&1 | FileCheck %s // REQUIRES: asserts diff --git a/llvm/test/TableGen/GlobalISelEmitter-PR39045.td b/llvm/test/TableGen/GlobalISelEmitter-PR39045.td --- a/llvm/test/TableGen/GlobalISelEmitter-PR39045.td +++ b/llvm/test/TableGen/GlobalISelEmitter-PR39045.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o %t +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o %t // RUN: FileCheck %s < %t // Both predicates should be tested diff --git a/llvm/test/TableGen/GlobalISelEmitter-SDNodeXForm-timm.td b/llvm/test/TableGen/GlobalISelEmitter-SDNodeXForm-timm.td --- a/llvm/test/TableGen/GlobalISelEmitter-SDNodeXForm-timm.td +++ b/llvm/test/TableGen/GlobalISelEmitter-SDNodeXForm-timm.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-atomic_store.td b/llvm/test/TableGen/GlobalISelEmitter-atomic_store.td --- a/llvm/test/TableGen/GlobalISelEmitter-atomic_store.td +++ b/llvm/test/TableGen/GlobalISelEmitter-atomic_store.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-immAllZeroOne.td b/llvm/test/TableGen/GlobalISelEmitter-immAllZeroOne.td --- a/llvm/test/TableGen/GlobalISelEmitter-immAllZeroOne.td +++ b/llvm/test/TableGen/GlobalISelEmitter-immAllZeroOne.td @@ -1,5 +1,5 @@ -// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefixes=GISEL-NOOPT %s -// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=true -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefixes=GISEL-OPT %s +// RUN: %llvm-cg-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefixes=GISEL-NOOPT %s +// RUN: %llvm-cg-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=true -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefixes=GISEL-OPT %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-immarg-literal-pattern.td b/llvm/test/TableGen/GlobalISelEmitter-immarg-literal-pattern.td --- a/llvm/test/TableGen/GlobalISelEmitter-immarg-literal-pattern.td +++ b/llvm/test/TableGen/GlobalISelEmitter-immarg-literal-pattern.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-input-discard.td b/llvm/test/TableGen/GlobalISelEmitter-input-discard.td --- a/llvm/test/TableGen/GlobalISelEmitter-input-discard.td +++ b/llvm/test/TableGen/GlobalISelEmitter-input-discard.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-multiple-output-discard.td b/llvm/test/TableGen/GlobalISelEmitter-multiple-output-discard.td --- a/llvm/test/TableGen/GlobalISelEmitter-multiple-output-discard.td +++ b/llvm/test/TableGen/GlobalISelEmitter-multiple-output-discard.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-multiple-output.td b/llvm/test/TableGen/GlobalISelEmitter-multiple-output.td --- a/llvm/test/TableGen/GlobalISelEmitter-multiple-output.td +++ b/llvm/test/TableGen/GlobalISelEmitter-multiple-output.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-nested-subregs.td b/llvm/test/TableGen/GlobalISelEmitter-nested-subregs.td --- a/llvm/test/TableGen/GlobalISelEmitter-nested-subregs.td +++ b/llvm/test/TableGen/GlobalISelEmitter-nested-subregs.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-output-discard.td b/llvm/test/TableGen/GlobalISelEmitter-output-discard.td --- a/llvm/test/TableGen/GlobalISelEmitter-output-discard.td +++ b/llvm/test/TableGen/GlobalISelEmitter-output-discard.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-setcc.td b/llvm/test/TableGen/GlobalISelEmitter-setcc.td --- a/llvm/test/TableGen/GlobalISelEmitter-setcc.td +++ b/llvm/test/TableGen/GlobalISelEmitter-setcc.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - 2> %t < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - 2> %t < %s | FileCheck -check-prefix=GISEL %s // RUN: FileCheck -DFILE=%s -check-prefix=ERR %s < %t include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-zero-instr.td b/llvm/test/TableGen/GlobalISelEmitter-zero-instr.td --- a/llvm/test/TableGen/GlobalISelEmitter-zero-instr.td +++ b/llvm/test/TableGen/GlobalISelEmitter-zero-instr.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common %s -o /dev/null --warn-on-skipped-patterns 2>&1 < %s 2>&1 | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common %s -o /dev/null --warn-on-skipped-patterns 2>&1 < %s 2>&1 | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter-zero-reg.td b/llvm/test/TableGen/GlobalISelEmitter-zero-reg.td --- a/llvm/test/TableGen/GlobalISelEmitter-zero-reg.td +++ b/llvm/test/TableGen/GlobalISelEmitter-zero-reg.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - < %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - < %s | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitter.td b/llvm/test/TableGen/GlobalISelEmitter.td --- a/llvm/test/TableGen/GlobalISelEmitter.td +++ b/llvm/test/TableGen/GlobalISelEmitter.td @@ -1,6 +1,6 @@ -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common -optimize-match-table=false %s -o %T/non-optimized.cpp -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common -optimize-match-table=true %s -o %T/optimized.cpp -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o %T/default.cpp +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common -optimize-match-table=false %s -o %T/non-optimized.cpp +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common -optimize-match-table=true %s -o %T/optimized.cpp +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o %T/default.cpp // RUN: FileCheck %s --check-prefixes=CHECK,R19C,R19N -input-file=%T/non-optimized.cpp // RUN: FileCheck %s --check-prefixes=CHECK,R19C,R19O -input-file=%T/optimized.cpp diff --git a/llvm/test/TableGen/GlobalISelEmitterCustomPredicate.td b/llvm/test/TableGen/GlobalISelEmitterCustomPredicate.td --- a/llvm/test/TableGen/GlobalISelEmitterCustomPredicate.td +++ b/llvm/test/TableGen/GlobalISelEmitterCustomPredicate.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s // Verify that all MI predicates are enumerated. // diff --git a/llvm/test/TableGen/GlobalISelEmitterFlags.td b/llvm/test/TableGen/GlobalISelEmitterFlags.td --- a/llvm/test/TableGen/GlobalISelEmitterFlags.td +++ b/llvm/test/TableGen/GlobalISelEmitterFlags.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizer.td b/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizer.td --- a/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizer.td +++ b/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizer.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=true -I %p/../../include -I %p/Common -o - | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -optimize-match-table=true -I %p/../../include -I %p/Common -o - | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizerSameOperand-invalid.td b/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizerSameOperand-invalid.td --- a/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizerSameOperand-invalid.td +++ b/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizerSameOperand-invalid.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=true -I %p/../../include -I %p/Common -o - | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -optimize-match-table=true -I %p/../../include -I %p/Common -o - | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizerSameOperand.td b/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizerSameOperand.td --- a/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizerSameOperand.td +++ b/llvm/test/TableGen/GlobalISelEmitterMatchTableOptimizerSameOperand.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=true -I %p/../../include -I %p/Common -o - | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -optimize-match-table=true -I %p/../../include -I %p/Common -o - | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitterOverloadedPtr.td b/llvm/test/TableGen/GlobalISelEmitterOverloadedPtr.td --- a/llvm/test/TableGen/GlobalISelEmitterOverloadedPtr.td +++ b/llvm/test/TableGen/GlobalISelEmitterOverloadedPtr.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o - | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o - | FileCheck %s // Boilerplate code. include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/GlobalISelEmitterRegSequence.td b/llvm/test/TableGen/GlobalISelEmitterRegSequence.td --- a/llvm/test/TableGen/GlobalISelEmitterRegSequence.td +++ b/llvm/test/TableGen/GlobalISelEmitterRegSequence.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitterSkippedPatterns.td b/llvm/test/TableGen/GlobalISelEmitterSkippedPatterns.td --- a/llvm/test/TableGen/GlobalISelEmitterSkippedPatterns.td +++ b/llvm/test/TableGen/GlobalISelEmitterSkippedPatterns.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -warn-on-skipped-patterns -gen-global-isel -I %p/../../include %s -I %p/Common -o /dev/null 2>&1 | FileCheck %s +// RUN: %llvm-cg-tblgen -warn-on-skipped-patterns -gen-global-isel -I %p/../../include %s -I %p/Common -o /dev/null 2>&1 | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/GlobalISelEmitterSubreg.td b/llvm/test/TableGen/GlobalISelEmitterSubreg.td --- a/llvm/test/TableGen/GlobalISelEmitterSubreg.td +++ b/llvm/test/TableGen/GlobalISelEmitterSubreg.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen %s -gen-global-isel -warn-on-skipped-patterns -I %p/../../include -I %p/Common -o - 2> %t.skipped | FileCheck %s +// RUN: %llvm-cg-tblgen %s -gen-global-isel -warn-on-skipped-patterns -I %p/../../include -I %p/Common -o - 2> %t.skipped | FileCheck %s // RUN: cat %t.skipped | FileCheck %s --check-prefix=SKIPPED include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/GlobalISelEmitterVariadic.td b/llvm/test/TableGen/GlobalISelEmitterVariadic.td --- a/llvm/test/TableGen/GlobalISelEmitterVariadic.td +++ b/llvm/test/TableGen/GlobalISelEmitterVariadic.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o - | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o - | FileCheck %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/HasNoUse.td b/llvm/test/TableGen/HasNoUse.td --- a/llvm/test/TableGen/HasNoUse.td +++ b/llvm/test/TableGen/HasNoUse.td @@ -1,5 +1,5 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=SDAG %s -// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=SDAG %s +// RUN: %llvm-cg-tblgen -gen-global-isel -warn-on-skipped-patterns -I %p/../../include -I %p/Common %s -o - < %s | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/HwModeEncodeDecode.td b/llvm/test/TableGen/HwModeEncodeDecode.td --- a/llvm/test/TableGen/HwModeEncodeDecode.td +++ b/llvm/test/TableGen/HwModeEncodeDecode.td @@ -1,5 +1,5 @@ -// RUN: llvm-tblgen -gen-emitter -I %p/../../include %s | FileCheck %s --check-prefix=ENCODER -// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s --check-prefix=DECODER +// RUN: %llvm-cg-tblgen -gen-emitter -I %p/../../include %s | FileCheck %s --check-prefix=ENCODER +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s --check-prefix=DECODER include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/HwModeSelect.td b/llvm/test/TableGen/HwModeSelect.td --- a/llvm/test/TableGen/HwModeSelect.td +++ b/llvm/test/TableGen/HwModeSelect.td @@ -1,4 +1,4 @@ -// RUN: not --crash llvm-tblgen -gen-dag-isel -I %p/../../include %s 2>&1 | FileCheck %s +// RUN: not --crash %llvm-cg-tblgen -gen-dag-isel -I %p/../../include %s 2>&1 | FileCheck %s // The HwModeSelect class is intended to serve as a base class for other // classes that are then used to select a value based on the HW mode. diff --git a/llvm/test/TableGen/InvalidMCSchedClassDesc.td b/llvm/test/TableGen/InvalidMCSchedClassDesc.td --- a/llvm/test/TableGen/InvalidMCSchedClassDesc.td +++ b/llvm/test/TableGen/InvalidMCSchedClassDesc.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s // Check if it is valid MCSchedClassDesc if didn't have the resources. include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/MissingOperandField.td b/llvm/test/TableGen/MissingOperandField.td --- a/llvm/test/TableGen/MissingOperandField.td +++ b/llvm/test/TableGen/MissingOperandField.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-emitter -I %p/../../include %s 2>&1 | FileCheck %s --implicit-check-not=error: +// RUN: not %llvm-cg-tblgen -gen-emitter -I %p/../../include %s 2>&1 | FileCheck %s --implicit-check-not=error: // Check that we emit reasonable diagnostics when fields do not have // corresponding operands. diff --git a/llvm/test/TableGen/MixedCasedMnemonic.td b/llvm/test/TableGen/MixedCasedMnemonic.td --- a/llvm/test/TableGen/MixedCasedMnemonic.td +++ b/llvm/test/TableGen/MixedCasedMnemonic.td @@ -1,6 +1,6 @@ -// RUN: llvm-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s --check-prefix=MATCHER -// RUN: llvm-tblgen -gen-asm-writer -I %p/../../include %s | FileCheck %s --check-prefix=WRITER -// RUN: llvm-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s --check-prefix=ALIAS +// RUN: %llvm-cg-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s --check-prefix=MATCHER +// RUN: %llvm-cg-tblgen -gen-asm-writer -I %p/../../include %s | FileCheck %s --check-prefix=WRITER +// RUN: %llvm-cg-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s --check-prefix=ALIAS // Check that an instruction that uses mixed upper/lower case in its mnemonic // is printed as-is, and is parsed in its "canonicalized" lowercase form. diff --git a/llvm/test/TableGen/MnemonicAlias.td b/llvm/test/TableGen/MnemonicAlias.td --- a/llvm/test/TableGen/MnemonicAlias.td +++ b/llvm/test/TableGen/MnemonicAlias.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-asm-matcher -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/RegisterBankEmitter.td b/llvm/test/TableGen/RegisterBankEmitter.td --- a/llvm/test/TableGen/RegisterBankEmitter.td +++ b/llvm/test/TableGen/RegisterBankEmitter.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-bank -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-bank -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/RegisterClass.td b/llvm/test/TableGen/RegisterClass.td --- a/llvm/test/TableGen/RegisterClass.td +++ b/llvm/test/TableGen/RegisterClass.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-register-bank -I %p/../../include %s 2>&1 | FileCheck %s +// RUN: not %llvm-cg-tblgen -gen-register-bank -I %p/../../include %s 2>&1 | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/RegisterEncoder.td b/llvm/test/TableGen/RegisterEncoder.td --- a/llvm/test/TableGen/RegisterEncoder.td +++ b/llvm/test/TableGen/RegisterEncoder.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-emitter -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-emitter -I %p/../../include %s | FileCheck %s // Check that EncoderMethod for RegisterOperand is working correctly diff --git a/llvm/test/TableGen/RegisterInfoEmitter-BaseClassOrder.td b/llvm/test/TableGen/RegisterInfoEmitter-BaseClassOrder.td --- a/llvm/test/TableGen/RegisterInfoEmitter-BaseClassOrder.td +++ b/llvm/test/TableGen/RegisterInfoEmitter-BaseClassOrder.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/RegisterInfoEmitter-regcost-list.td b/llvm/test/TableGen/RegisterInfoEmitter-regcost-list.td --- a/llvm/test/TableGen/RegisterInfoEmitter-regcost-list.td +++ b/llvm/test/TableGen/RegisterInfoEmitter-regcost-list.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s // Checks two CostPerUse values for the registers. include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/RegisterInfoEmitter-regcost-tuple.td b/llvm/test/TableGen/RegisterInfoEmitter-regcost-tuple.td --- a/llvm/test/TableGen/RegisterInfoEmitter-regcost-tuple.td +++ b/llvm/test/TableGen/RegisterInfoEmitter-regcost-tuple.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s // Checks the cost values for the register tuple. include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/RegisterInfoEmitter-regcost.td b/llvm/test/TableGen/RegisterInfoEmitter-regcost.td --- a/llvm/test/TableGen/RegisterInfoEmitter-regcost.td +++ b/llvm/test/TableGen/RegisterInfoEmitter-regcost.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s // Checks the CostPerUse value for the registers. include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/RegisterInfoEmitter-tsflags.td b/llvm/test/TableGen/RegisterInfoEmitter-tsflags.td --- a/llvm/test/TableGen/RegisterInfoEmitter-tsflags.td +++ b/llvm/test/TableGen/RegisterInfoEmitter-tsflags.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s // Configure and test TSFlags for a target. include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/RelTest.td b/llvm/test/TableGen/RelTest.td --- a/llvm/test/TableGen/RelTest.td +++ b/llvm/test/TableGen/RelTest.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-instr-info -I %p/../../include %s 2>&1 | FileCheck %s +// RUN: not %llvm-cg-tblgen -gen-instr-info -I %p/../../include %s 2>&1 | FileCheck %s // This test verifies that TableGen is displaying an error when mapped instruction // does not contain a field listed under RowFields. diff --git a/llvm/test/TableGen/SchedModelError.td b/llvm/test/TableGen/SchedModelError.td --- a/llvm/test/TableGen/SchedModelError.td +++ b/llvm/test/TableGen/SchedModelError.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s +// RUN: not %llvm-cg-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/VarLenDecoder.td b/llvm/test/TableGen/VarLenDecoder.td --- a/llvm/test/TableGen/VarLenDecoder.td +++ b/llvm/test/TableGen/VarLenDecoder.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/VarLenEncoder.td b/llvm/test/TableGen/VarLenEncoder.td --- a/llvm/test/TableGen/VarLenEncoder.td +++ b/llvm/test/TableGen/VarLenEncoder.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-emitter -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-emitter -I %p/../../include %s | FileCheck %s // Check if VarLenCodeEmitterGen works correctly. diff --git a/llvm/test/TableGen/address-space-patfrags.td b/llvm/test/TableGen/address-space-patfrags.td --- a/llvm/test/TableGen/address-space-patfrags.td +++ b/llvm/test/TableGen/address-space-patfrags.td @@ -1,5 +1,5 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include %s 2>&1 | FileCheck -check-prefix=SDAG %s -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include %s 2>&1 | FileCheck -check-prefix=SDAG %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/ambiguous-composition.td b/llvm/test/TableGen/ambiguous-composition.td --- a/llvm/test/TableGen/ambiguous-composition.td +++ b/llvm/test/TableGen/ambiguous-composition.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include %s 2>&1 | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include %s 2>&1 | FileCheck %s // // CHECK-NOT: warning: SubRegIndex Test::subreg_h64 and Test::subreg_h32 compose ambiguously as Test::subreg_hh32 or Test::subreg_h32 // CHECK: warning: SubRegIndex Test::subreg_l64 and Test::subreg_l32 compose ambiguously as Test::subreg_ll32 or Test::subreg_l32 diff --git a/llvm/test/TableGen/bare-minimum-psets.td b/llvm/test/TableGen/bare-minimum-psets.td --- a/llvm/test/TableGen/bare-minimum-psets.td +++ b/llvm/test/TableGen/bare-minimum-psets.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s // Test to check the bare minimum pressure sets. // At least one register pressure set is required for the target. diff --git a/llvm/test/TableGen/dag-isel-complexpattern.td b/llvm/test/TableGen/dag-isel-complexpattern.td --- a/llvm/test/TableGen/dag-isel-complexpattern.td +++ b/llvm/test/TableGen/dag-isel-complexpattern.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/dag-isel-regclass-emit-enum.td b/llvm/test/TableGen/dag-isel-regclass-emit-enum.td --- a/llvm/test/TableGen/dag-isel-regclass-emit-enum.td +++ b/llvm/test/TableGen/dag-isel-regclass-emit-enum.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/dag-isel-res-order.td b/llvm/test/TableGen/dag-isel-res-order.td --- a/llvm/test/TableGen/dag-isel-res-order.td +++ b/llvm/test/TableGen/dag-isel-res-order.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/dag-isel-subregs.td b/llvm/test/TableGen/dag-isel-subregs.td --- a/llvm/test/TableGen/dag-isel-subregs.td +++ b/llvm/test/TableGen/dag-isel-subregs.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include -I %p/Common %s | FileCheck %s include "reg-with-subregs-common.td" diff --git a/llvm/test/TableGen/empty-psets.td b/llvm/test/TableGen/empty-psets.td --- a/llvm/test/TableGen/empty-psets.td +++ b/llvm/test/TableGen/empty-psets.td @@ -1,4 +1,4 @@ -// RUN: not llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s 2>&1 | FileCheck %s +// RUN: not %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s 2>&1 | FileCheck %s // Negative test to check empty Psets for a target. diff --git a/llvm/test/TableGen/generic-tables-instruction.td b/llvm/test/TableGen/generic-tables-instruction.td --- a/llvm/test/TableGen/generic-tables-instruction.td +++ b/llvm/test/TableGen/generic-tables-instruction.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-searchable-tables -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-searchable-tables -I %p/../../include %s | FileCheck %s // XFAIL: vg_leak include "llvm/TableGen/SearchableTable.td" diff --git a/llvm/test/TableGen/generic-tables.td b/llvm/test/TableGen/generic-tables.td --- a/llvm/test/TableGen/generic-tables.td +++ b/llvm/test/TableGen/generic-tables.td @@ -1,5 +1,5 @@ -// RUN: llvm-tblgen -gen-searchable-tables -I %p/../../include %s | FileCheck %s -// RUN: not llvm-tblgen -gen-searchable-tables -I %p/../../include -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s +// RUN: %llvm-cg-tblgen -gen-searchable-tables -I %p/../../include %s | FileCheck %s +// RUN: not %llvm-cg-tblgen -gen-searchable-tables -I %p/../../include -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s // XFAIL: vg_leak include "llvm/TableGen/SearchableTable.td" diff --git a/llvm/test/TableGen/get-operand-type-no-expand.td b/llvm/test/TableGen/get-operand-type-no-expand.td --- a/llvm/test/TableGen/get-operand-type-no-expand.td +++ b/llvm/test/TableGen/get-operand-type-no-expand.td @@ -29,7 +29,7 @@ let Namespace = "MyNamespace"; } -// RUN: llvm-tblgen -gen-instr-info -I %p/../../include %s \ +// RUN: %llvm-cg-tblgen -gen-instr-info -I %p/../../include %s \ // RUN: -instr-info-expand-mi-operand-info=1 \ // RUN: | FileCheck %s --check-prefix=CHECK-EXPAND // CHECK-EXPAND: #ifdef GET_INSTRINFO_OPERAND_TYPE @@ -38,7 +38,7 @@ // CHECK-EXPAND-NEXT: i8imm, i32imm, i8imm, i32imm, i32imm, // CHECK-EXPAND: #endif // GET_INSTRINFO_OPERAND_TYPE -// RUN: llvm-tblgen -gen-instr-info -I %p/../../include %s \ +// RUN: %llvm-cg-tblgen -gen-instr-info -I %p/../../include %s \ // RUN: -instr-info-expand-mi-operand-info=0 \ // RUN: | FileCheck %s --check-prefix=CHECK-NOEXPAND // CHECK-NOEXPAND: #ifdef GET_INSTRINFO_OPERAND_TYPE diff --git a/llvm/test/TableGen/get-operand-type.td b/llvm/test/TableGen/get-operand-type.td --- a/llvm/test/TableGen/get-operand-type.td +++ b/llvm/test/TableGen/get-operand-type.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-instr-info -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-instr-info -I %p/../../include %s | FileCheck %s // Check that getOperandType has the expected info in it diff --git a/llvm/test/TableGen/gisel-physreg-input.td b/llvm/test/TableGen/gisel-physreg-input.td --- a/llvm/test/TableGen/gisel-physreg-input.td +++ b/llvm/test/TableGen/gisel-physreg-input.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/immarg-predicated.td b/llvm/test/TableGen/immarg-predicated.td --- a/llvm/test/TableGen/immarg-predicated.td +++ b/llvm/test/TableGen/immarg-predicated.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/Common -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -I %p/Common -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/immarg.td b/llvm/test/TableGen/immarg.td --- a/llvm/test/TableGen/immarg.td +++ b/llvm/test/TableGen/immarg.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/Common -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-global-isel -optimize-match-table=false -I %p/Common -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/inhibit-pset.td b/llvm/test/TableGen/inhibit-pset.td --- a/llvm/test/TableGen/inhibit-pset.td +++ b/llvm/test/TableGen/inhibit-pset.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s include "reg-with-subregs-common.td" diff --git a/llvm/test/TableGen/predicate-patfags.td b/llvm/test/TableGen/predicate-patfags.td --- a/llvm/test/TableGen/predicate-patfags.td +++ b/llvm/test/TableGen/predicate-patfags.td @@ -1,5 +1,5 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include -I %p/Common %s 2>&1 | FileCheck -check-prefix=SDAG %s -// RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s 2>&1 | FileCheck -check-prefix=GISEL %s +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include -I %p/Common %s 2>&1 | FileCheck -check-prefix=SDAG %s +// RUN: %llvm-cg-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s 2>&1 | FileCheck -check-prefix=GISEL %s include "llvm/Target/Target.td" include "GlobalISelEmitterCommon.td" diff --git a/llvm/test/TableGen/pset-enum.td b/llvm/test/TableGen/pset-enum.td --- a/llvm/test/TableGen/pset-enum.td +++ b/llvm/test/TableGen/pset-enum.td @@ -1,5 +1,5 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common -DUSE_NAMESPACE %s | FileCheck --check-prefixes=CHECK,NAMESPACE %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common -DUSE_NAMESPACE %s | FileCheck --check-prefixes=CHECK,NAMESPACE %s include "reg-with-subregs-common.td" diff --git a/llvm/test/TableGen/pseudo-inst-expansion.td b/llvm/test/TableGen/pseudo-inst-expansion.td --- a/llvm/test/TableGen/pseudo-inst-expansion.td +++ b/llvm/test/TableGen/pseudo-inst-expansion.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-pseudo-lowering -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-pseudo-lowering -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/rc-weight-override.td b/llvm/test/TableGen/rc-weight-override.td --- a/llvm/test/TableGen/rc-weight-override.td +++ b/llvm/test/TableGen/rc-weight-override.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-register-info -I %p/../../include -I %p/Common %s | FileCheck %s include "reg-with-subregs-common.td" diff --git a/llvm/test/TableGen/searchabletables-intrinsic.td b/llvm/test/TableGen/searchabletables-intrinsic.td --- a/llvm/test/TableGen/searchabletables-intrinsic.td +++ b/llvm/test/TableGen/searchabletables-intrinsic.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-searchable-tables -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-searchable-tables -I %p/../../include %s | FileCheck %s // XFAIL: vg_leak include "llvm/TableGen/SearchableTable.td" diff --git a/llvm/test/TableGen/simplify-patfrag.td b/llvm/test/TableGen/simplify-patfrag.td --- a/llvm/test/TableGen/simplify-patfrag.td +++ b/llvm/test/TableGen/simplify-patfrag.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-dag-isel -I %p/../../include %s 2>&1 | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-dag-isel -I %p/../../include %s 2>&1 | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/trydecode-emission.td b/llvm/test/TableGen/trydecode-emission.td --- a/llvm/test/TableGen/trydecode-emission.td +++ b/llvm/test/TableGen/trydecode-emission.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s // Check that if decoding of an instruction fails and the instruction does not // have a complete decoder method that can determine if the bitpattern is valid diff --git a/llvm/test/TableGen/trydecode-emission2.td b/llvm/test/TableGen/trydecode-emission2.td --- a/llvm/test/TableGen/trydecode-emission2.td +++ b/llvm/test/TableGen/trydecode-emission2.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/TableGen/trydecode-emission3.td b/llvm/test/TableGen/trydecode-emission3.td --- a/llvm/test/TableGen/trydecode-emission3.td +++ b/llvm/test/TableGen/trydecode-emission3.td @@ -1,4 +1,4 @@ -// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s +// RUN: %llvm-cg-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s include "llvm/Target/Target.td" diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py --- a/llvm/test/lit.cfg.py +++ b/llvm/test/lit.cfg.py @@ -147,6 +147,7 @@ ToolSubst('%ocamlc', ocamlc_command, unresolved='ignore'), ToolSubst('%ocamlopt', ocamlopt_command, unresolved='ignore'), ToolSubst('%opt-viewer', opt_viewer_cmd), + ToolSubst('%llvm-cg-tblgen', FindTool('llvm-cg-tblgen')), ToolSubst('%llvm-objcopy', FindTool('llvm-objcopy')), ToolSubst('%llvm-strip', FindTool('llvm-strip')), ToolSubst('%llvm-install-name-tool', FindTool('llvm-install-name-tool')), diff --git a/llvm/unittests/TableGen/CMakeLists.txt b/llvm/unittests/TableGen/CMakeLists.txt --- a/llvm/unittests/TableGen/CMakeLists.txt +++ b/llvm/unittests/TableGen/CMakeLists.txt @@ -5,6 +5,8 @@ set(LLVM_TARGET_DEFINITIONS Automata.td) +set(LLVM_TABLEGEN_EXE llvm-cg-tblgen) + tablegen(LLVM AutomataTables.inc -gen-searchable-tables) tablegen(LLVM AutomataAutomata.inc -gen-automata) add_public_tablegen_target(AutomataTestTableGen) diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/CGTableGen.cpp copy from llvm/utils/TableGen/TableGen.cpp copy to llvm/utils/TableGen/CGTableGen.cpp --- a/llvm/utils/TableGen/TableGen.cpp +++ b/llvm/utils/TableGen/CGTableGen.cpp @@ -1,4 +1,4 @@ -//===- TableGen.cpp - Top-Level TableGen implementation for LLVM ----------===// +//===- CGTableGen.cpp - Top-Level TableGen implementation for LLVM --------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -42,14 +42,8 @@ GenDFAPacketizer, GenFastISel, GenSubtarget, - GenIntrinsicEnums, - GenIntrinsicImpl, PrintEnums, PrintSets, - GenOptParserDefs, - GenOptRST, - GenCTags, - GenAttributes, GenSearchableTables, GenGlobalISel, GenGICombiner, @@ -59,10 +53,7 @@ GenRegisterBank, GenExegesis, GenAutomata, - GenDirectivesEnumDecl, - GenDirectivesEnumImpl, GenDXILOperation, - GenRISCVTargetDef, }; namespace llvm { @@ -112,18 +103,6 @@ "Generate a \"fast\" instruction selector"), clEnumValN(GenSubtarget, "gen-subtarget", "Generate subtarget enumerations"), - clEnumValN(GenIntrinsicEnums, "gen-intrinsic-enums", - "Generate intrinsic enums"), - clEnumValN(GenIntrinsicImpl, "gen-intrinsic-impl", - "Generate intrinsic information"), - clEnumValN(PrintEnums, "print-enums", "Print enum values for a class"), - clEnumValN(PrintSets, "print-sets", - "Print expanded sets for testing DAG exprs"), - clEnumValN(GenOptParserDefs, "gen-opt-parser-defs", - "Generate option definitions"), - clEnumValN(GenOptRST, "gen-opt-rst", "Generate option RST"), - clEnumValN(GenCTags, "gen-ctags", "Generate ctags-compatible index"), - clEnumValN(GenAttributes, "gen-attrs", "Generate attributes"), clEnumValN(GenSearchableTables, "gen-searchable-tables", "Generate generic binary-searchable table"), clEnumValN(GenGlobalISel, "gen-global-isel", @@ -141,14 +120,11 @@ clEnumValN(GenExegesis, "gen-exegesis", "Generate llvm-exegesis tables"), clEnumValN(GenAutomata, "gen-automata", "Generate generic automata"), - clEnumValN(GenDirectivesEnumDecl, "gen-directive-decl", - "Generate directive related declaration code (header file)"), - clEnumValN(GenDirectivesEnumImpl, "gen-directive-impl", - "Generate directive related implementation code"), + + + clEnumValN(GenDXILOperation, "gen-dxil-operation", - "Generate DXIL operation information"), - clEnumValN(GenRISCVTargetDef, "gen-riscv-target-def", - "Generate the list of CPU for RISCV"))); + "Generate DXIL operation information"))); cl::OptionCategory PrintEnumsCat("Options for -print-enums"); cl::opt Class("class", cl::desc("Print Enum list for this class"), cl::value_desc("class name"), @@ -209,18 +185,6 @@ case GenSubtarget: EmitSubtarget(Records, OS); break; - case GenIntrinsicEnums: - EmitIntrinsicEnums(Records, OS); - break; - case GenIntrinsicImpl: - EmitIntrinsicImpl(Records, OS); - break; - case GenOptParserDefs: - EmitOptParser(Records, OS); - break; - case GenOptRST: - EmitOptRST(Records, OS); - break; case PrintEnums: { for (Record *Rec : Records.getAllDerivedDefinitions(Class)) OS << Rec->getName() << ", "; @@ -241,12 +205,6 @@ } break; } - case GenCTags: - EmitCTags(Records, OS); - break; - case GenAttributes: - EmitAttributes(Records, OS); - break; case GenSearchableTables: EmitSearchableTables(Records, OS); break; @@ -274,18 +232,9 @@ case GenAutomata: EmitAutomata(Records, OS); break; - case GenDirectivesEnumDecl: - EmitDirectivesDecl(Records, OS); - break; - case GenDirectivesEnumImpl: - EmitDirectivesImpl(Records, OS); - break; case GenDXILOperation: EmitDXILOperation(Records, OS); break; - case GenRISCVTargetDef: - EmitRISCVTargetDef(Records, OS); - break; } return false; diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt --- a/llvm/utils/TableGen/CMakeLists.txt +++ b/llvm/utils/TableGen/CMakeLists.txt @@ -2,20 +2,24 @@ set(LLVM_LINK_COMPONENTS Support) -add_tablegen(llvm-tblgen LLVM +add_llvm_library(TableGenCommon EXCLUDE_FROM_ALL + CodeGenIntrinsics.cpp + SDNodeProperties.cpp + PARTIAL_SOURCES_INTENDED + ) + +add_tablegen(llvm-cg-tblgen LLVM DESTINATION "${LLVM_TOOLS_INSTALL_DIR}" EXPORT LLVM AsmMatcherEmitter.cpp AsmWriterEmitter.cpp AsmWriterInst.cpp - Attributes.cpp CallingConvEmitter.cpp CodeEmitterGen.cpp CodeGenDAGPatterns.cpp CodeGenHwModes.cpp CodeGenInstAlias.cpp CodeGenInstruction.cpp - CodeGenIntrinsics.cpp CodeGenMapTable.cpp CodeGenRegisters.cpp CodeGenSchedule.cpp @@ -28,7 +32,6 @@ DecoderEmitter.cpp DFAEmitter.cpp DFAPacketizerEmitter.cpp - DirectiveEmitter.cpp DisassemblerEmitter.cpp DXILEmitter.cpp ExegesisEmitter.cpp @@ -38,21 +41,14 @@ InfoByHwMode.cpp InstrInfoEmitter.cpp InstrDocsEmitter.cpp - IntrinsicEmitter.cpp - OptEmitter.cpp - OptParserEmitter.cpp - OptRSTEmitter.cpp PredicateExpander.cpp PseudoLoweringEmitter.cpp CompressInstEmitter.cpp RegisterBankEmitter.cpp RegisterInfoEmitter.cpp - RISCVTargetDefEmitter.cpp - SDNodeProperties.cpp SearchableTableEmitter.cpp SubtargetEmitter.cpp SubtargetFeatureInfo.cpp - TableGen.cpp Types.cpp VarLenCodeEmitterGen.cpp X86DisassemblerTables.cpp @@ -62,7 +58,25 @@ X86ModRMFilters.cpp X86RecognizableInstr.cpp WebAssemblyDisassemblerEmitter.cpp + CGTableGen.cpp + PARTIAL_SOURCES_INTENDED + $ + ) +target_link_libraries(llvm-cg-tblgen PRIVATE LLVMTableGenGlobalISel) +set_target_properties(llvm-cg-tblgen PROPERTIES FOLDER "Tablegenning") + +add_tablegen(llvm-tblgen LLVM + DESTINATION "${LLVM_TOOLS_INSTALL_DIR}" + EXPORT LLVM + Attributes.cpp CTagsEmitter.cpp + DirectiveEmitter.cpp + IntrinsicEmitter.cpp + OptEmitter.cpp + OptParserEmitter.cpp + OptRSTEmitter.cpp + RISCVTargetDefEmitter.cpp + TableGen.cpp + $ ) -target_link_libraries(llvm-tblgen PRIVATE LLVMTableGenGlobalISel) set_target_properties(llvm-tblgen PROPERTIES FOLDER "Tablegenning") diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp --- a/llvm/utils/TableGen/TableGen.cpp +++ b/llvm/utils/TableGen/TableGen.cpp @@ -28,20 +28,6 @@ PrintDetailedRecords, NullBackend, DumpJSON, - GenEmitter, - GenRegisterInfo, - GenInstrInfo, - GenInstrDocs, - GenAsmWriter, - GenAsmMatcher, - GenDisassembler, - GenPseudoLowering, - GenCompressInst, - GenCallingConv, - GenDAGISel, - GenDFAPacketizer, - GenFastISel, - GenSubtarget, GenIntrinsicEnums, GenIntrinsicImpl, PrintEnums, @@ -50,30 +36,11 @@ GenOptRST, GenCTags, GenAttributes, - GenSearchableTables, - GenGlobalISel, - GenGICombiner, - GenX86EVEX2VEXTables, - GenX86FoldTables, - GenX86MnemonicTables, - GenRegisterBank, - GenExegesis, - GenAutomata, GenDirectivesEnumDecl, GenDirectivesEnumImpl, - GenDXILOperation, GenRISCVTargetDef, }; -namespace llvm { -cl::opt EmitLongStrLiterals( - "long-string-literals", - cl::desc("when emitting large string tables, prefer string literals over " - "comma-separated char literals. This can be a readability and " - "compile-time performance win, but upsets some compilers"), - cl::Hidden, cl::init(true)); -} // end namespace llvm - namespace { cl::opt Action( cl::desc("Action to perform:"), @@ -86,32 +53,6 @@ "Do nothing after parsing (useful for timing)"), clEnumValN(DumpJSON, "dump-json", "Dump all records as machine-readable JSON"), - clEnumValN(GenEmitter, "gen-emitter", "Generate machine code emitter"), - clEnumValN(GenRegisterInfo, "gen-register-info", - "Generate registers and register classes info"), - clEnumValN(GenInstrInfo, "gen-instr-info", - "Generate instruction descriptions"), - clEnumValN(GenInstrDocs, "gen-instr-docs", - "Generate instruction documentation"), - clEnumValN(GenCallingConv, "gen-callingconv", - "Generate calling convention descriptions"), - clEnumValN(GenAsmWriter, "gen-asm-writer", "Generate assembly writer"), - clEnumValN(GenDisassembler, "gen-disassembler", - "Generate disassembler"), - clEnumValN(GenPseudoLowering, "gen-pseudo-lowering", - "Generate pseudo instruction lowering"), - clEnumValN(GenCompressInst, "gen-compress-inst-emitter", - "Generate RISCV compressed instructions."), - clEnumValN(GenAsmMatcher, "gen-asm-matcher", - "Generate assembly instruction matcher"), - clEnumValN(GenDAGISel, "gen-dag-isel", - "Generate a DAG instruction selector"), - clEnumValN(GenDFAPacketizer, "gen-dfa-packetizer", - "Generate DFA Packetizer for VLIW targets"), - clEnumValN(GenFastISel, "gen-fast-isel", - "Generate a \"fast\" instruction selector"), - clEnumValN(GenSubtarget, "gen-subtarget", - "Generate subtarget enumerations"), clEnumValN(GenIntrinsicEnums, "gen-intrinsic-enums", "Generate intrinsic enums"), clEnumValN(GenIntrinsicImpl, "gen-intrinsic-impl", @@ -124,29 +65,10 @@ clEnumValN(GenOptRST, "gen-opt-rst", "Generate option RST"), clEnumValN(GenCTags, "gen-ctags", "Generate ctags-compatible index"), clEnumValN(GenAttributes, "gen-attrs", "Generate attributes"), - clEnumValN(GenSearchableTables, "gen-searchable-tables", - "Generate generic binary-searchable table"), - clEnumValN(GenGlobalISel, "gen-global-isel", - "Generate GlobalISel selector"), - clEnumValN(GenGICombiner, "gen-global-isel-combiner", - "Generate GlobalISel combiner"), - clEnumValN(GenX86EVEX2VEXTables, "gen-x86-EVEX2VEX-tables", - "Generate X86 EVEX to VEX compress tables"), - clEnumValN(GenX86FoldTables, "gen-x86-fold-tables", - "Generate X86 fold tables"), - clEnumValN(GenX86MnemonicTables, "gen-x86-mnemonic-tables", - "Generate X86 mnemonic tables"), - clEnumValN(GenRegisterBank, "gen-register-bank", - "Generate registers bank descriptions"), - clEnumValN(GenExegesis, "gen-exegesis", - "Generate llvm-exegesis tables"), - clEnumValN(GenAutomata, "gen-automata", "Generate generic automata"), clEnumValN(GenDirectivesEnumDecl, "gen-directive-decl", "Generate directive related declaration code (header file)"), clEnumValN(GenDirectivesEnumImpl, "gen-directive-impl", "Generate directive related implementation code"), - clEnumValN(GenDXILOperation, "gen-dxil-operation", - "Generate DXIL operation information"), clEnumValN(GenRISCVTargetDef, "gen-riscv-target-def", "Generate the list of CPU for RISCV"))); cl::OptionCategory PrintEnumsCat("Options for -print-enums"); @@ -167,48 +89,6 @@ case DumpJSON: EmitJSON(Records, OS); break; - case GenEmitter: - EmitCodeEmitter(Records, OS); - break; - case GenRegisterInfo: - EmitRegisterInfo(Records, OS); - break; - case GenInstrInfo: - EmitInstrInfo(Records, OS); - break; - case GenInstrDocs: - EmitInstrDocs(Records, OS); - break; - case GenCallingConv: - EmitCallingConv(Records, OS); - break; - case GenAsmWriter: - EmitAsmWriter(Records, OS); - break; - case GenAsmMatcher: - EmitAsmMatcher(Records, OS); - break; - case GenDisassembler: - EmitDisassembler(Records, OS); - break; - case GenPseudoLowering: - EmitPseudoLowering(Records, OS); - break; - case GenCompressInst: - EmitCompressInst(Records, OS); - break; - case GenDAGISel: - EmitDAGISel(Records, OS); - break; - case GenDFAPacketizer: - EmitDFAPacketizer(Records, OS); - break; - case GenFastISel: - EmitFastISel(Records, OS); - break; - case GenSubtarget: - EmitSubtarget(Records, OS); - break; case GenIntrinsicEnums: EmitIntrinsicEnums(Records, OS); break; @@ -247,42 +127,12 @@ case GenAttributes: EmitAttributes(Records, OS); break; - case GenSearchableTables: - EmitSearchableTables(Records, OS); - break; - case GenGlobalISel: - EmitGlobalISel(Records, OS); - break; - case GenGICombiner: - EmitGICombiner(Records, OS); - break; - case GenRegisterBank: - EmitRegisterBank(Records, OS); - break; - case GenX86EVEX2VEXTables: - EmitX86EVEX2VEXTables(Records, OS); - break; - case GenX86MnemonicTables: - EmitX86MnemonicTables(Records, OS); - break; - case GenX86FoldTables: - EmitX86FoldTables(Records, OS); - break; - case GenExegesis: - EmitExegesis(Records, OS); - break; - case GenAutomata: - EmitAutomata(Records, OS); - break; case GenDirectivesEnumDecl: EmitDirectivesDecl(Records, OS); break; case GenDirectivesEnumImpl: EmitDirectivesImpl(Records, OS); break; - case GenDXILOperation: - EmitDXILOperation(Records, OS); - break; case GenRISCVTargetDef: EmitRISCVTargetDef(Records, OS); break;