1 ; I'm not really sure if instcombine should do things like these. LevelRaise
2 ; already sufficiently takes care of these cases, but level raise is really
3 ; slow. Might it be better to make there be an instcombine prepass before
4 ; level raise that takes care of the obvious stuff?
6 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep cast
9 %A = cast int %X to uint
10 %c = setne uint %A, 12 ; Convert to setne int %X, 12
14 bool %test2(int %X, int %Y) {
15 %A = cast int %X to uint
16 %B = cast int %Y to uint
17 %c = setne uint %A, %B ; Convert to setne int %X, %Y
21 bool %test3(int %A, int %B) {
22 %cond216 = setlt int %A, %B ; <bool> [#uses=1]
23 %cst109 = cast bool %cond216 to uint ; <uint> [#uses=1]
24 %cond219 = setgt int %A, %B ; <bool> [#uses=1]
25 %cst111 = cast bool %cond219 to uint ; <uint> [#uses=1]
26 %reg113 = and uint %cst109, %cst111 ; <uint> [#uses=1]
27 %cst222 = cast uint %reg113 to bool ; <int> [#uses=1]
32 %B = cast int %A to uint
33 %C = shl uint %B, ubyte 2
34 %D = cast uint %C to int
38 short %test5(short %A) {
39 %B = cast short %A to uint
41 %D = cast uint %C to short
45 bool %test6(bool %A) {
46 %B = cast bool %A to int
51 bool %test7(sbyte* %A) {
52 %B = cast sbyte* %A to int*
53 %C = seteq int* %B, null