[PATCH] D138757: [zero-call-used-regs] Mark only non-debug instruction's register as used
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 23 15:02:15 PST 2023
MatzeB added inline comments.
================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1234-1236
+ // skip debug instructions
+ if (MI.isDebugInstr())
+ continue;
----------------
Can you just use `MO.readsReg()` instead of `MO.isUse()` below (that will also skip other cases like `undef` that aren't really reading the register).
================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1243
MCRegister Reg = MO.getReg();
if (AllocatableSet[Reg] && !MO.isImplicit() &&
(MO.isDef() || MO.isUse()))
----------------
Haven't followed this patch series. But skipping implicit operands seems odd at a first glance. They can read and write registers perfectly fine...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138757/new/
https://reviews.llvm.org/D138757
More information about the llvm-commits
mailing list