[llvm] GlobalISel/MachineIRBuilder: Construct DstOp with VRegAttrs (PR #113581)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 20:56:39 PDT 2024


================
@@ -356,6 +356,20 @@ GISelInstProfileBuilder::addNodeIDRegType(const RegisterBank *RB) const {
   return *this;
 }
 
+const GISelInstProfileBuilder &GISelInstProfileBuilder::addNodeIDRegType(
+    MachineRegisterInfo::VRegAttrs Attrs) const {
+  addNodeIDRegType(Attrs.Ty);
+
+  const RegClassOrRegBank &RCOrRB = Attrs.RCOrRB;
+  if (RCOrRB) {
+    if (const auto *RB = dyn_cast_if_present<const RegisterBank *>(RCOrRB))
+      addNodeIDRegType(RB);
+    else
+      addNodeIDRegType(dyn_cast<const TargetRegisterClass *>(RCOrRB));
----------------
arsenm wrote:

```suggestion
      addNodeIDRegType(cast<const TargetRegisterClass *>(RCOrRB));
```

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


More information about the llvm-commits mailing list