Details
Diff Detail
Event Timeline
Hi Daniel,
Sometimes masks are quite big. I wonder if this behavior should be behind a flag, maybe on by default though.
Cheers,
-Quentin
lib/CodeGen/MachineInstr.cpp | ||
---|---|---|
415 | I would have expected the loop to look a bit differently to avoid the divide and modulo: for (unsigned Idx = BaseIdx; Offset < BaseIdx + 32; ++Offset) OS << " " << PrintReg(Idx, TRI); } |
Sometimes masks are quite big. I wonder if this behavior should be behind a flag, maybe on by default though.
Ok. I'll post an updated patch that adds an option shortly.
lib/CodeGen/MachineInstr.cpp | ||
---|---|---|
415 | A good compiler will reduce the divide and modulo to 'x>>5' and 'x&31', but I thought it was clearer to use 'x/32' and 'x%32' in the source.
I don't think this loop works correctly. The array can have runs of zero words inside it and is not guaranteed to end in a zero word. |
lib/CodeGen/MachineInstr.cpp | ||
---|---|---|
415 |
Of course, you’re right. I must have mixed that with another API :). |
Add an option to print the whole regmask (currently on by default but I don't
mind either way). When disabled, the first 10 will be printed followed by
"and %d more...".
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) {
}