[PATCH] D136445: [TwoAddressInstruction] Fix stale LiveVariables info in processStatepoint

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 06:11:57 PDT 2022


foad created this revision.
foad added reviewers: skatkov, dantrushin.
Herald added subscribers: mstorsjo, pengfei, hiraditya.
Herald added a project: All.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

D129213 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136445

Files:
  llvm/lib/CodeGen/TwoAddressInstructionPass.cpp


Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
===================================================================
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1706,6 +1706,7 @@
       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);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136445.469569.patch
Type: text/x-patch
Size: 569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221021/b766db38/attachment.bin>


More information about the llvm-commits mailing list