summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/xor2.ll
blob: 9b6a3fef6989a66b13b0d3cda9c08f8d8cfa88b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
; This test makes sure that these instructions are properly eliminated.
;

; RUN: llvm-as < %s | opt -instcombine -disable-output &&
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'xor '

; PR1253
define i1 @test0(i32 %A) {
	%B = xor i32 %A, -2147483648
	%C = icmp sgt i32 %B, -1
	ret i1 %C
}

define i1 @test1(i32 %A) {
	%B = xor i32 %A, 12345
	%C = icmp slt i32 %B, 0
	ret i1 %C
}

OpenPOWER on IntegriCloud