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.
Currently when building a bootstrap build with the following flags:
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -mllvm -lsr-preferred-addressing-mode=preindexed" -DCMAKE_CXX_FLAGS="${CMAKE_C_FLAGS} -mllvm -lsr-preferred-addressing-mode=preindexed"
, it fails at compiling TargetLoweringBase.cpp because it generates an illegal formula.
This patch fixes this and allows to build a bootstrap build with the aforementioned flags.
clang-format: please reformat the code