[llvm] r175382 - Add support for updating the LiveIntervals of registers used by 'exotic'
Cameron Zwarich
zwarich at apple.com
Sat Feb 16 19:55:45 PST 2013
On Feb 16, 2013, at 7:46 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> On Feb 16, 2013, at 7:12 PM, Cameron Zwarich <zwarich at apple.com> wrote:
>
>> Switching to forward iterators still requires all of the callers to do stuff like this:
>>
>> iterator Begin = getFirstTerminator();
>> if (Begin != begin())
>> --Begin;
>> iterator End = end();
>> if (End != begin())
>> --End;
>
> I am not sure why that would be necessary.
>
> The function's traversing the range of instructions backwards is an implementation detail. It shouldn't be exposed in the function prototype at all. To repair the terminators, you should simply call repairIntervalsInRange(getFirstTerminator(), end()), with a standard half-open range.
>
> If the function takes a standard half-open range of forward iterators [Begin; End), this loop will visit the instructions in that range backwards:
>
> for (iterator I = End; I != Begin;) {
> --I;
> use(I);
> }
>
> Am I misunderstanding what you're trying to do?
I thought that it would be easier to know the exact boundaries of the range of instructions that were modified, so that for every register originally used in the range you could easily get the LiveRange that was originally live-in. I was using the reg slot of A in (A, B], but I could just use the block slot of A in [A, B) instead.
Cameron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130216/01b5388a/attachment.html>
More information about the llvm-commits
mailing list