[llvm] [AMDGPU] Track DS prefetch flush points on single-path loop. (PR #227274)

Vikash Gupta via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 22:55:46 PDT 2026


================
@@ -3261,6 +3261,37 @@ bool SIInsertWaitcnts::mayStoreIncrementingDSCNT(const MachineInstr &MI) const {
   return MI.mayStore() && SIInstrInfo::isDS(MI);
 }
 
+// Issue order when the body has no in-loop branch: header, then each block's
+// one in-loop successor. Returns false if that walk is not the whole loop.
+static bool
+appendSinglePathLoopBlocks(const MachineLoop &ML,
+                           SmallVectorImpl<MachineBasicBlock *> &Order) {
+  MachineBasicBlock *Header = ML.getHeader();
+  if (!Header)
+    return false;
+
+  MachineBasicBlock *BB = Header;
+  SmallPtrSet<MachineBasicBlock *, 8> Seen;
+  do {
----------------
vg0204 wrote:

Can you bit elaborate on this?


https://github.com/llvm/llvm-project/pull/227274


More information about the llvm-commits mailing list