This includes a hazard recognizer implementation to replace some of
the hazard handling we had during frame index elimination.
Details
Diff Detail
Event Timeline
| lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | ||
|---|---|---|
| 392 | Where is this added? | |
| lib/Target/AMDGPU/GCNHazardRecognizer.cpp | ||
| 41–47 | It seems RegDefs isn't actually used anywhere? | |
| 117–118 | Are you sure this does the right thing? According to the comment, definesRegister only returns true if the instruction defines a super-register of Reg, but there is probably also a hazard if it defines a sub-register. | |
| lib/Target/AMDGPU/SIInstrInfo.cpp | ||
| 1209 | Typo: ds_read2 | |
| lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | ||
|---|---|---|
| 392 | ||
| lib/Target/AMDGPU/GCNHazardRecognizer.cpp | ||
| 117–118 | I think to correctly handle physical registers I should be using 'modifiesReigster' instead of 'definesRegister'. For virtual registers the two functions behave the same, and I think this is OK, because when sub-registers are defined by an operand, MO.getReg() will return the super-register and not the sub-register. So MI->defineRegister(Reg) will return true if MI defines a sub-reg of Reg. | |
Use MI->modifiesRegister instead of definesRegister. Also move most of
the EmitInstruction() code into AdvanceCycle() which better matches
how the hazard recognizer is used by the scheduler.
| lib/Target/AMDGPU/GCNHazardRecognizer.cpp | ||
|---|---|---|
| 108 | Typo recogiznizer | |
| 139–140 | A comment about why SI only would be helpful | |
| lib/Target/AMDGPU/GCNHazardRecognizer.h | ||
| 19–22 | I think only <list> is needed here. The others aren't used or can be moved into the cpp file | |
| 31 | final | |
| 33 | Typo: variabled | |
| 48 | Grammar: instruction be cycle | |
| lib/Target/AMDGPU/SIInstrInfo.cpp | ||
| 828 | line break | |
Where is this added?