[PATCH] D119696: [AMDGPU] Improve v_cmpx usage on GFX10.3.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 25 03:46:23 PST 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp:344-345
+
+  // Try to find the last v_cmp instruction that defs the saveexec input
+  // operand.
+  VCmp = findInstrBackwards(
----------------
The code just finds the last v_cmp instruction. Then you hope that it defs the saveexec input operand? Do you ever actually check that?


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp:374
+
+  if (!Src0 || !Src1)
+    return nullptr;
----------------
I don't think you need this check (all vcmp instructions have src0 and src1 operands, don't they?).


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp:377
+
+  SmallVector<MCRegister, 3> NonDefRegs{Exec};
+  if (Src0->isReg())
----------------
You could have checked for Exec in the first call to findInstrBackwards, just to bail out a bit earlier.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119696



More information about the llvm-commits mailing list