From c727635dfa3f525182f63d8468adc792e7a04194 Mon Sep 17 00:00:00 2001 From: Sergei Barannikov Date: Fri, 22 Aug 2025 04:44:07 +0300 Subject: [PATCH] [TableGen] Avoid field lookup in a critical loop (NFC) This makes the loop run 10x faster. --- llvm/utils/TableGen/Common/CodeGenTarget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/utils/TableGen/Common/CodeGenTarget.cpp b/llvm/utils/TableGen/Common/CodeGenTarget.cpp index a9002c5860fa3..8982927eeefcf 100644 --- a/llvm/utils/TableGen/Common/CodeGenTarget.cpp +++ b/llvm/utils/TableGen/Common/CodeGenTarget.cpp @@ -270,8 +270,8 @@ void CodeGenTarget::ComputeInstrsByEnum() const { const Record &D2 = *Rec2->TheDef; // Sort all pseudo instructions before non-pseudo ones, and sort by name // within. - return std::tuple(!D1.getValueAsBit("isPseudo"), D1.getName()) < - std::tuple(!D2.getValueAsBit("isPseudo"), D2.getName()); + return std::tuple(!Rec1->isPseudo, D1.getName()) < + std::tuple(!Rec2->isPseudo, D2.getName()); }); // Assign an enum value to each instruction according to the sorted order.