We still have to fix the PHI if there is at least one VGPR operand.
Details
Diff Detail
Event Timeline
| lib/Target/AMDGPU/SIFixSGPRCopies.cpp | ||
|---|---|---|
| 608 | I think you should move the below phiHasVGPROperands check first rather than adding a second one | |
| test/CodeGen/AMDGPU/vgpr-to-sgpr-phi.ll | ||
| 4 | GCN check prefix | |
| 8 | It may be better to reformulate as a kernel for now, which will require a non-argument source for the VGPR | |
| 8–10 | Run instnamer on test. Also can be merged | |
| 31 | Drop extra string attributes | |
| 35 | Drop all metadata | |
Update based on Matt's review.
For the test:
- need details on how to change to a kernel, especially what the argument should be.
- I tried a few options, but it seems we could not reproduce the issue with the kernel version, possibly because code is optimized away.
- not clear what to merge!
| test/CodeGen/AMDGPU/vgpr-to-sgpr-phi.ll | ||
|---|---|---|
| 7 | The issue is not reproducible if I make it a kernel. | |
| 8–10 | Can you be more specific which test should I merge to? It is not clear to me which tests are for this pass (simply guess from the names). Which test is for the following piece of code? // We don't need to fix the PHI if the common dominator of the
// two incoming blocks terminates with a uniform branch.
if (MI.getNumExplicitOperands() == 5) {
MachineBasicBlock *MBB0 = MI.getOperand(2).getMBB();
MachineBasicBlock *MBB1 = MI.getOperand(4).getMBB();
if (!predsHasDivergentTerminator(MBB0, TRI) &&
!predsHasDivergentTerminator(MBB1, TRI)) {
DEBUG(dbgs() << "Not fixing PHI for uniform branch: " << MI << '\n');
break;
}
} | |
Merge the test into uniform-cfg.ll.
I can not find an approach to change the test to a kernel and yet still be able to reproduce the issue.
So I think it is OK to use a function here.
I think you should move the below phiHasVGPROperands check first rather than adding a second one