[X86] Add a DAG combine for (i32 (sext (i8 (x86isd::setcc_carry)))) -> (i32 (x86isd...
authorCraig Topper <craig.topper@gmail.com>
Tue, 4 Feb 2020 07:35:16 +0000 (23:35 -0800)
committerCraig Topper <craig.topper@gmail.com>
Wed, 5 Feb 2020 06:40:36 +0000 (22:40 -0800)
commita3d489e87e8243bdb0eff947a38006b039dff8c0
treec3432d86957bb135e4a431c16033f25f5a24198e
parent491a4a7ac9e39fd4cc20a21e7da1961dfc7fc275
[X86] Add a DAG combine for (i32 (sext (i8 (x86isd::setcc_carry)))) -> (i32 (x86isd::setcc_carry)) and remove isel patterns.

Same for any_extend though we don't have coverage for that.

The test changes are because isel didn't check one use of the
setcc_carry. So in isel we would end up with two different
sized setcc_carry instructions. And since it clobbers
the flags we would need to recreate the flags for the second
instruction.

This code handles additional uses by truncating the new wide
setcc_carry back to the original size for those uses.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrCompiler.td
llvm/test/CodeGen/X86/copy-eflags.ll