[PATCH] D102212: [AMDGPU] Add Optimize VGPR LiveRange Pass.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 03:34:37 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp:196
+        continue;
+      unsigned NumOps = MI.getNumOperands();
+      for (unsigned Op = 0; Op < NumOps; ++Op) {
----------------
critson wrote:
> I think you can just use MI.getNumOperands() directly in the loop condition and leave it up to the compiler whether to hoist it?
> In fact you do that in the next similar loop.
Or `for (auto &MO : MI.operands())`?


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp:334
+      for (MachineInstr &MI : *MBB) {
+        if (llvm::find(Uses, &MI) != Uses.end()) {
+          LV->HandleVirtRegUse(Reg, MBB, MI);
----------------
Use llvm::is_contained (here and a few other places).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102212



More information about the llvm-commits mailing list