[LSR] Fix for pre-indexed generated constant offset

This patch changed the isLegalUse check to ensure that
LSRInstance::GenerateConstantOffsetsImpl generates an
offset that results in a legal addressing mode and
formula. The check is changed to look similar to the
assert check used for illegal formulas.

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

Change-Id: Iffb9e32d59df96b8f072c00f6c339108159a009a
GitOrigin-RevId: bf147c465352ed69f6fdaace26e9566bc442ade2
5 files changed