[PATCH] D89619: [AMDGPU][NFC] Tidy SIOptimizeExecMaskingPreRA for extensibility

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 19:06:25 PDT 2020


critson marked 3 inline comments as done.
critson added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp:79
 
-static bool isFullExecCopy(const MachineInstr& MI, const GCNSubtarget& ST) {
-  unsigned Exec = ST.isWave32() ? AMDGPU::EXEC_LO : AMDGPU::EXEC;
-
-  if (MI.isFullCopy() && MI.getOperand(1).getReg() == Exec)
+static bool isFullExecCopy(const MachineInstr &MI, Register ExecReg) {
+  if (MI.isFullCopy() && MI.getOperand(1).getReg() == ExecReg)
----------------
foad wrote:
> Make this a member function so you don't have to pass ExecReg in? Or just inline it? It's so simple now, it hardly seems worth having it as a separate function.
Inlined.


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp:135
   if (I == MBB.terminators().end())
     return AMDGPU::NoRegister;
 
----------------
foad wrote:
> Could just return `Register()` here and elsewhere.
Done, I think I got all the remaining uses.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89619



More information about the llvm-commits mailing list