[PATCH] D35524: [AMDGPU] Add support for Whole Wavefront Mode

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 10:41:42 PDT 2017


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIWholeQuadMode.cpp:619-625
+  assert(SaveOrig);
+  MI = BuildMI(MBB, Before, DebugLoc(), TII->get(AMDGPU::COPY), SaveOrig)
+           .addReg(AMDGPU::EXEC);
+  LIS->InsertMachineInstrInMaps(*MI);
+  MI = BuildMI(MBB, Before, DebugLoc(), TII->get(AMDGPU::S_MOV_B64), AMDGPU::EXEC)
+           .addImm(-1);
+  LIS->InsertMachineInstrInMaps(*MI);
----------------
cwabbott wrote:
> nhaehnle wrote:
> > This could be an S_OR_SAVEEXEC_B64.
> This is a little tricky, since S_OR_SAVEEXEC_B64 clobbers SCC while the S_MOV_B64 doesn't, so we need to be more careful about where we put it. But I didn't like how I was handling prepareInsertion() in the face of WWM anyways,  so I've refactored it to make using S_OR_SAVEEXEC_B64 possible.
I think this pass should probably not be producing the save exec instructions directly. We re-form these later and this may be a problem with -O0 


================
Comment at: lib/Target/AMDGPU/SIWholeQuadMode.cpp:633
+                              unsigned SavedOrig)
+{
+  MachineInstr *MI;
----------------
Formatting


https://reviews.llvm.org/D35524





More information about the llvm-commits mailing list