llvm-project/llvm/utils/TableGen
Nikita Popov 2a26a445b3 [Attributes] Make intrinsic attribute generation more flexible (NFC)
Currently attributes for intrinsics are emitted using the
ArrayRef<AttrKind> based constructor for AttributeLists. This works
out fine for simple enum attributes, but doesn't really generalize
to attributes that accept values. We're already doing something
awkward for alignment attributes, and I'd like to have a cleaner
solution to this with
https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579 in mind.

The new generation approach is to instead directly construct
Attributes, giving us access to the full generality of that
interface. To avoid significantly increasing the size of the
generated code, we now also deduplicate the attribute sets. The
code generated per unique AttributeList looks like this:

  case 204: {
    AS[0] = {1, getIntrinsicArgAttributeSet(C, 5)};
    AS[1] = {AttributeList::FunctionIndex, getIntrinsicFnAttributeSet(C, 10)};
    NumAttrs = 2;
    break;
  }

and then the helper functions contain something like

  case 5:
    return AttributeSet::get(C, {
      Attribute::get(C, Attribute::NoCapture),
    });

and

  case 10:
    return AttributeSet::get(C, {
      Attribute::get(C, Attribute::NoUnwind),
      Attribute::get(C, Attribute::ArgMemOnly),
    });

A casualty of this change is the intrin-properties.td test, as I
don't think that FileCheck allows matching this kind of output.

Differential Revision: https://reviews.llvm.org/D135679
2022-10-12 10:56:01 +02:00
..
GlobalISel [GISel] TreeMatcher: always skip leaves if they don't care 2022-09-20 20:55:02 +00:00
AsmMatcherEmitter.cpp [llvm] Use llvm::find_if (NFC) 2022-08-28 10:41:48 -07:00
AsmWriterEmitter.cpp [llvm] Use std::size instead of llvm::array_lengthof 2022-09-08 09:01:53 -06:00
AsmWriterInst.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
AsmWriterInst.h
Attributes.cpp [llvm] Qualify auto in range-based for loops (NFC) 2022-09-03 11:17:49 -07:00
CMakeLists.txt [cmake] Fix tablegen exports 2022-08-16 14:17:23 +02:00
CTagsEmitter.cpp [TableGen] Add a location for a class definition that was forward-declared 2022-07-20 15:56:17 +02:00
CallingConvEmitter.cpp [SystemZ][z/OS] Introduce CCAssignToRegAndStack to calling convention 2022-07-19 13:55:25 -04:00
CodeEmitterGen.cpp [TableGen] Add useDeprecatedPositionallyEncodedOperands option. 2022-09-24 09:40:45 -04:00
CodeGenDAGPatterns.cpp GlobalISel: Allow forming atomic/volatile G_ZEXTLOAD 2022-07-08 11:55:08 -04:00
CodeGenDAGPatterns.h [llvm] Use std::underlying_type_t (NFC) 2022-09-25 23:14:15 -07:00
CodeGenHwModes.cpp
CodeGenHwModes.h
CodeGenInstruction.cpp [TableGen][CodeEmitterGen] Allow local names for sub-operands in a operand list. 2022-09-24 09:40:44 -04:00
CodeGenInstruction.h [TableGen][CodeEmitterGen] Allow local names for sub-operands in a operand list. 2022-09-24 09:40:44 -04:00
CodeGenIntrinsics.h [Attributes] Make intrinsic attribute generation more flexible (NFC) 2022-10-12 10:56:01 +02:00
CodeGenMapTable.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
CodeGenRegisters.cpp RegAllocGreedy: Avoid overflowing priority bitfields 2022-09-15 10:38:40 -04:00
CodeGenRegisters.h RegAllocGreedy: Avoid overflowing priority bitfields 2022-09-15 10:38:40 -04:00
CodeGenSchedule.cpp [llvm-tblgen] CodeGenSchedModels::hasReadOfWrite gets wrong predication result 2022-09-19 14:22:43 +08:00
CodeGenSchedule.h Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
CodeGenTarget.cpp [TableGen] Change representation of ArgumentAttributes (NFC) 2022-10-11 15:03:38 +02:00
CodeGenTarget.h Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
CompressInstEmitter.cpp [RISCV][TableGen] Mark MachineInstr with FrameIndex as not compressible 2022-08-24 13:23:38 +08:00
DAGISelEmitter.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
DAGISelMatcher.cpp
DAGISelMatcher.h
DAGISelMatcherEmitter.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
DAGISelMatcherGen.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
DAGISelMatcherOpt.cpp
DFAEmitter.cpp [tblgen] Use std::variant to simplify code. NFCI. 2022-08-27 10:50:28 +02:00
DFAEmitter.h
DFAPacketizerEmitter.cpp Cleanup include: TableGen 2022-03-11 11:41:32 +01:00
DXILEmitter.cpp [NFC] Make dxil namespace consistent 2022-09-21 17:48:13 -05:00
DecoderEmitter.cpp [TableGen] Add useDeprecatedPositionallyEncodedOperands option. 2022-09-24 09:40:45 -04:00
DirectiveEmitter.cpp Use llvm::sort instead of std::sort where possible 2022-07-23 15:19:05 +02:00
DisassemblerEmitter.cpp [NFC] Rename `FixedLenDecoderEmitter` as `DecoderEmitter` 2022-05-03 03:37:13 +08:00
ExegesisEmitter.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
FastISelEmitter.cpp [FastISel] Propagate PCSections metadata to MachineInstr 2022-09-07 11:36:01 +02:00
GICombinerEmitter.cpp [GIsel] Add missing space between type and name in GICombinerHelperArg 2022-08-02 13:35:25 -04:00
GlobalISelEmitter.cpp [TableGen] Add `countRendererFns` to `InstructionOperandMatcher` 2022-09-30 07:26:30 +00:00
InfoByHwMode.cpp
InfoByHwMode.h
InstrDocsEmitter.cpp
InstrInfoEmitter.cpp [MachineInstr] Use unsigned int for opcode (NFC) 2022-10-07 18:15:22 +05:30
IntrinsicEmitter.cpp [Attributes] Make intrinsic attribute generation more flexible (NFC) 2022-10-12 10:56:01 +02:00
OptEmitter.cpp
OptEmitter.h
OptParserEmitter.cpp [llvm] Use value_or instead of getValueOr (NFC) 2022-06-18 23:07:11 -07:00
OptRSTEmitter.cpp [clang-tblgen] Automatically document options values 2022-04-20 22:00:06 +02:00
PredicateExpander.cpp
PredicateExpander.h
PseudoLoweringEmitter.cpp [TableGen] Remove the use of global Record state 2022-05-11 11:55:33 -07:00
RegisterBankEmitter.cpp [llvm] Call *set::insert without checking membership first (NFC) 2022-06-18 08:32:54 -07:00
RegisterInfoEmitter.cpp Add all constant physical registers to callee preserved masks 2022-09-21 12:50:12 +00:00
SDNodeProperties.cpp
SDNodeProperties.h
SearchableTableEmitter.cpp [llvm] Qualify auto in range-based for loops (NFC) 2022-09-03 11:17:49 -07:00
SequenceToOffsetTable.h [TableGen] emitStringLiteralDef: Pad trailing '\0' at the end of char array. 2022-05-24 06:25:10 +09:00
SubtargetEmitter.cpp [NFC] Remove unused parameters for SubtargetEmitter::ParseFeaturesFunction 2022-03-19 19:14:22 +08:00
SubtargetFeatureInfo.cpp [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
SubtargetFeatureInfo.h
TableGen.cpp [TableGen][DirectX] Add tableGen backend to generate DXIL operation for DirectX backend. 2022-06-14 17:31:58 -07:00
TableGenBackends.h [TableGen][DirectX] Add tableGen backend to generate DXIL operation for DirectX backend. 2022-06-14 17:31:58 -07:00
Types.cpp
Types.h
VarLenCodeEmitterGen.cpp [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf 2022-05-19 11:23:13 +01:00
VarLenCodeEmitterGen.h [TableGen] Add support for variable length instruction in decoder generator 2022-05-03 03:37:13 +08:00
WebAssemblyDisassemblerEmitter.cpp [WebAssembly][NFC] Convert StackBased instruction field to 'bit' from string 2022-05-17 11:02:30 +01:00
WebAssemblyDisassemblerEmitter.h
X86DisassemblerShared.h
X86DisassemblerTables.cpp [llvm] Remove includes of `llvm/Support/STLArrayExtras.h` 2022-09-09 17:44:00 -06:00
X86DisassemblerTables.h
X86EVEX2VEXTablesEmitter.cpp [X86][tablgen] Extract common functions in X86EVEX2VEXTablesEmitter.cpp and X86FoldTablesEmitter.cpp to avoid duplicated code. NFC 2022-03-27 08:47:18 +08:00
X86FoldTablesEmitter.cpp [X86][tablgen] Add one entry manually into the memory folding table 2022-04-06 22:06:15 +08:00
X86MnemonicTables.cpp [X86][tablgen] Refine the class RecognizableInstr. NFCI 2022-03-26 22:41:49 +08:00
X86ModRMFilters.cpp
X86ModRMFilters.h
X86RecognizableInstr.cpp [TableGen][X86] Add Size field to X86MemOperand class 2022-06-19 11:46:56 -07:00
X86RecognizableInstr.h [X86][tablgen] Extract common functions in X86EVEX2VEXTablesEmitter.cpp and X86FoldTablesEmitter.cpp to avoid duplicated code. NFC 2022-03-27 08:47:18 +08:00
tdtags