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 | ||
---|---|---|
375 | 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 | ||
1198 | Typo: ds_read2 |
lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | ||
---|---|---|
375 | ||
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 | ||
---|---|---|
107 | Typo recogiznizer | |
138–139 | A comment about why SI only would be helpful | |
lib/Target/AMDGPU/GCNHazardRecognizer.h | ||
18–21 | I think only <list> is needed here. The others aren't used or can be moved into the cpp file | |
30 | final | |
32 | Typo: variabled | |
47 | Grammar: instruction be cycle | |
lib/Target/AMDGPU/SIInstrInfo.cpp | ||
828 | line break |
Where is this added?