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.