Skip to content

Commit c727635

Browse files
committed
[TableGen] Avoid field lookup in a critical loop (NFC)
This makes the loop run 10x faster.
1 parent 9d2a66f commit c727635

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/TableGen/Common/CodeGenTarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ void CodeGenTarget::ComputeInstrsByEnum() const {
270270
const Record &D2 = *Rec2->TheDef;
271271
// Sort all pseudo instructions before non-pseudo ones, and sort by name
272272
// within.
273-
return std::tuple(!D1.getValueAsBit("isPseudo"), D1.getName()) <
274-
std::tuple(!D2.getValueAsBit("isPseudo"), D2.getName());
273+
return std::tuple(!Rec1->isPseudo, D1.getName()) <
274+
std::tuple(!Rec2->isPseudo, D2.getName());
275275
});
276276

277277
// Assign an enum value to each instruction according to the sorted order.

0 commit comments

Comments
 (0)