[llvm] r261748 - add test to show missing bitcasted vector xor fold
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 08:34:30 PST 2016
Author: spatel
Date: Wed Feb 24 10:34:29 2016
New Revision: 261748
URL: http://llvm.org/viewvc/llvm-project?rev=261748&view=rev
Log:
add test to show missing bitcasted vector xor fold
Modified:
llvm/trunk/test/Transforms/InstCombine/bitcast.ll
Modified: llvm/trunk/test/Transforms/InstCombine/bitcast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/bitcast.ll?rev=261748&r1=261747&r2=261748&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/bitcast.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/bitcast.ll Wed Feb 24 10:34:29 2016
@@ -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
More information about the llvm-commits
mailing list