[llvm] 33f78d0 - [TwoAddressInstruction] Fix stale LiveVariables info in processStatepoint

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 07:00:32 PDT 2022


Author: Jay Foad
Date: 2022-10-21T14:57:03+01:00
New Revision: 33f78d0903eb1f7b2a7517218725caee1adfb4a3

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

LOG: [TwoAddressInstruction] Fix stale LiveVariables info in processStatepoint

D129213 improves verification of LiveVariables, and caused
CodeGen/X86/statepoint-cmp-sunk-past-statepoint.ll to fail with:
*** Bad machine code: LiveVariables: Block should not be in AliveBlocks ***
after Two-Address instruction pass.

Fix it by clearing AliveBlocks for a register which is no longer used.

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

Added: 
    

Modified: 
    llvm/lib/CodeGen/TwoAddressInstructionPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index a487ec3a52deb..78bf030132c35 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1706,6 +1706,7 @@ bool TwoAddressInstructionPass::processStatepoint(
       LiveVariables::VarInfo &SrcInfo = LV->getVarInfo(RegB);
       LiveVariables::VarInfo &DstInfo = LV->getVarInfo(RegA);
       SrcInfo.AliveBlocks |= DstInfo.AliveBlocks;
+      DstInfo.AliveBlocks.clear();
       for (auto *KillMI : DstInfo.Kills)
         LV->addVirtualRegisterKilled(RegB, *KillMI, false);
     }


        


More information about the llvm-commits mailing list