Fix two bugs in the pipeliner in renaming phis in the prolog and epilog
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Thu, 22 Dec 2016 18:49:55 +0000 (18:49 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Thu, 22 Dec 2016 18:49:55 +0000 (18:49 +0000)
commitdf24da221eecb5f106d7e9c4fa3a7bf8ab09c1ad
tree015752987c4fb2716b099651aca988a8737c3966
parent93fb15788ae42bd3deab70d7eba47fd784991b6f
Fix two bugs in the pipeliner in renaming phis in the prolog and epilog

When the pipeliner is renaming phi values, it may need to iterate through
the phi operands to check for other phis. However, the pipeliner should
stop once it reaches a phi that is outside the pipelined loop.

Also, when the generateExistingPhis code is unable to reuse an existing
phi, the default code that computes the PhiOp2 is only to be used when
the pipeliner is generating the kernel. Otherwise, the phi may be a value
computed earlier in the same epilog.

Patch by Brendon Cahoon.

llvm-svn: 290355
llvm/lib/CodeGen/MachinePipeliner.cpp
llvm/test/CodeGen/Hexagon/swp-epilog-phi10.ll [new file with mode: 0644]
llvm/test/CodeGen/Hexagon/swp-prolog-phi4.ll [new file with mode: 0644]