[PATCH] D94747: [AMDGPU] Add llvm.amdgcn.wqm.demote intrinsic

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 06:40:05 PST 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstructions.td:386
+// Demote: Turn a pixel shader thread into a helper lane.
+def SI_DEMOTE_I1 : SPseudoInstSI <(outs), (ins SCSrc_i1:$src, i1imm:$killvalue)> {
+}
----------------
Doesn't really matter but you can end the line with a ; instead of {}.


================
Comment at: llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp:818
       MachineInstr *NewTerm = nullptr;
-      assert(MBB.succ_size() == 1);
-      NewTerm = BuildMI(MBB, MI, DL, TII->get(AMDGPU::S_BRANCH))
-                    .addMBB(*MBB.succ_begin());
-      LIS->ReplaceMachineInstrInMaps(MI, *NewTerm);
+      if (!isDemote) {
+        assert(MBB.succ_size() == 1);
----------------
Please put the isDemote case first. Negated conditions with "else"s make my head hurt.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94747



More information about the llvm-commits mailing list