summaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/CodeGenTarget.h
AgeCommit message (Collapse)Author
2025-11-22[TableGen] Use MVT instead of MVT::SimpleValueType. NFC (#169180)Craig Topper
This improves type safety and is less verbose. Use SimpleTy only where an integer is needed like switches or emitting a VBR. --------- Co-authored-by: Sergei Barannikov <barannikov88@gmail.com>
2025-11-10Remove unused standard headers: <string>, <optional>, <numeric>, <tuple> ↵serge-sans-paille
(#167232)
2025-09-19CodeGen: Add RegisterClass by HwMode (#158269)Matt Arsenault
This is a generalization of the LookupPtrRegClass mechanism. AMDGPU has several use cases for swapping the register class of instruction operands based on the subtarget, but none of them really fit into the box of being pointer-like. The current system requires manual management of an arbitrary integer ID. For the AMDGPU use case, this would end up being around 40 new entries to manage. This just introduces the base infrastructure. I have ports of all the target specific usage of PointerLikeRegClass ready.
2025-07-07[NFC][TableGen] Rename `CodeGenTarget` instruction accessors (#146767)Rahul Joshi
Rename `getXYZInstructionsByEnumValue()` to just `getXYZInstructions` and drop the `ByEnumValue` in the name.
2025-07-02[NFC][TableGen] Add accessors for various instruction subclasses (#146615)Rahul Joshi
- Add various instruction subclass/sub-slice accessors to `CodeGenTarget`. - Delete unused `inst_begin` and `inst_end` iterators. - Rename `Instructions` to `InstructionMap` and `getInstructions` to `getInstructionMap` to better represent their meaning. - Use these new accessors in InstrInfoEmitter
2025-06-09[TableGen] Move getSuperRegForSubReg into CodeGenRegBank. NFC. (#142979)Jay Foad
This method doesn't use anything from CodeGenTarget, so it seems to belong in CodeGenRegBank.
2025-05-07[llvm] Drop "const" from "const ArrayRef" (NFC) (#138818)Kazu Hirata
2024-12-16[TableGen][GISel] Don't use std::optional with pointers (NFC) (#120026)Sergei Barannikov
Pointers already have a well-defined null value.
2024-12-12[TableGen] Replace WantRoot/WantParent SDNode properties with flags (#119599)Sergei Barannikov
These properties are only valid on ComplexPatterns. Having them as flags is more convenient because one can now use "let = ... in" syntax to set these flags on several patterns at a time. This is also less error-prone as it makes it impossible to specify these properties on records derived from SDPatternOperator. Pull Request: https://github.com/llvm/llvm-project/pull/119599
2024-10-30[TableGen] Replace all lingering uses of getName with getEnumNameJessica Clarke
The former is a wrapper for the latter with two differences: Other is mapped to "UNKNOWN" (rather than "MVT::Other"), and iPTR(Any) are mapped to "TLI.getPointerTy()" rather than "MVT::iPTR(Any)". The only uses are in FastISelMap::printFunctionDefinitions. Most of these uses are just a form of name mangling to ensure uniqueness, so the actual string isn't important (and, in the case of MVT::iPTR(Any), were both to be used, they would clash). Two uses are for a case statement, which requires the expression to be a constant (of the right type), but neither UNKNOWN nor TLI.getPointerTy() are constants, so would not work there. The remaining uses are where an expression is needed, so UNKNOWN similarly doesn't work, though TLI.getPointerTy() could in this case. However, neither iPTR nor iPTRAny are supposed to make it this far through TableGen, and should instead have been replaced with concrete types, so this case should not be hit. Moreover, for almost all of these uses, the name is passed to getLegalCName, which will strip an MVT:: prefix but will leave TLI.getPointerTy() unchanged, which is not a valid C identifier, nor component thereof. Thus, delete this unnecessary, and mostly-broken, wrapper and just use the underlying getEnumName. This has been verified to have no effect on the generated files for any in-tree target, including experimental ones. Reviewers: arsenm Reviewed By: arsenm Pull Request: https://github.com/llvm/llvm-project/pull/113731
2024-09-23[LLVM][TableGen] Use const record pointers in TableGen/Common files (#109467)Rahul Joshi
Use const record pointers in TableGen/Common files. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18[LLVM][TableGen] Change InstrInfoEmitter to use const RecordKeeper (#109189)Rahul Joshi
Change InstrInfoEmitter to use const RecordKeeper. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-15[LLVM][TableGen] Change CodeGenDAGPatterns to use const RecordKeeper (#108762)Rahul Joshi
Change CodeGenDAGPatterns to use const RecordKeeper. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-15[LLVM][TableGen] Change CodeGenTarget to use const RecordKeeper (#108752)Rahul Joshi
Change CodeGenTarget to use const RecordKeeper. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-09[TableGen] Change CGIOperandList::OperandInfo::Rec to const pointer (#107858)Rahul Joshi
Change CGIOperandList::OperandInfo::Rec and CGIOperandList::TheDef to const pointer. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-07[TableGen] Eliminate static CodeGenIntrinsicMap in PatternParser (#107339)Rahul Joshi
Instead, move it to CodeGenTarget class, and use it in both PatternParser and SearchableTableEmitter.
2024-08-10[NFC] Fix TableGen include guards to match paths (#102746)Rahul Joshi
- Fix include guards for headers under utils/TableGen to match their paths.
2024-03-25[RFC][TableGen] Restructure TableGen Source (#80847)Pierre van Houtryve
Refactor of the llvm-tblgen source into: - a "Basic" library, which contains the bare minimum utilities to build `llvm-min-tablegen` - a "Common" library which contains all of the helpers for TableGen backends. Such helpers can be shared by more than one backend, and even unit tested (e.g. CodeExpander is, maybe we can add more over time) Fixes #80647