[PATCH] D132181: [X86][AArch64][NFC] Simplify querying used argument registers

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 10:50:25 PDT 2022


void added inline comments.


================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1211
+  BitVector LiveIns(TRI.getNumRegs());
+  for (const auto &LI : MF.front().liveins())
+    LiveIns.set(LI.PhysReg);
----------------
nickdesaulniers wrote:
> RegisterMaskPair
What?


================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1230-1234
+      if (OnlyUsed) {
+        if (!LiveIns[Reg])
+          continue;
+      } else if (!TRI.isArgumentRegister(MF, Reg)) {
+        continue;
----------------
nickdesaulniers wrote:
> This could probably be 2 statements rather than 5.
> ```
> if ((OnlyUsed && !LiveIns[Reg]) || !TRI.isArgumentRegister(MF, Reg))
>   continue;
> ```
That doesn't result in the same logic. If `OnlyUsed` is `true` and `!LiveIns[Reg]` is false, then it will execute the `TRI.isArgumentRegister` call, which is what I want it to avoid in that situation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132181



More information about the llvm-commits mailing list