[PATCH] D112731: [AMDGPU] Really preserve LiveVariables in SILowerControlFlow

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 1 06:12:30 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveVariables.cpp:732
+    MachineBasicBlock &UseBB = *MF->getBlockNumbered(UseBBNum);
+    // Only add kills in DefBB if all uses are in DefBB.
+    if (&UseBB == &DefBB && UseBlocks.count() != 1)
----------------
ruiling wrote:
> foad wrote:
> > ruiling wrote:
> > > why do we need this?
> > This is the cheapest way I could think of to test whether Reg is live-to-end of DefBB. Note that DefBB never appears in AliveBlocks.
> Does my comment above sound good to you? `UseBlocks.count() == 1` does not mean whether the Reg is live-to-end of DefBB.
You are right of course. I can't use LiveToEndBlocks directly because it is a worklist, and it is empty here, so I introduced a new boolean flag for this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112731/new/

https://reviews.llvm.org/D112731



More information about the llvm-commits mailing list