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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 17:04:33 PDT 2017


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIFixSGPRCopies.cpp:608
+        if (MI.getNumExplicitOperands() == 5 &&
+            !phiHasVGPROperands(MI, MRI, TRI, TII)) {
           MachineBasicBlock *MBB0 = MI.getOperand(2).getMBB();
----------------
I think you should move the below phiHasVGPROperands check first rather than adding a second one


================
Comment at: test/CodeGen/AMDGPU/vgpr-to-sgpr-phi.ll:3
+
+; CHECK-LABEL: {{^}}vgpr_to_sgpr_phi:
+; CHECK: BB0_1:
----------------
GCN check prefix


================
Comment at: test/CodeGen/AMDGPU/vgpr-to-sgpr-phi.ll:7
+; CHECK: s_branch BB0_1
+define void @vgpr_to_sgpr_phi(i32* nocapture) local_unnamed_addr #0 {
+  br label %2
----------------
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


================
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
+
----------------
Run instnamer on test. Also can be merged 


================
Comment at: test/CodeGen/AMDGPU/vgpr-to-sgpr-phi.ll:30
+
+attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="fiji" "target-features"="+16-bit-insts,+dpp,+fp64-fp16-denormals,+s-memrealtime,-fp32-denormals" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind readnone speculatable }
----------------
Drop extra string attributes


================
Comment at: test/CodeGen/AMDGPU/vgpr-to-sgpr-phi.ll:34
+
+!llvm.module.flags = !{!0}
+
----------------
Drop all metadata


https://reviews.llvm.org/D34727





More information about the llvm-commits mailing list