[PATCH] D31188: [AntiDepBreaker] Use liveins as well in StartBlock

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 16 22:52:30 PDT 2017


timshen added a comment.

In https://reviews.llvm.org/D31188#725545, @MatzeB wrote:

> Just found the time to look at this a bit:
>
> The thing that is wrong here is the live-in list of bb.2. bb.2 is a return block without any restore instructions in it so it must have the %x29 as a live-in. So it seems the actual problem lies before the DepBreakers here.


Good catch!

After some investigation, I found that line:

  https://github.com/llvm-mirror/llvm/blob/8c6e6605aa4b10ac5c3e3afc4e87361c2ac1ff9d/lib/CodeGen/BranchFolding.cpp#L391

computeLiveIns() doesn't add r29 and r30 into NewMBB's liveins. I believe that computeLiveIns is doing what it's intended to do (add liveins based on instructions), so we should change the caller side to propagate CSR live-ins.

> I tried reproducing the earlier passes by copying the IR out of the mir test and re-running it on that, but I only always seem to get a version with a single return block without shrink wrapping...




https://reviews.llvm.org/D31188





More information about the llvm-commits mailing list