[llvm] r175382 - Add support for updating the LiveIntervals of registers used by 'exotic'

Cameron Zwarich zwarich at apple.com
Sat Feb 16 19:12:21 PST 2013


On Feb 16, 2013, at 6:40 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:

> Yes, but even then I usually just use:
> 
> for (iterator I = End; I != Begin;) {
>  --I;
>  use(I);
> }
> 
> It's less confusing IMHO.

Unfortunately that still processes the case where I == Begin, so it's not quite what I want. You can do it with a do/while loop.

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;

Is that really better than the reverse iterator alternative?

> Note that dereferencing a MachineBasicBlock::reverse_iterator causes it to scan the whole bundle it is pointing to:
> 
>  reference operator*() const {__t = current; return *--__t;}

Why do we even have canonical reverse_iterators then? Seems like a bad idea. Should we remove them altogether?

Cameron



More information about the llvm-commits mailing list