[llvm-dev] Understanding SlotIndexes
David A. Greene via llvm-dev
llvm-dev at lists.llvm.org
Fri Feb 24 08:41:21 PST 2017
Matthias Braun <mbraun at apple.com> writes:
> Conceptually and in the default case register uses and defs happen at
> the "r" slot. We do not include the "r" slot in the interval of the
> used value in order to avoid an overlap with intervals from defined
> register which start there as well. That means for the default case
> you have to query earlier in the "e" or "b" slot.
>
> Now early clobbers are a special case: A definition can be marked as
> early clobber to indicate it happens before any "normal" uses appear
> to force the register allocator to allocate different regs for the
> early clobber defs and uses. The special case mentioned here is that
> when your use is additional tied to an early clobber definition then
> that use conceptually moves forward to the "e" slot as well.
>
> In any way you seem to just wanting to query for a use:
> - If in doubt use LiveRange::Query()
> - If you still want to do it manually query the "b" slot as that will
> work regardless of tied-to-earlyclobber uses.
Thanks, this is very helpful. It would be nice to see something like
this put in the LiveInterval.h header.
-David
More information about the llvm-dev
mailing list