For simple cases like:
define i32 @select_0_or_neg1_zeroext(i1 zeroext %cond) {
%sel = select i1 %cond, i32 0, i32 -1 ret i32 %sel
}
..we stopped generating "testl %edi,%edi" and started generating
"testb %dil,%dil". testl encoding is 1-byte smaller than testb,
so it is preferable.
This happens since https://reviews.llvm.org/D32273 where condition
for example's select started to look like:
t7: i8 = AssertZext t5, ValueType:ch:i1
t5: i8 = truncate t4 t4: i32 = AssertZext t2, ValueType:ch:i8 t2: i32,ch = CopyFromReg t0, Register:i32 %vreg0
The patch fixes that by directly checking that pattern in
X86TargetLowering::LowerSELECT. The example is taken directly
from test/CodeGen/X86/select_const.ll, so the tests are already
in place.