[PATCH] D22673: AMDGPU: Track physical registers in SIWholeQuadMode

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 23:33:14 PDT 2016


nhaehnle added inline comments.

================
Comment at: lib/Target/AMDGPU/SIWholeQuadMode.cpp:132
@@ -128,2 +131,3 @@
   void getAnalysisUsage(AnalysisUsage &AU) const override {
+    AU.addRequired<LiveIntervals>();
     AU.setPreservesCFG();
----------------
arsenm wrote:
> Should this also preserve it? Recomputing it if not used is quite expensive. I've also seen crashes when not preserving it (although I'm not 100% sure if that counts as a bug somewhere else)
As-is, this runs in SSA before Phi elimination, and other passes don't preserve LiveIntervals anyway.

I did it this way because I wanted to have a fix that uses the same logic in the 3.9 release branch as well as after my series of changes that moves SIWholeQuadMode to after machine scheduling.

If you're worried about the recomputation, we have two options, both of them a bit riskier:
(1) pull the entire WQM series into the 3.9 release branch
(2) replace the use of LiveIntervals in this patch by a manual backwards scan through MachineInstrs (or are there some helper functions to do this for us? I'm not aware, since the passes that need this info usually rely on LiveIntervals or similar).

Honestly, I'd prefer to accept the recomputation and have a conservative fix for the 3.9 release branch. On trunk, the recomputation will soon be gone anyway.


https://reviews.llvm.org/D22673





More information about the llvm-commits mailing list