diff --git a/llvm/test/CodeGen/X86/combine-add.ll b/llvm/test/CodeGen/X86/combine-add.ll index 5c3e17849b2a..510a1ac92e4f 100644 --- a/llvm/test/CodeGen/X86/combine-add.ll +++ b/llvm/test/CodeGen/X86/combine-add.ll @@ -376,6 +376,22 @@ define <4 x i32> @combine_vec_add_add_not(<4 x i32> %a, <4 x i32> %b) { ret <4 x i32> %r } +; FIXME: Fold to adc $32, %edi +define i32 @combine_add_adc_constant(i32 %x, i32 %y, i32 %z) { +; CHECK-LABEL: combine_add_adc_constant: +; CHECK: # %bb.0: +; CHECK-NEXT: # kill: def $edi killed $edi def $rdi +; CHECK-NEXT: btl $7, %edx +; CHECK-NEXT: adcl $0, %edi +; CHECK-NEXT: leal 32(%rdi), %eax +; CHECK-NEXT: retq + %and = lshr i32 %z, 7 + %bit = and i32 %and, 1 + %add = add i32 %x, 32 + %r = add i32 %add, %bit + ret i32 %r +} + declare {i32, i1} @llvm.sadd.with.overflow.i32(i32 %a, i32 %b) define i1 @sadd_add(i32 %a, i32 %b, i32* %p) {