[PATCH] D112323: GlobalISel/Utils: Use incoming regbank while constraining the superclasses

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 13:14:45 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:118-119
+  if (MRI.getRegBankOrNull(Reg) && RegClass) {
+    if (const TargetRegisterClass *RC =
+            TRI.getConstrainedRegClassForOperand(RegMO, MRI)) {
+      if (!RegClass->isAllocatable())
----------------
Can this actually fail?


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:120-121
+            TRI.getConstrainedRegClassForOperand(RegMO, MRI)) {
+      if (!RegClass->isAllocatable())
+        RegClass = RC;
+      else if (const TargetRegisterClass *SubRC =
----------------
Why not just call getAllocatableClass on it, like how InstrEmitter does it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112323/new/

https://reviews.llvm.org/D112323



More information about the llvm-commits mailing list