[PATCH] D119954: [CodeGen] Return better Changed status from PostRAHazardRecognizer

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 09:08:29 PST 2022


foad created this revision.
foad added reviewers: serge-sans-paille, piotr, myhsu.
Herald added a subscriber: hiraditya.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119954

Files:
  llvm/lib/CodeGen/PostRAHazardRecognizer.cpp


Index: llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
===================================================================
--- llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
+++ llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
@@ -76,6 +76,7 @@
     return false;
 
   // Loop over all of the basic blocks
+  bool Changed = false;
   for (auto &MBB : Fn) {
     // We do not call HazardRec->reset() here to make sure we are handling noop
     // hazards at the start of basic blocks.
@@ -85,6 +86,8 @@
       HazardRec->EmitNoops(NumPreNoops);
       TII->insertNoops(MBB, MachineBasicBlock::iterator(MI), NumPreNoops);
       NumNoops += NumPreNoops;
+      if (NumPreNoops != 0)
+        Changed = true;
 
       HazardRec->EmitInstruction(&MI);
       if (HazardRec->atIssueLimit()) {
@@ -92,5 +95,5 @@
       }
     }
   }
-  return true;
+  return Changed;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119954.409290.patch
Type: text/x-patch
Size: 853 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220216/ed858c4e/attachment.bin>


More information about the llvm-commits mailing list