[PATCH] D11644: Emit <regmask R1 R2 R3 ...> instead of just <regmask> in IR dumps.

Quentin Colombet qcolombet at apple.com
Thu Jul 30 10:21:15 PDT 2015


qcolombet added a subscriber: qcolombet.
qcolombet added a comment.

Hi Daniel,

Sometimes masks are quite big. I wonder if this behavior should be behind a flag, maybe on by default though.

Cheers,
-Quentin


================
Comment at: lib/CodeGen/MachineInstr.cpp:415
@@ +414,3 @@
+      unsigned MaskBit = i % 32;
+      if (getRegMask()[MaskWord] & (1 << MaskBit))
+        OS << " " << PrintReg(i, TRI);
----------------
I would have expected the loop to look a bit differently to avoid the divide and modulo:
const uint32_t *MaskWord = getRegMask();
unsigned BaseIdx = 0;
for (; MaskWord; ++MaskWord, BaseIdx += 32) {
  for (unsigned Idx = BaseIdx; Offset < BaseIdx + 32; ++Offset)
    OS << " " << PrintReg(Idx, TRI);
}


http://reviews.llvm.org/D11644







More information about the llvm-commits mailing list