[Pipeliner] Check for affine expression in isLoopCarriedOrder
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Mon, 26 Mar 2018 16:58:40 +0000 (16:58 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Mon, 26 Mar 2018 16:58:40 +0000 (16:58 +0000)
commit8c07d0c42c78cb698a10036eaf88ea689962b298
tree7e2d94443d0d9cca57e10b7b4d939506125b3878
parent535ca36e5ec1f8394d7fb7eacce9befae2cc2b90
[Pipeliner] Check for affine expression in isLoopCarriedOrder

The pipeliner must add a loop carried dependence between two memory
operations if the base register is not an affine (linear) exression.
The current implementation doesn't check how the base register is
defined, which allows non-affine expressions, and then the pipeliner
does not add a loop carried dependence when one is needed.

This patch adds code to isLoopCarriedOrder that checks if the base
register of the memory operations is defined by a phi, and the loop
definition for the phi is a constant increment value.  This is a very
simple check for a linear expression.

Patch by Brendon Cahoon.

llvm-svn: 328550
llvm/lib/CodeGen/MachinePipeliner.cpp