[llvm] [CodeGen] Precompute untyped getMinimalPhysRegClass (PR #193438)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 07:26:23 PDT 2026


================
@@ -263,6 +263,10 @@ getCommonMinimalPhysRegClass(const TargetRegisterInfo *TRI, MCRegister Reg1,
 
 const TargetRegisterClass *
 TargetRegisterInfo::getMinimalPhysRegClass(MCRegister Reg, MVT VT) const {
+  if (VT == MVT::Other) {
+    if (const TargetRegisterClass *RC = getDefaultMinimalPhysRegClass(Reg))
+      return RC;
+  }
----------------
sdesmalen-arm wrote:

Please move this to the `getMinimalPhysRegClass` implementation above and replace the `VT == MVT::Other` condition with  `IsDefault` (or better yet, with `constexpr (std::is_same_v<TypeT, MVT>) || !Ty.isValid()`).

https://github.com/llvm/llvm-project/pull/193438


More information about the llvm-commits mailing list