Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/test/CodeGen/X86/undef-ops.ll
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = mul i32 %x, undef | %r = mul i32 %x, undef | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @mul_undef_rhs_vec(<4 x i32> %x) { | define <4 x i32> @mul_undef_rhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: mul_undef_rhs_vec: | ; CHECK-LABEL: mul_undef_rhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = mul <4 x i32> %x, undef | %r = mul <4 x i32> %x, undef | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @mul_undef_lhs(i32 %x) { | define i32 @mul_undef_lhs(i32 %x) { | ||||
; CHECK-LABEL: mul_undef_lhs: | ; CHECK-LABEL: mul_undef_lhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorl %eax, %eax | ; CHECK-NEXT: xorl %eax, %eax | ||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = mul i32 undef, %x | %r = mul i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @mul_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @mul_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: mul_undef_lhs_vec: | ; CHECK-LABEL: mul_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = mul <4 x i32> undef, %x | %r = mul <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @sdiv_undef_rhs(i32 %x) { | define i32 @sdiv_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: sdiv_undef_rhs: | ; CHECK-LABEL: sdiv_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
Show All 17 Lines | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = sdiv i32 undef, %x | %r = sdiv i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @sdiv_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @sdiv_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: sdiv_undef_lhs_vec: | ; CHECK-LABEL: sdiv_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = sdiv <4 x i32> undef, %x | %r = sdiv <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @udiv_undef_rhs(i32 %x) { | define i32 @udiv_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: udiv_undef_rhs: | ; CHECK-LABEL: udiv_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
Show All 17 Lines | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = udiv i32 undef, %x | %r = udiv i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @udiv_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @udiv_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: udiv_undef_lhs_vec: | ; CHECK-LABEL: udiv_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = udiv <4 x i32> undef, %x | %r = udiv <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @srem_undef_rhs(i32 %x) { | define i32 @srem_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: srem_undef_rhs: | ; CHECK-LABEL: srem_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
Show All 17 Lines | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = srem i32 undef, %x | %r = srem i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @srem_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @srem_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: srem_undef_lhs_vec: | ; CHECK-LABEL: srem_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = srem <4 x i32> undef, %x | %r = srem <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @urem_undef_rhs(i32 %x) { | define i32 @urem_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: urem_undef_rhs: | ; CHECK-LABEL: urem_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
Show All 17 Lines | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = urem i32 undef, %x | %r = urem i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @urem_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @urem_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: urem_undef_lhs_vec: | ; CHECK-LABEL: urem_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = urem <4 x i32> undef, %x | %r = urem <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @ashr_undef_rhs(i32 %x) { | define i32 @ashr_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: ashr_undef_rhs: | ; CHECK-LABEL: ashr_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: movl %edi, %eax | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = ashr i32 %x, undef | %r = ashr i32 %x, undef | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @ashr_undef_rhs_vec(<4 x i32> %x) { | define <4 x i32> @ashr_undef_rhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: ashr_undef_rhs_vec: | ; CHECK-LABEL: ashr_undef_rhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = ashr <4 x i32> %x, undef | %r = ashr <4 x i32> %x, undef | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @ashr_undef_lhs(i32 %x) { | define i32 @ashr_undef_lhs(i32 %x) { | ||||
; CHECK-LABEL: ashr_undef_lhs: | ; CHECK-LABEL: ashr_undef_lhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorl %eax, %eax | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = ashr i32 undef, %x | %r = ashr i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @ashr_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @ashr_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: ashr_undef_lhs_vec: | ; CHECK-LABEL: ashr_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = ashr <4 x i32> undef, %x | %r = ashr <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @lshr_undef_rhs(i32 %x) { | define i32 @lshr_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: lshr_undef_rhs: | ; CHECK-LABEL: lshr_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorl %eax, %eax | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = lshr i32 %x, undef | %r = lshr i32 %x, undef | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @lshr_undef_rhs_vec(<4 x i32> %x) { | define <4 x i32> @lshr_undef_rhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: lshr_undef_rhs_vec: | ; CHECK-LABEL: lshr_undef_rhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
Show All 9 Lines | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = lshr i32 undef, %x | %r = lshr i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @lshr_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @lshr_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: lshr_undef_lhs_vec: | ; CHECK-LABEL: lshr_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = lshr <4 x i32> undef, %x | %r = lshr <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @shl_undef_rhs(i32 %x) { | define i32 @shl_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: shl_undef_rhs: | ; CHECK-LABEL: shl_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorl %eax, %eax | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = shl i32 %x, undef | %r = shl i32 %x, undef | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @shl_undef_rhs_vec(<4 x i32> %x) { | define <4 x i32> @shl_undef_rhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: shl_undef_rhs_vec: | ; CHECK-LABEL: shl_undef_rhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
Show All 9 Lines | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = shl i32 undef, %x | %r = shl i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @shl_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @shl_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: shl_undef_lhs_vec: | ; CHECK-LABEL: shl_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = shl <4 x i32> undef, %x | %r = shl <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @and_undef_rhs(i32 %x) { | define i32 @and_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: and_undef_rhs: | ; CHECK-LABEL: and_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorl %eax, %eax | ; CHECK-NEXT: xorl %eax, %eax | ||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = and i32 %x, undef | %r = and i32 %x, undef | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @and_undef_rhs_vec(<4 x i32> %x) { | define <4 x i32> @and_undef_rhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: and_undef_rhs_vec: | ; CHECK-LABEL: and_undef_rhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = and <4 x i32> %x, undef | %r = and <4 x i32> %x, undef | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @and_undef_lhs(i32 %x) { | define i32 @and_undef_lhs(i32 %x) { | ||||
; CHECK-LABEL: and_undef_lhs: | ; CHECK-LABEL: and_undef_lhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorl %eax, %eax | ; CHECK-NEXT: xorl %eax, %eax | ||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = and i32 undef, %x | %r = and i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @and_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @and_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: and_undef_lhs_vec: | ; CHECK-LABEL: and_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: xorps %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = and <4 x i32> undef, %x | %r = and <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @or_undef_rhs(i32 %x) { | define i32 @or_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: or_undef_rhs: | ; CHECK-LABEL: or_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: movl $-1, %eax | ; CHECK-NEXT: movl $-1, %eax | ||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = or i32 %x, undef | %r = or i32 %x, undef | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @or_undef_rhs_vec(<4 x i32> %x) { | define <4 x i32> @or_undef_rhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: or_undef_rhs_vec: | ; CHECK-LABEL: or_undef_rhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: pcmpeqd %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = or <4 x i32> %x, undef | %r = or <4 x i32> %x, undef | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @or_undef_lhs(i32 %x) { | define i32 @or_undef_lhs(i32 %x) { | ||||
; CHECK-LABEL: or_undef_lhs: | ; CHECK-LABEL: or_undef_lhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: movl $-1, %eax | ; CHECK-NEXT: movl $-1, %eax | ||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = or i32 undef, %x | %r = or i32 undef, %x | ||||
ret i32 %r | ret i32 %r | ||||
} | } | ||||
define <4 x i32> @or_undef_lhs_vec(<4 x i32> %x) { | define <4 x i32> @or_undef_lhs_vec(<4 x i32> %x) { | ||||
; CHECK-LABEL: or_undef_lhs_vec: | ; CHECK-LABEL: or_undef_lhs_vec: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
; CHECK-NEXT: pcmpeqd %xmm0, %xmm0 | |||||
; CHECK-NEXT: retq | ; CHECK-NEXT: retq | ||||
%r = or <4 x i32> undef, %x | %r = or <4 x i32> undef, %x | ||||
ret <4 x i32> %r | ret <4 x i32> %r | ||||
} | } | ||||
define i32 @xor_undef_rhs(i32 %x) { | define i32 @xor_undef_rhs(i32 %x) { | ||||
; CHECK-LABEL: xor_undef_rhs: | ; CHECK-LABEL: xor_undef_rhs: | ||||
; CHECK: # %bb.0: | ; CHECK: # %bb.0: | ||||
Show All 29 Lines |