[SystemZ] Improve codegen for certain SADDO-immediate cases
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 3 Apr 2019 15:09:19 +0000 (15:09 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 3 Apr 2019 15:09:19 +0000 (15:09 +0000)
commit35dfd1b7dfe9ca5ac7b61a2bee94e227fefc066a
tree1c3787ebf0cb9057f9535adf65f8e312d3de9013
parentff3397247fc08f0b8af9905323a760db1a0902a9
[SystemZ] Improve codegen for certain SADDO-immediate cases

When performing an add-with-overflow with an immediate in the
range -2G ... -4G, code currently loads the immediate into a
register, which generally takes two instructions.

In this particular case, it is preferable to load the negated
immediate into a register instead, which always only requires
one instruction, and then perform a subtract.

llvm-svn: 357597
llvm/lib/Target/SystemZ/SystemZInstrInfo.td
llvm/lib/Target/SystemZ/SystemZOperands.td
llvm/test/CodeGen/SystemZ/int-sadd-07.ll