[llvm] [AMDGPU] Preserve instruction flags in ILP scheduler (PR #211190)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 01:04:22 PDT 2026


================
@@ -367,6 +367,25 @@ void GCNIterativeScheduler::scheduleBest(Region &R) {
   R.BestSchedule.reset();
 }
 
+void GCNIterativeScheduler::restoreFlags(MachineInstr &MI) {
+  assert(!MI.isDebugInstr());
+
+  for (MachineOperand &Op : MI.all_defs())
+    Op.setIsUndef(false);
+
+  RegisterOperands RegOpers;
+  RegOpers.collect(MI, *TRI, MRI, /*ShouldTrackLaneMasks=*/true,
+                   /*IgnoreDead=*/false);
+  SlotIndex SlotIdx = LIS->getInstructionIndex(MI).getRegSlot();
+  RegOpers.adjustLaneLiveness(*LIS, MRI, SlotIdx, &MI);
+}
+
+void GCNIterativeScheduler::restoreRegionFlags(const Region &R) {
+  for (auto I = R.Begin; I != R.End; ++I)
----------------
ro-i wrote:

should probably use concrete type and also braces for the `for` due to nested child block

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


More information about the llvm-commits mailing list