From 3a74fb51afbfb291a7c230c72519af280612fc4f Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 24 Feb 2016 16:34:29 +0000 Subject: [PATCH] add test to show missing bitcasted vector xor fold llvm-svn: 261748 --- llvm/test/Transforms/InstCombine/bitcast.ll | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/llvm/test/Transforms/InstCombine/bitcast.ll b/llvm/test/Transforms/InstCombine/bitcast.ll index bccd19c..9fcb092 100644 --- a/llvm/test/Transforms/InstCombine/bitcast.ll +++ b/llvm/test/Transforms/InstCombine/bitcast.ll @@ -16,6 +16,21 @@ define i32 @test1(i64 %a) { ; CHECK: ret i32 0 } +; FIXME: The bitcasts of the operands to the xor can be eliminated. + +define <2 x i32> @xor_two_vector_bitcasts(<1 x i64> %a, <1 x i64> %b) { + %t1 = bitcast <1 x i64> %a to <2 x i32> + %t2 = bitcast <1 x i64> %b to <2 x i32> + %t3 = xor <2 x i32> %t1, %t2 + ret <2 x i32> %t3 + +; CHECK-LABEL: @xor_two_vector_bitcasts( +; CHECK-NEXT: %t1 = bitcast <1 x i64> %a to <2 x i32> +; CHECK-NEXT: %t2 = bitcast <1 x i64> %b to <2 x i32> +; CHECK-NEXT: %t3 = xor <2 x i32> %t1, %t2 +; CHECK-NEXT: ret <2 x i32> %t3 +} + ; Optimize bitcasts that are extracting low element of vector. This happens ; because of SRoA. ; rdar://7892780 -- 2.7.4