This is an archive of the discontinued LLVM Phabricator instance.

[RegisterPressure] Use Register instead of unsigned for RegUnit
AbandonedPublic

Authored by foad on Aug 21 2020, 2:10 AM.

Details

Diff Detail

Event Timeline

foad created this revision.Aug 21 2020, 2:10 AM
foad requested review of this revision.Aug 21 2020, 2:10 AM
foad edited reviewers, added: fhahn; removed: Hahnfeld.Aug 21 2020, 2:15 AM

There is one thing I never really understood: is regunit really a register? On our target it is for the fact, but generally speaking? It looks like a quite artificial iterator for me. In particular regunit numerical value does not need to match any real physreg as far as I understand.

foad added a comment.Aug 21 2020, 2:31 AM

There is one thing I never really understood: is regunit really a register? On our target it is for the fact, but generally speaking? It looks like a quite artificial iterator for me. In particular regunit numerical value does not need to match any real physreg as far as I understand.

Good question. I don't know.

RegUnits are *not* registers, so you should not use Register for them

llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp
351

This query doesn't make any sense

arsenm added inline comments.Aug 21 2020, 6:35 AM
llvm/include/llvm/CodeGen/RegisterPressure.h
40

This is a pretty strange aliasing

foad abandoned this revision.Aug 21 2020, 7:20 AM

RegUnits are *not* registers, so you should not use Register for them

Fair enough. What are they?

llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp
351

Any idea what it should say instead?

RegUnits are *not* registers, so you should not use Register for them

Fair enough. What are they?

They are the smallest tracked piece of a physical register. They aren't necessarily addressable. In VGPR0_VGPR1, since recently we have regunits VGPR0.lo16, VGPR0.hi16, VGPR1.lo16, VGPR1.hi16, even though the high halves can't be encoded in instructions