@@ -18,32 +18,17 @@ define i64 @func_abs_sym() nounwind {
1818
1919; CHECK-LABEL: func_abs_sym_in_range
2020define i64 @func_abs_sym_in_range () nounwind {
21- ; CHECK: movq $abs_sym_in_range, %rax
21+ ;; The absolute_symbol range fits in 32 bits but we still use movabs
22+ ;; since there's no benefit to using the sign extending instruction
23+ ;; with absolute symbols.
24+ ; CHECK: movabsq $abs_sym_in_range, %rax
2225 %1 = ptrtoint ptr @abs_sym_in_range to i64
2326 ret i64 %1
2427}
2528
26- ; CHECK-LABEL: func_abs_sym_min_out_of_range
27- define i64 @func_abs_sym_min_out_of_range () nounwind {
28- ; CHECK: movabsq $abs_sym_min_out_of_range, %rax
29- %1 = ptrtoint ptr @abs_sym_min_out_of_range to i64
30- ret i64 %1
31- }
32-
33- ; CHECK-LABEL: func_abs_sym_max_out_of_range
34- define i64 @func_abs_sym_max_out_of_range () nounwind {
35- ; CHECK: movabsq $abs_sym_max_out_of_range, %rax
36- %1 = ptrtoint ptr @abs_sym_max_out_of_range to i64
37- ret i64 %1
38- }
39-
4029@no_abs_sym = external hidden global [0 x i8 ]
4130@abs_sym = external hidden global [0 x i8 ], !absolute_symbol !0
4231@abs_sym_in_range = external hidden global [0 x i8 ], !absolute_symbol !1
43- @abs_sym_min_out_of_range = external hidden global [0 x i8 ], !absolute_symbol !2
44- @abs_sym_max_out_of_range = external hidden global [0 x i8 ], !absolute_symbol !3
4532
4633!0 = !{i64 -1 , i64 -1 } ;; Full range
47- !1 = !{i64 -2147483648 , i64 2147483648 } ;; Note the upper bound is exclusive.
48- !2 = !{i64 -2147483649 , i64 2147483648 } ;; Min is one below -2^31
49- !3 = !{i64 -2147483648 , i64 2147483649 } ;; Max is one above 2^31-1
34+ !1 = !{i64 -2147483648 , i64 2147483648 } ;; In range
0 commit comments