[PATCH] D21395: Fix for Bug 28144

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 10:27:29 PDT 2016


MatzeB added inline comments.

================
Comment at: lib/CodeGen/RegUsageInfoCollector.cpp:113-126
@@ -112,1 +112,16 @@
 
+  for (MachineBasicBlock &MBB : MF) {
+    for (MachineInstr &MI : MBB) {
+      if (!MI.isCall())
+        continue;
+      for (MachineOperand &MO : MI.operands()) {
+        if (!MO.isRegMask())
+          continue;
+        const uint32_t *CalleeRegMask = MO.getRegMask();
+        for (unsigned i = 0; i < RegMaskSize; ++i)
+          RegMask[i] = RegMask[i] & CalleeRegMask[i];
+        break;
+      }
+    }
+  }
+
----------------
mehdi_amini wrote:
> Matze: I believe the register allocator does not account for register clobbered by callees.
Why do you say so? The registers clobbered by the callees is exactlye what the UsedPhysRegMask in MachineRegisterInfo is about, see also the use of addPhysRegsUsedFromRegMask() in VirtRegMap.cpp/FastRegAlloc.cpp.


http://reviews.llvm.org/D21395





More information about the llvm-commits mailing list