aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2022-10-21 14:08:58 +0100
committerJay Foad <jay.foad@amd.com>2022-10-21 14:57:03 +0100
commit33f78d0903eb1f7b2a7517218725caee1adfb4a3 (patch)
treeb9f17b210d97994e251625da24c9a1cb68598413 /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
parent3bee2fb26222b71ba30234586dc0e6c197358091 (diff)
downloadllvm-33f78d0903eb1f7b2a7517218725caee1adfb4a3.zip
llvm-33f78d0903eb1f7b2a7517218725caee1adfb4a3.tar.gz
llvm-33f78d0903eb1f7b2a7517218725caee1adfb4a3.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index a487ec3..78bf030 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);
}