[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)
commit5012e7f6acaf42d8bdd92394b9d82066f2fab94b
tree28c6cef17347d5f947ed75ce6d482cabf4b6ce42
parent668ac94ba46d65cdedbe4194243c1d46c5f62ff1
[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

llvm-svn: 345114
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/test/Transforms/LoopStrengthReduce/AArch64/small-constant.ll