[PATCH] D34727: AMDGPU/SI: Don't fix a PHI under uniform branch in SIFixSGPRCopies only when sources and destination are all sgprs

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 10:03:16 PDT 2017


cfang added inline comments.


================
Comment at: test/CodeGen/AMDGPU/vgpr-to-sgpr-phi.ll:7-9
+define void @vgpr_to_sgpr_phi(i32* nocapture) local_unnamed_addr #0 {
+  br label %2
+
----------------
arsenm wrote:
> arsenm wrote:
> > arsenm wrote:
> > > Run instnamer on test. Also can be merged 
> > It may be better to reformulate as a kernel for now, which will require a non-argument source for the VGPR
> It can merge into one of the other test files for this pass
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).
If I place an assert in the place I am working on, I saw more than twenty tests failures. 

 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;
          }
        }


================
Comment at: test/CodeGen/AMDGPU/vgpr-to-sgpr-phi.ll:7
+; GCN: s_branch BB0_1
+define void @vgpr_to_sgpr_phi(i32* nocapture %arg) local_unnamed_addr #0 {
+bb:
----------------
arsenm wrote:
> Does it still reproduce if you make it a kernel?
The issue is not reproducible if I make it a kernel. 


https://reviews.llvm.org/D34727





More information about the llvm-commits mailing list