[LLVMdev] How to update LiveInterval information of newly inserted machine basic block

Haishan hndxvon at 163.com
Sat Jan 4 04:38:31 PST 2014

 At 2014-01-04 06:11:38,"Jakob Stoklund Olesen" <stoklund at 2pi.dk> wrote:

On Jan 3, 2014, at 1:52 PM, Andrew Trick <atrick at apple.com> wrote:

He really just wants to rerun LiveIntervals analysis, but LiveVariables is no longer available. Would it work just to clear all the intervals rerun LiveIntervals::computeVirtRegs after all the CFG transforms are complete?

Yes, I should think so.


Thank you very much for your talk.
I think I could append more information about updating LiveIntervals.
1. It works well if I just use from step1 to step3, without step4.
2. In step4, I firstly use UnreachableBlockElim pass to delete OldMBB.
Then, remove all intervals and recompute all the virtual registers' LiveIntervals.
3. I debug source code in LiveRangeCalc.cpp and copy partial code shown following.
/// LiveRangeCalc.cpp
#ifndef NDEBUG
    if (MBB->pred_empty()) {
      llvm_unreachable("Use not jointly dominated by defs.");
/// LiveRangeCalc.cpp
This MBB is the first block of MachineFunction. That's to say, This MBB doesn't have predecessor. It is reasonable?
From debug information, this unreachable error is generated from recompute a virtual register which isn't used or defined in this MBB. But this virtual register, in NewMBB,  is defined in a machine instruction which is copied from OldMBB.
So I am puzzled. 
Then, I do as Andy's suggestion, but it doesn't work, and it has same error.
Could you have any suggestion?
Thank you very much again.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140104/43e7a1a4/attachment.html>

More information about the llvm-dev mailing list