[llvm-branch-commits] [llvm] c4bec64 - [TwoAddressInstruction] Track MadeChange when eliminating REG_SEQUENCE (#173535)

Cullen Rhodes via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 13 02:21:18 PST 2026


Author: Teja Alaghari
Date: 2026-01-13T10:18:55Z
New Revision: c4bec64591ef907dc3b7109242fb0ce168f8e201

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

LOG: [TwoAddressInstruction] Track MadeChange when eliminating REG_SEQUENCE (#173535)

When `eliminateRegSequence()` is called, the pass modifies the
`MachineFunction` but `MadeChange` was not being set to true.
This causes the pass to incorrectly return `PreservedAnalyses::all()`
even though changes were made.

Added: 
    

Modified: 
    llvm/lib/CodeGen/TwoAddressInstructionPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 5d919b5a8000c..dbad06623754c 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1865,8 +1865,10 @@ bool TwoAddressInstructionImpl::run() {
 
       // Expand REG_SEQUENCE instructions. This will position mi at the first
       // expanded instruction.
-      if (mi->isRegSequence())
+      if (mi->isRegSequence()) {
         eliminateRegSequence(mi);
+        MadeChange = true;
+      }
 
       DistanceMap.insert(std::make_pair(&*mi, ++Dist));
 


        


More information about the llvm-branch-commits mailing list