llvm.org GIT mirror llvm / 6e5031e
Regression test for bug in reg. allocation that was using %xcc instead of %icc even for 32-bit and smaller comparisons. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7110 91177308-0d34-0410-b5e6-96231b3b80d8 Vikram S. Adve 17 years ago
2 changed file(s) with 154 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ;; Date: May 28, 2003.
1 ;; From: test/Programs/MultiSource/Olden-perimeter/maketree.c
2 ;; Function: int CheckOutside(int x, int y)
3 ;;
4 ;; Note: The .ll code below for this regression test has identical
5 ;; behavior to the above function up to the error, but then prints
6 ;; true/false on the two branches.
7 ;;
8 ;; Error: llc generates a branch-on-xcc instead of branch-on-icc, which
9 ;; is wrong because the value being compared (int euclid = x*x + y*y)
10 ;; overflows, so that the 64-bit and 32-bit compares are not equal.
11 ;;
12 ;; LLC Output:
13 ;;
14 ;; !****** Outputing Function: CheckOutside_34 ******
15 ;; .align 4
16 ;; .global CheckOutside_34
17 ;; .type CheckOutside_34, 2
18 ;; CheckOutside_34:
19 ;; .L_CheckOutside_34_LL_0:
20 ;; save %o6, -192, %o6
21 ;; mulx %i1, %i1, %i1
22 ;; mulx %i0, %i0, %i0
23 ;; sethi %lm(4194304), %o1
24 ;; or %g0, 1, %o0
25 ;; add %i0, %i1, %i0
26 ;; sra %o1, 0, %o1
27 ;; subcc %i0, %o1, %g0
28 ;; bg %xcc, .L_CheckOutside_34_LL_3
29 ;; nop
30 ;; ba .L_CheckOutside_34_LL_1
31 ;; nop
32 ;; ...
33 ;;
34 ;;
35
36
37 target endian = little
38 target pointersize = 32
39 %.str_1 = internal constant [6 x sbyte] c"true\0A\00" ; <[6 x sbyte]*> [#uses=1]
40 %.str_2 = internal constant [7 x sbyte] c"false\0A\00" ; <[7 x sbyte]*> [#uses=1]
41
42 implementation ; Functions:
43
44 declare int %printf(sbyte*, ...)
45
46 internal void %__main() {
47 entry: ; No predecessors!
48 ret void
49 }
50
51 internal void %CheckOutside(int %x.1, int %y.1) {
52 entry: ; No predecessors!
53 %tmp.2 = mul int %x.1, %x.1 ; [#uses=1]
54 %tmp.5 = mul int %y.1, %y.1 ; [#uses=1]
55 %tmp.6 = add int %tmp.2, %tmp.5 ; [#uses=1]
56 %tmp.8 = setle int %tmp.6, 4194304 ; [#uses=1]
57 br bool %tmp.8, label %then, label %else
58
59 then: ; preds = %entry
60 %tmp.11 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([6 x sbyte]* %.str_1, long 0, long 0) ) ; [#uses=0]
61 br label %UnifiedExitNode
62
63 else: ; preds = %entry
64 %tmp.13 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([7 x sbyte]* %.str_2, long 0, long 0) ) ; [#uses=0]
65 br label %UnifiedExitNode
66
67 UnifiedExitNode: ; preds = %then, %else
68 ret void
69 }
70
71 int %main() {
72 entry: ; No predecessors!
73 call void %__main( )
74 call void %CheckOutside( int 2097152, int 2097152 )
75 ret int 0
76 }
0 ;; Date: May 28, 2003.
1 ;; From: test/Programs/MultiSource/Olden-perimeter/maketree.c
2 ;; Function: int CheckOutside(int x, int y)
3 ;;
4 ;; Note: The .ll code below for this regression test has identical
5 ;; behavior to the above function up to the error, but then prints
6 ;; true/false on the two branches.
7 ;;
8 ;; Error: llc generates a branch-on-xcc instead of branch-on-icc, which
9 ;; is wrong because the value being compared (int euclid = x*x + y*y)
10 ;; overflows, so that the 64-bit and 32-bit compares are not equal.
11 ;;
12 ;; LLC Output:
13 ;;
14 ;; !****** Outputing Function: CheckOutside_34 ******
15 ;; .align 4
16 ;; .global CheckOutside_34
17 ;; .type CheckOutside_34, 2
18 ;; CheckOutside_34:
19 ;; .L_CheckOutside_34_LL_0:
20 ;; save %o6, -192, %o6
21 ;; mulx %i1, %i1, %i1
22 ;; mulx %i0, %i0, %i0
23 ;; sethi %lm(4194304), %o1
24 ;; or %g0, 1, %o0
25 ;; add %i0, %i1, %i0
26 ;; sra %o1, 0, %o1
27 ;; subcc %i0, %o1, %g0
28 ;; bg %xcc, .L_CheckOutside_34_LL_3
29 ;; nop
30 ;; ba .L_CheckOutside_34_LL_1
31 ;; nop
32 ;; ...
33 ;;
34 ;;
35
36
37 target endian = little
38 target pointersize = 32
39 %.str_1 = internal constant [6 x sbyte] c"true\0A\00" ; <[6 x sbyte]*> [#uses=1]
40 %.str_2 = internal constant [7 x sbyte] c"false\0A\00" ; <[7 x sbyte]*> [#uses=1]
41
42 implementation ; Functions:
43
44 declare int %printf(sbyte*, ...)
45
46 internal void %__main() {
47 entry: ; No predecessors!
48 ret void
49 }
50
51 internal void %CheckOutside(int %x.1, int %y.1) {
52 entry: ; No predecessors!
53 %tmp.2 = mul int %x.1, %x.1 ; [#uses=1]
54 %tmp.5 = mul int %y.1, %y.1 ; [#uses=1]
55 %tmp.6 = add int %tmp.2, %tmp.5 ; [#uses=1]
56 %tmp.8 = setle int %tmp.6, 4194304 ; [#uses=1]
57 br bool %tmp.8, label %then, label %else
58
59 then: ; preds = %entry
60 %tmp.11 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([6 x sbyte]* %.str_1, long 0, long 0) ) ; [#uses=0]
61 br label %UnifiedExitNode
62
63 else: ; preds = %entry
64 %tmp.13 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([7 x sbyte]* %.str_2, long 0, long 0) ) ; [#uses=0]
65 br label %UnifiedExitNode
66
67 UnifiedExitNode: ; preds = %then, %else
68 ret void
69 }
70
71 int %main() {
72 entry: ; No predecessors!
73 call void %__main( )
74 call void %CheckOutside( int 2097152, int 2097152 )
75 ret int 0
76 }