[PATCH] D143335: [AMDGPU] Use instruction order in machine function to process workList of moveToVALU

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 03:42:33 PST 2023


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:6166
+      return false;
+    const MachineBasicBlock *BA = InstA->getParent();
+    const MachineBasicBlock *BB = InstB->getParent();
----------------
Do you really need to guarantee the order between different basic blocks? If so, surely you need some kind of topological ordering, not just based on BB number. (And what if there are cycles in the CFG?)


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:6185
+    // in the machine function.
+    llvm::stable_sort(Worklist, miCompare);
+    auto iter = Worklist.begin();
----------------
Sorting the whole worklist every time round this loop is not acceptable. You need to find a more efficient way of doing this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143335



More information about the llvm-commits mailing list