[SystemZ] Make more use of LTGFR
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Fri, 13 Dec 2013 15:07:39 +0000 (15:07 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Fri, 13 Dec 2013 15:07:39 +0000 (15:07 +0000)
commit204537e25ebd13e5386c3ed6f62a160c7aa8390c
tree8404fd8630a1926b0d1d12ab444080fa4f2c77d7
parentfd2b2bd6b39dadf9051c0ca4c6cec8f562f8e0e4
[SystemZ] Make more use of LTGFR

InstCombine turns (sext (trunc)) into (ashr (shl)), then converts any
comparison of the ashr against zero into a comparison of the shl against zero.
This makes sense in itself, but we want to undo it for z, since the sign-
extension instruction has a CC-setting form.

I've included tests for both the original and InstCombined variants,
but the former already worked.  The patch fixes the latter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197234 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/SystemZ/SystemZISelLowering.cpp
test/CodeGen/SystemZ/int-cmp-44.ll