[llvm] 31438d5 - [NFC][TableGen] Use convertInitializerToInt in CodeGenRegister (#180968)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 16 13:25:46 PST 2026


Author: Rahul Joshi
Date: 2026-02-16T13:25:42-08:00
New Revision: 31438d5a92982b5dffcb718ac0ac108f791eefc6

URL: https://github.com/llvm/llvm-project/commit/31438d5a92982b5dffcb718ac0ac108f791eefc6
DIFF: https://github.com/llvm/llvm-project/commit/31438d5a92982b5dffcb718ac0ac108f791eefc6.diff

LOG: [NFC][TableGen] Use convertInitializerToInt in CodeGenRegister (#180968)

Added: 
    

Modified: 
    llvm/utils/TableGen/Common/CodeGenRegisters.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/Common/CodeGenRegisters.cpp b/llvm/utils/TableGen/Common/CodeGenRegisters.cpp
index 9fcbc8d0ac97d..b20312dbbb75b 100644
--- a/llvm/utils/TableGen/Common/CodeGenRegisters.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenRegisters.cpp
@@ -755,8 +755,7 @@ CodeGenRegisterClass::CodeGenRegisterClass(CodeGenRegBank &RegBank,
   GlobalPriority = R->getValueAsBit("GlobalPriority");
 
   const BitsInit *TSF = R->getValueAsBitsInit("TSFlags");
-  for (auto [Idx, Bit] : enumerate(TSF->getBits()))
-    TSFlags |= uint8_t(cast<BitInit>(Bit)->getValue()) << Idx;
+  TSFlags = uint8_t(*TSF->convertInitializerToInt());
 
   // Saturate negative costs to the maximum
   if (CopyCostParsed < 0)


        


More information about the llvm-commits mailing list