[ARM] Negative constants mishandled in ARM CGP
authorSam Parker <sam.parker@arm.com>
Thu, 21 Feb 2019 09:33:18 +0000 (09:33 +0000)
committerSam Parker <sam.parker@arm.com>
Thu, 21 Feb 2019 09:33:18 +0000 (09:33 +0000)
commit6ed47bee2757213acd064bb466b4c84b490ed1a8
tree98d7b01a068e6bf417b10b589612bf78f995f35f
parent0e98ad264551e6bae1c919be68a6de794f2b6355
[ARM] Negative constants mishandled in ARM CGP

During type promotion, sometimes we convert negative an add with a
negative constant into a sub with a positive constant. The loop that
performs this transformation has two issues:
- it iterates over a set, causing non-determinism.
- it breaks, instead of continuing, when it finds the first
  non-negative operand.

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

llvm-svn: 354557
llvm/lib/Target/ARM/ARMCodeGenPrepare.cpp
llvm/test/CodeGen/ARM/CGP/arm-cgp-overflow.ll