[llvm] 074d1e2 - [CodeGen] Return better Changed status from PostRAHazardRecognizer

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 18 01:46:54 PST 2022


Author: Jay Foad
Date: 2022-02-18T09:46:24Z
New Revision: 074d1e2536343b96ff1c6de57c4fecf1b7fbfa72

URL: https://github.com/llvm/llvm-project/commit/074d1e2536343b96ff1c6de57c4fecf1b7fbfa72
DIFF: https://github.com/llvm/llvm-project/commit/074d1e2536343b96ff1c6de57c4fecf1b7fbfa72.diff

LOG: [CodeGen] Return better Changed status from PostRAHazardRecognizer

Differential Revision: https://reviews.llvm.org/D119954

Added: 
    

Modified: 
    llvm/lib/CodeGen/PostRAHazardRecognizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp b/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
index 82ed386db8272..00c91b8a59f86 100644
--- a/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
+++ b/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
@@ -76,6 +76,7 @@ bool PostRAHazardRecognizer::runOnMachineFunction(MachineFunction &Fn) {
     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 @@ bool PostRAHazardRecognizer::runOnMachineFunction(MachineFunction &Fn) {
       HazardRec->EmitNoops(NumPreNoops);
       TII->insertNoops(MBB, MachineBasicBlock::iterator(MI), NumPreNoops);
       NumNoops += NumPreNoops;
+      if (NumPreNoops)
+        Changed = true;
 
       HazardRec->EmitInstruction(&MI);
       if (HazardRec->atIssueLimit()) {
@@ -92,5 +95,5 @@ bool PostRAHazardRecognizer::runOnMachineFunction(MachineFunction &Fn) {
       }
     }
   }
-  return true;
+  return Changed;
 }


        


More information about the llvm-commits mailing list