[llvm] r175604 - Add support to the two-address pass for updating LiveIntervals in many of the

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Feb 20 09:03:44 PST 2013


On Feb 19, 2013, at 10:46 PM, Cameron Zwarich <zwarich at apple.com> wrote:

> Add support to the two-address pass for updating LiveIntervals in many of the
> common transformations. This includes updating repairIntervalsInRange() to
> handle more cases.

Awesome!

> +  // Udpate LiveIntervals.
> +  if (LIS) {
> +    if (MBBI != MBB->begin())
> +      --MBBI;
> +    LIS->repairIntervalsInRange(MBB, MBBI, EndMBBI, OrigRegs);
> +  }

This looks odd to me.

If it is correct to not decrement MBBI at begin(), shouldn't it be safe to always always skip the decrement?

Also, wouldn't it be easier if repairIntervalsInRange() did it's own reversing, instead of making all the callers do it?

What exactly is the meaning of the range passed to repairIntervalsInRange()? Could you describe that in the function declaration's comment, please?

It would be natural to me if you passed it just the range of new or changed instructions. If the algorithm needs to find anchor points, that should be a hidden implementation detail.

/jakob




More information about the llvm-commits mailing list