Joe Matarazzo
2013-May-31 23:07 UTC
[LLVMdev] Register coalescer and reg_sequence (virtual super-regs)
The register coalescer treats virtual super register classes -- a sequential register range composed of multiple hardware registers -- as a register with sub registers. When making coalescing decisions it thinks that the virtual super reg interferes with sub reg instances, even though in reality they shouldn't conflict. That is, they are individual registers and would be better compared as such for register coalescing decisions (CoalescerPair::Partial = 0). For example, I have a super reg that has r20, r21, r22, and r23 physical registers. This super reg is the dest of a reg_sequence which generates 4 COPY MIs. The first COPY coalesces (merging into r20), but the vregs for r21-r23 (SUPER_RC:%vreg50:subreg1..subreg3) are never coalesced after that because doing so generates inteference on %vreg50, the "parent" super reg. Is there a way to work around this? It causes unnecessary copies. Thanks, Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130531/4906cd50/attachment.html>
Jakob Stoklund Olesen
2013-May-31 23:21 UTC
[LLVMdev] Register coalescer and reg_sequence (virtual super-regs)
On May 31, 2013, at 4:07 PM, Joe Matarazzo <joe.matarazzo at gmail.com> wrote:> The register coalescer treats virtual super register classes -- a sequential register range composed of multiple hardware registers -- as a register with sub registers. When making coalescing decisions it thinks that the virtual super reg interferes with sub reg instances, even though in reality they shouldn't conflict. That is, they are individual registers and would be better compared as such for register coalescing decisions (CoalescerPair::Partial = 0). > > For example, I have a super reg that has r20, r21, r22, and r23 physical registers. This super reg is the dest of a reg_sequence which generates 4 COPY MIs. The first COPY coalesces (merging into r20), but the vregs for r21-r23 (SUPER_RC:%vreg50:subreg1..subreg3) are never coalesced after that because doing so generates inteference on %vreg50, the "parent" super reg. > > Is there a way to work around this? It causes unnecessary copies.Is this happening on trunk, or are you using an old version of LLVM? /jakob
Joe Matarazzo
2013-May-31 23:59 UTC
[LLVMdev] Register coalescer and reg_sequence (virtual super-regs)
I think the last time I pulled from trunk was probably end of last year. Some time ago. Does your reply intimate it's fixed on trunk? That would be great. (I don't sync too often to avoid churn with my TD.) Joe On Fri, May 31, 2013 at 4:21 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:> > On May 31, 2013, at 4:07 PM, Joe Matarazzo <joe.matarazzo at gmail.com> > wrote: > > > The register coalescer treats virtual super register classes -- a > sequential register range composed of multiple hardware registers -- as a > register with sub registers. When making coalescing decisions it thinks > that the virtual super reg interferes with sub reg instances, even though > in reality they shouldn't conflict. That is, they are individual registers > and would be better compared as such for register coalescing decisions > (CoalescerPair::Partial = 0). > > > > For example, I have a super reg that has r20, r21, r22, and r23 physical > registers. This super reg is the dest of a reg_sequence which generates 4 > COPY MIs. The first COPY coalesces (merging into r20), but the vregs for > r21-r23 (SUPER_RC:%vreg50:subreg1..subreg3) are never coalesced after that > because doing so generates inteference on %vreg50, the "parent" super reg. > > > > Is there a way to work around this? It causes unnecessary copies. > > Is this happening on trunk, or are you using an old version of LLVM? > > /jakob > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130531/d4087018/attachment.html>
Maybe Matching Threads
- [LLVMdev] Register coalescer and reg_sequence (virtual super-regs)
- [LLVMdev] Register coalescer and reg_sequence (virtual super-regs)
- [LLVMdev] Register coalescer and reg_sequence (virtual super-regs)
- [LLVMdev] Register coalescer and reg_sequence (virtual super-regs)
- Error at Pre-regalloc Machine LICM: "getVRegDef assumes a single definition or no definition"' failed.