[Pipeliner] copyToPhi DAG Mutation to improve scheduling.
authorSumanth Gundapaneni <sgundapa@codeaurora.org>
Thu, 18 Oct 2018 15:51:16 +0000 (15:51 +0000)
committerSumanth Gundapaneni <sgundapa@codeaurora.org>
Thu, 18 Oct 2018 15:51:16 +0000 (15:51 +0000)
commit62ac69d45c20e0cebc1464a02bf719e1ff2259c5
treede3149d0897c1a30782457e7138a88238e39d824
parent3acfe400a2d9bbc00c8c5eb7ae0cc205209d4338
[Pipeliner] copyToPhi DAG Mutation to improve scheduling.

In a loop, create artificial dependences between the source of a
COPY/REG_SEQUENCE to the use in next iteration.

Eg:
SRC ----Data Dep--> COPY
COPY ---Anti Dep--> PHI (implies, to be used in next iteration)
PHI ----Data Dep--> USE

This patches creates
USE ----Artificial Dep---> SRC

This will effectively schedule the COPY late to eliminate additional copies.
Before this patch, the schedule can be
SRC, COPY, USE : The COPY is used in next iteration and it needs to be
preserved.

After this patch, the schedule can be
USE, SRC, COPY : The COPY is used in next iteration and the live interval is
reduced.

Differential Revision: https://reviews.llvm.org/D53303

llvm-svn: 344748
llvm/lib/CodeGen/MachinePipeliner.cpp
llvm/test/CodeGen/Hexagon/swp-copytophi-dag.ll [new file with mode: 0644]