[SystemZ] Tweak integer comparison code
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Fri, 6 Sep 2013 11:51:39 +0000 (11:51 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Fri, 6 Sep 2013 11:51:39 +0000 (11:51 +0000)
commitaff1c6427ce22125adfa29de4145030aa3214a2e
treefa79c736f4b56993d88ddb763d8efb044850d255
parente3273b327555df6489640d2195b52b6317c88844
[SystemZ] Tweak integer comparison code

The architecture has many comparison instructions, including some that
extend one of the operands.  The signed comparison instructions use sign
extensions and the unsigned comparison instructions use zero extensions.
In cases where we had a free choice between signed or unsigned comparisons,
we were trying to decide at lowering time which would best fit the available
instructions, taking things like extension type into account.  The code
to do that was getting increasingly hairy and was also making some bad
decisions.  E.g. when comparing the result of two LLCs, it is better to use
CR rather than CLR, since CR can be fused with a branch while CLR can't.

This patch removes the lowering code and instead adds an operand to
integer comparisons to say whether signed comparison is required,
whether unsigned comparison is required, or whether either is OK.
We can then leave the choice of instruction up to the normal isel code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190138 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h
lib/Target/SystemZ/SystemZInstrFP.td
lib/Target/SystemZ/SystemZInstrInfo.td
lib/Target/SystemZ/SystemZOperators.td
lib/Target/SystemZ/SystemZPatterns.td
test/CodeGen/SystemZ/branch-06.ll