OSDN Git Service

[LSR] Combine unfolded offset into invariant register
authorGil Rapaport <gil.rapaport@intel.com>
Wed, 24 Oct 2018 07:08:38 +0000 (07:08 +0000)
committerGil Rapaport <gil.rapaport@intel.com>
Wed, 24 Oct 2018 07:08:38 +0000 (07:08 +0000)
commitedb9243e2d3cbb1326499004fa0e7f28dc3e32c9
treef77581908fe1c3d18536f0e1351daf170a8aaf52
parentbb45f1e99f86e1a52844fc8c98e81cf70ca81622
[LSR] Combine unfolded offset into invariant register

LSR reassociates constants as unfolded offsets when the constants fit as
immediate add operands, which currently prevents such constants from being
combined later with loop invariant registers.
This patch modifies GenerateCombinations() to generate a second formula which
includes the unfolded offset in the combined loop-invariant register.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345114 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
test/Transforms/LoopStrengthReduce/AArch64/small-constant.ll