summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-06-10 04:50:12 +0000
committerCraig Topper <craig.topper@intel.com>2019-06-10 04:50:12 +0000
commit9000a72a4b723513499d97fb88a25a860132c323 (patch)
tree1bb2656bd99d6f33943db2fb633a50292b13da62 /llvm/lib/CodeGen
parentceb807bbbcb5e514b3a683141da506f36ed9e44c (diff)
downloadbcm5719-llvm-9000a72a4b723513499d97fb88a25a860132c323.tar.gz
bcm5719-llvm-9000a72a4b723513499d97fb88a25a860132c323.zip
[X86] When promoting i16 compare with immediate to i32, try to use sign_extend for eq/ne if the input is truncated from a type with enough sign its.
Summary: Our default behavior is to use sign_extend for signed comparisons and zero_extend for everything else. But for equality we have the freedom to use either extension. If we can prove the input has been truncated from something with enough sign bits, we can use sign_extend instead and let DAG combine optimize it out. A similar rule is used by type legalization in LegalizeIntegerTypes. This gets rid of the movzx in PR42189. The immediate will still take 4 bytes instead of the 2 bytes plus 0x66 prefix a cmp di, 32767 would get, but it avoids a length changing prefix. Reviewers: RKSimon, spatel, xbolva00 Reviewed By: xbolva00 Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63032 llvm-svn: 362920
Diffstat (limited to 'llvm/lib/CodeGen')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud