[PATCH] D90596: [AMDGPU] Fix iterating in SIFixSGPRCopies

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 09:36:12 PST 2020


sebastian-ne added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp:695
+        MachineBasicBlock *NewBB = TII->moveToVALU(MI, MDT);
+        if (NewBB && NewBB != MBB) {
+          MBB = NewBB;
----------------
arsenm wrote:
> The NewBB &&s are redundant
Thank you for your reviews.

`moveToVALU` returns `nullptr` if nothing changed. Without this check, `MBB` would be set to `nullptr`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90596/new/

https://reviews.llvm.org/D90596



More information about the llvm-commits mailing list