[PATCH] D45695: [CodeGen] Use RegUnits to track register aliases (NFC)

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 17 15:35:01 PDT 2018


MatzeB added a comment.

In https://reviews.llvm.org/D45695#1069868, @junbuml wrote:

> > Have you seen LiveRegUnits::accumulate() glancing over the code here (and earlier) it seems to me that TII::tracksRegDefsUses() was just invented to do the same thing: figuring out which registers are free/usable over a range of instructions...
>
> Yes, actually my current change in TII::tracksRegDefsUses() was inspired by LiveRegUnits::accumulate(). The only difference is that we need to track UsedRegs and DefReg separately in TII::tracksRegDefsUses(), while LiveRegUnits::accumulate() track both used/defed registers together. Based on your comment in https://reviews.llvm.org/D41463#inline-400109, would it make sense to introduce new static member function in LiveRegUnits like  :
>
>   static void LiveRegUnits::accumulateUseDef(MachineInstr &MI, LiveRegUnits &ModifiedRegUnits, LiveRegUnits &UsedRegUnits)  ? 


Yes that sounds better!


https://reviews.llvm.org/D45695





More information about the llvm-commits mailing list