summaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/CodeGenSchedule.cpp
AgeCommit message (Collapse)Author
2025-09-04[NFC][TableGen] Adopt `CodeGenInstruction::getName()` (#156968)Rahul Joshi
Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2025-07-19[TableGen] Add `getName()` to error messages for better debugging (#149531)Shaoce SUN
Including the name helps quickly locate the corresponding Instruction that caused the issue.
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-24[NFC][TableGen] Use ArrayRef instead of const vector reference (#145323)Rahul Joshi
- Use `ArrayRef` instead of `SmallVector` reference in a few places. - Drop redundant `llvm::` in a few places.
2025-06-15[TableGen] Use range-based for loops (NFC) (#144283)Kazu Hirata
2025-06-07[TableGen] Use `contains` instead of `count`. NFC. (#143156)Jay Foad
2025-05-12[NFC][TableGen] Use StringRef::str() instead of casting (#139332)Rahul Joshi
- Also eliminate unneeded std::string() around some literal strings.
2025-05-12[NFC][TableGen] Add {} for `else` when `if` body has {} (#139420)Rahul Joshi
2025-02-09[TableGen] Avoid repeated hash lookups (NFC) (#126433)Kazu Hirata
2025-01-23[TableGen] Add a SmallPtrSet to track WriteRes that are referenced by some ↵Craig Topper
ReadAdvance. NFC (#124160) Use this to remove a linear scan from CodeGenProcModel::hasReadOfWrite. This reduces build time of RISCVGenSubtargetInfo.inc on by machine from ~6 seconds to ~3 seconds.
2025-01-23[TableGen] Pass CodeGenProcModel reference instead of index to ↵Craig Topper
addWriteRes/addReadAdvance. NFC 2 of the 3 callers of each of these already had a reference they converted to index. Use that reference and make the one caller that only has an index responsible for looking up the reference from it.
2025-01-22[TableGen] Add maps from Write/ReadType to the parent WriteRes/ReadAdvance. ↵Craig Topper
NFC (#123876) Use this to improve performance of SubtargetEmitter::findWriteResources and SubtargetEmitter::findReadAdvance. Now we can do a map lookup instead of a linear search through all WriteRes/ReadAdvance records. This reduces the build time of RISCVGenSubtargetInfo.inc on my machine from 43 seconds to 10 seconds.
2025-01-20[TableGen] Avoid repeated hash lookups (NFC) (#123562)Kazu Hirata
2025-01-18[TableGen] Replace some uses of make_range with methods that already return ↵Craig Topper
a range. NFC (#123453)
2025-01-17[TableGen] const-correct a couple CodeGenSchedule methods. NFCCraig Topper
2025-01-18[TableGen] Fix unused-variable warnings in CodeGenSchedule.cpp (NFC)Jie Fu
/llvm-project/llvm/utils/TableGen/Common/CodeGenSchedule.cpp:1704:32: error: unused variable 'Seq' [-Werror,-Wunused-variable] SmallVectorImpl<unsigned> &Seq = ^ /llvm-project/llvm/utils/TableGen/Common/CodeGenSchedule.cpp:1713:32: error: unused variable 'Seq' [-Werror,-Wunused-variable] SmallVectorImpl<unsigned> &Seq = ^ 2 errors generated.
2025-01-17[TableGen] Use a range-based for loop. NFC (#123443)Craig Topper
2025-01-17[TableGen] Use vector constructor instead of calling append or emplace_back ↵Craig Topper
on an empty vector. NFC (#123442)
2025-01-17[TableGen] Inline a helper function that didn't seem necessary. NFC (#123440)Craig Topper
The function called find_if and converted the iterator to an index. The caller then had to check the index being non-zero to know if the find succeeded. Seems better to just do the find and distance in the caller.
2025-01-16[TableGen] Use std::pair instead of std::make_pair. NFC. (#123174)Jay Foad
Also use brace initialization and emplace to avoid explicitly constructing std::pair, and the same for std::tuple.
2025-01-12Partially revert "[TableGen] Avoid repeated hash lookups (NFC) (#122586)"Kazu Hirata
This partially reverts commit 07ff786e39e2190449998d3af1000454dee501be. The hunk being reverted in this patch seems to break: tools/llvm-gsymutil/ARM_AArch64/macho-merged-funcs-dwarf.yaml under LLVM_ENABLE_EXPENSIVE_CHECKS.
2025-01-11[TableGen] Avoid repeated hash lookups (NFC) (#122586)Kazu Hirata
2024-10-18[LLVM][TableGen] Change all `Init` pointers to const (#112705)Rahul Joshi
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-10-03[NFC][TableGen] Change `RecordKeeper::getDef()` to return const pointer ↵Rahul Joshi
(#110992) 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-10-02[TableGen] Change `DefInit::Def` to a const Record pointer (#110747)Rahul Joshi
This change undoes a const_cast<> introduced in an earlier change to help transition to const pointers. It 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-10-01[TableGen] Change `getValueAsListOfDefs` to return const pointer vector ↵Rahul Joshi
(#110713) Change `getValueAsListOfDefs` to return a vector of const Record pointer, and remove `getValueAsListOfConstDefs` that was added as a transition aid. 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 CodeGenSchedule to use const Record pointers (#108782)Rahul Joshi
Change CodeGenSchedule to use const Record pointers. 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 CodeGenSchedule to use const RecordKeeper (#108617)Rahul Joshi
Change CodeGenSchedule 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-11[TableGen] Change CodeGenInstruction record members to const (#107921)Rahul Joshi
Change CodeGenInstruction::{TheDef, InfereredFrom} to const pointers. 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 SetTheory set/vec to use const Record * (#107692)Rahul Joshi
Change SetTheory::RecSet/RecVec to use const Record pointers.
2024-08-22[NFC][SetTheory] Refactor to use const pointers and range loops (#105544)Rahul Joshi
- Refactor SetTheory code to use const pointers when possible. - Use auto for variables initialized using dyn_cast<>. - Use range based for loops and early continue.
2024-08-08[TableGen] Rework error reporting for duplicate Feature/Processor (#102257)Rahul Joshi
- Extract code for sorting and checking duplicate Records into a helper function and update `collectProcModels` to use the helper. - Update `FeatureKeyValues` to: (a) Remove code for duplicate checks and use the helper. (b) Trim features with empty name explicitly to be able to use the helper. - Make the sorting deterministic by using record name as a secondary key for sorting, and re-enable SubtargetFeatureUniqueNames.td test that was disabled due to the non-determinism of the error messages. - Change wording of error message when duplicate records are found to be source code position agnostic, since `First` may not be before `Second` lexically.
2024-06-02[TableGen] Use llvm::unique (NFC) (#94163)Kazu Hirata
2024-05-14[TableGen][SubtargetEmitter] Refactor hasReadOfWrite to CodeGenProcModel ↵Michael Maitland
(#92032) SubtargetEmitter::GenSchedClassTables takes a CodeGenProcModel, but calls hasReadOfWrite which loops over all ProcModels. We move hasReadOfWrite to CodeGenProcModel and remove the loop over all ProcModels. This leads to a 144% speedup on the RISC-V backend of our downstream.
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