[llvm] [AMDGPU] Restore the default rounding mode before calls and returns (PR #222247)

Arseniy Obolenskiy via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 08:53:11 PDT 2026


================
@@ -432,6 +500,20 @@ void SIModeRegister::processBlockPhase3(MachineBasicBlock &MBB,
     else
       insertSetreg(MBB, &MBB.instr_front(), TII, Delta);
   }
+
+  // Restore the default at the sites recorded in Phase 1.
+  if (!enforceCallBoundary())
+    return;
+  for (auto &[MI, ChangeAtSite] : BlockInfo[ThisBlock]->BoundarySites) {
+    Status AtSite = BlockInfo[ThisBlock]->Pred.merge(ChangeAtSite);
+    if (AtSite.isCompatible(DefaultStatus))
+      continue;
+    insertSetreg(MBB, MI, TII, AtSite.delta(DefaultStatus));
+    // Phase 1 modelled the site as mode preserving, so put the mode back.
+    if (!MI->isTerminator())
+      insertSetreg(MBB, std::next(MI->getIterator()), TII,
+                   DefaultStatus.delta(AtSite));
----------------
aobolensk wrote:

applied

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


More information about the llvm-commits mailing list