OSDN Git Service

[X86] Don't promote i16 compares to i32 if the immediate will fit in 8 bits.
authorCraig Topper <craig.topper@intel.com>
Fri, 5 Oct 2018 18:13:36 +0000 (18:13 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 5 Oct 2018 18:13:36 +0000 (18:13 +0000)
commit6bab3515ebc5108e9f8a418940af58d3b553af4f
treeb5ab25f936c80314eff064e69b03f1eeaddd6655
parent41c8ada9ddc7e0f7f4e66da2c48289dc2a968495
[X86] Don't promote i16 compares to i32 if the immediate will fit in 8 bits.

The comments in this code say we were trying to avoid 16-bit immediates, but if the immediate fits in 8-bits this isn't an issue. This avoids creating a zero extend that probably won't go away.

The movmskb related changes are interesting. The movmskb instruction writes a 32-bit result, but fills the upper bits with 0. So the zero_extend we were previously emitting was free, but we turned a -1 immediate that would fit in 8-bits into a 32-bit immediate so it was still bad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343871 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/lack-of-signed-truncation-check.ll
test/CodeGen/X86/movmsk-cmp.ll
test/CodeGen/X86/sat-add.ll
test/CodeGen/X86/setcc.ll
test/CodeGen/X86/signed-truncation-check.ll
test/CodeGen/X86/x86-shrink-wrapping.ll