[PATCH] D138256: [AMDGPU] Fix PreRARematStage::sinkTriviallyRematInsts region boundary update after sinking.

Valery Pykhtin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 20:15:19 PST 2022


vpykhtin created this revision.
vpykhtin added a reviewer: vangthao.
Herald added subscribers: kosarev, foad, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl, arsenm.
Herald added a project: All.
vpykhtin requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

First boundary of a region wasn't updated when a sinked instruction was added first into the region.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138256

Files:
  llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp


Index: llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+++ llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
@@ -1187,7 +1187,7 @@
       // LiveRangeEdit::canRematerializeAt().
       TII->reMaterialize(*InsertPos->getParent(), InsertPos, Reg,
                          Def->getOperand(0).getSubReg(), *Def, *DAG.TRI);
-      MachineInstr *NewMI = &*(--InsertPos);
+      MachineInstr *NewMI = &*std::prev(InsertPos);
       LIS->InsertMachineInstrInMaps(*NewMI);
       LIS->removeInterval(Reg);
       LIS->createAndComputeVirtRegInterval(Reg);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138256.476323.patch
Type: text/x-patch
Size: 654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221118/f93220fc/attachment.bin>


More information about the llvm-commits mailing list