The code that handles ISD:Register and ISD::CopyFromReg assumes
the target is amdgcn, so this is broken on r600. We don't
need this analysis on r600 anyway so we can safely move
it to SITargetLowering.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 19211 Build 19211: arc lint + arc unit
Event Timeline
lib/Target/AMDGPU/AMDGPUISelLowering.cpp | ||
---|---|---|
786–787 | Is the "// workitem.id.x workitem.id.y workitem.id.z" comment still relevant? |
Could you please clarify - why do you consider that check meaningless for r600?
I see that this line : " const SISubtarget &ST = MF->getSubtarget<SISubtarget>(); " is misleading and in fact is not correct.
I'd better check and choose the R600Subtarget or SISubtarget.
If I understand right we need just check which subtarget to retrieve for physregs check.
Since we consider any VGPR formal argument as divergent it does not matter R600 or SI at all.
We need to choose right TargetRegisterInfo (r600 or SI again)
So, for virtual register : if (MRI.isLiveIn(Reg) && TRI.isVGPR(Reg) ) return true
Or I maybe don't know something substantial? :)
I would expect the TRI.isVGPR() call to crash if this was called from an R600 code path, so that made me think this was dead code.
I agree isVGPR should be illegal to call for R600
So, how would you handle the bunch of r600 tests then?
We could claim the support of DA related stuff for GCN only but it should be explicitly agreed and documented somehow.
Disable this for r600. It doesn't have the SGPR/VGPR split issue we want this for, so it doesn't really matter
My patch does this, but just for ISD:Register and ISD::CopyFromRegister, should I just disable this analysis completely for r600?
should I just disable this analysis completely for r600?
I'd like this better. It looks like cleaner way.
And yes it's okay to remove r600 registers from isSDNodeSourceOfDivergence
lib/Target/AMDGPU/AMDGPUISelLowering.cpp | ||
---|---|---|
786–787 | Just move this into SIISlLowering instead? |
Move isSDNodeSourceOfDivergence() implementation from AMDGPUTargetLowering
to SITargetLowering.
Is the "// workitem.id.x workitem.id.y workitem.id.z" comment still relevant?