Gentoo Archives: gentoo-commits

From: "Mark Loeser (halcy0n)" <halcy0n@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.4.3/gentoo: 92_all_gcc-4.4-cloog-dl.patch 93_all_gcc-4.4-cloog-dl.patch README.history
Date: Sun, 25 Apr 2010 21:30:41
Message-Id: 20100425213038.2859A2C04C@corvid.gentoo.org
1 halcy0n 10/04/25 21:30:37
2
3 Modified: README.history
4 Added: 93_all_gcc-4.4-cloog-dl.patch
5 Removed: 92_all_gcc-4.4-cloog-dl.patch
6 Log:
7 Wrong version of the patch. I didn't notice the renamed libraries that debian
8 uses
9
10 Revision Changes Path
11 1.3 src/patchsets/gcc/4.4.3/gentoo/README.history
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?rev=1.3&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?rev=1.3&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history?r1=1.2&r2=1.3
16
17 Index: README.history
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.4.3/gentoo/README.history,v
20 retrieving revision 1.2
21 retrieving revision 1.3
22 diff -u -r1.2 -r1.3
23 --- README.history 25 Apr 2010 18:42:56 -0000 1.2
24 +++ README.history 25 Apr 2010 21:30:37 -0000 1.3
25 @@ -1,3 +1,7 @@
26 +1.2 25.04.2010
27 + - 92_all_gcc-4.4-cloog-dl.patch
28 + + 93_all_gcc-4.4-cloog-dl.patch
29 +
30 1.1 25.04.2010
31 + 92_all_gcc-4.4-cloog-dl.patch
32
33
34
35
36 1.1 src/patchsets/gcc/4.4.3/gentoo/93_all_gcc-4.4-cloog-dl.patch
37
38 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/93_all_gcc-4.4-cloog-dl.patch?rev=1.1&view=markup
39 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.3/gentoo/93_all_gcc-4.4-cloog-dl.patch?rev=1.1&content-type=text/plain
40
41 Index: 93_all_gcc-4.4-cloog-dl.patch
42 ===================================================================
43 diff --git a/gcc/Makefile.in b/gcc/Makefile.in
44 index ffed3aa..9d11ee2 100644
45 --- a/gcc/Makefile.in
46 +++ b/gcc/Makefile.in
47 @@ -914,7 +914,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
48 # How to link with both our special library facilities
49 # and the system's installed libraries.
50 LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
51 -BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS)
52 +BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl)
53 # Any system libraries needed just for GNAT.
54 SYSLIBS = @GNAT_LIBEXC@
55
56 @@ -3061,6 +3061,9 @@ $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
57 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
58 $(out_file) $(OUTPUT_OPTION)
59
60 +graphite.o : \
61 + ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
62 +
63 # Build auxiliary files that support ecoff format.
64 mips-tfile: mips-tfile.o version.o $(LIBDEPS)
65 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
66 diff --git a/gcc/graphite.c b/gcc/graphite.c
67 index b732b40..798b141 100644
68 --- a/gcc/graphite.c
69 +++ b/gcc/graphite.c
70 @@ -59,6 +59,110 @@ along with GCC; see the file COPYING3. If not see
71 #include "cloog/cloog.h"
72 #include "graphite.h"
73
74 +#include <dlfcn.h>
75 +#define DYNSYMS \
76 + DYNSYM (cloog_block_alloc); \
77 + DYNSYM (cloog_block_list_free); \
78 + DYNSYM (cloog_block_list_malloc); \
79 + DYNSYM (cloog_clast_create); \
80 + DYNSYM (cloog_clast_free); \
81 + DYNSYM (cloog_domain_free); \
82 + DYNSYM (cloog_domain_matrix2domain); \
83 + DYNSYM (cloog_initialize); \
84 + DYNSYM (cloog_loop_malloc); \
85 + DYNSYM (cloog_matrix_alloc); \
86 + DYNSYM (cloog_matrix_copy); \
87 + DYNSYM (cloog_matrix_free); \
88 + DYNSYM (cloog_matrix_print); \
89 + DYNSYM (cloog_names_malloc); \
90 + DYNSYM (cloog_names_scalarize); \
91 + DYNSYM (cloog_options_free); \
92 + DYNSYM (cloog_options_malloc); \
93 + DYNSYM (cloog_program_dump_cloog); \
94 + DYNSYM (cloog_program_extract_scalars); \
95 + DYNSYM (cloog_program_free); \
96 + DYNSYM (cloog_program_generate); \
97 + DYNSYM (cloog_program_malloc); \
98 + DYNSYM (cloog_program_print); \
99 + DYNSYM (cloog_program_scatter); \
100 + DYNSYM (cloog_statement_alloc); \
101 + DYNSYM (ppl_finalize); \
102 + DYNSYM (pprint); \
103 + DYNSYM (stmt_block); \
104 + DYNSYM (stmt_for); \
105 + DYNSYM (stmt_guard); \
106 + DYNSYM (stmt_root); \
107 + DYNSYM (stmt_user);
108 +static struct
109 +{
110 + bool inited;
111 + void *h;
112 +#define DYNSYM(x) __typeof (x) *p_##x
113 + DYNSYMS
114 +#undef DYNSYM
115 +} cloog_pointers;
116 +
117 +#define cloog_block_alloc (*cloog_pointers.p_cloog_block_alloc)
118 +#define cloog_block_list_free (*cloog_pointers.p_cloog_block_list_free)
119 +#define cloog_block_list_malloc (*cloog_pointers.p_cloog_block_list_malloc)
120 +#define cloog_clast_create (*cloog_pointers.p_cloog_clast_create)
121 +#define cloog_clast_free (*cloog_pointers.p_cloog_clast_free)
122 +#define cloog_domain_free (*cloog_pointers.p_cloog_domain_free)
123 +#define cloog_domain_matrix2domain (*cloog_pointers.p_cloog_domain_matrix2domain)
124 +#define cloog_initialize (*cloog_pointers.p_cloog_initialize)
125 +#define cloog_loop_malloc (*cloog_pointers.p_cloog_loop_malloc)
126 +#define cloog_matrix_alloc (*cloog_pointers.p_cloog_matrix_alloc)
127 +#define cloog_matrix_copy (*cloog_pointers.p_cloog_matrix_copy)
128 +#define cloog_matrix_free (*cloog_pointers.p_cloog_matrix_free)
129 +#define cloog_matrix_print (*cloog_pointers.p_cloog_matrix_print)
130 +#define cloog_names_malloc (*cloog_pointers.p_cloog_names_malloc)
131 +#define cloog_names_scalarize (*cloog_pointers.p_cloog_names_scalarize)
132 +#define cloog_options_free (*cloog_pointers.p_cloog_options_free)
133 +#define cloog_options_malloc (*cloog_pointers.p_cloog_options_malloc)
134 +#define cloog_program_dump_cloog (*cloog_pointers.p_cloog_program_dump_cloog)
135 +#define cloog_program_extract_scalars (*cloog_pointers.p_cloog_program_extract_scalars)
136 +#define cloog_program_free (*cloog_pointers.p_cloog_program_free)
137 +#define cloog_program_generate (*cloog_pointers.p_cloog_program_generate)
138 +#define cloog_program_malloc (*cloog_pointers.p_cloog_program_malloc)
139 +#define cloog_program_print (*cloog_pointers.p_cloog_program_print)
140 +#define cloog_program_scatter (*cloog_pointers.p_cloog_program_scatter)
141 +#define cloog_statement_alloc (*cloog_pointers.p_cloog_statement_alloc)
142 +#define ppl_finalize (*cloog_pointers.p_ppl_finalize)
143 +#define pprint (*cloog_pointers.p_pprint)
144 +#define stmt_block (*cloog_pointers.p_stmt_block)
145 +#define stmt_for (*cloog_pointers.p_stmt_for)
146 +#define stmt_guard (*cloog_pointers.p_stmt_guard)
147 +#define stmt_root (*cloog_pointers.p_stmt_root)
148 +#define stmt_user (*cloog_pointers.p_stmt_user)
149 +
150 +#define cloog_finalize (*cloog_pointers.p_ppl_finalize)
151 +
152 +static bool
153 +init_cloog_pointers (void)
154 +{
155 + void *h;
156 +
157 + if (cloog_pointers.inited)
158 + return cloog_pointers.h != NULL;
159 + h = dlopen ("libcloog.so.0", RTLD_LAZY);
160 + cloog_pointers.h = h;
161 + if (h == NULL)
162 + return false;
163 +#define DYNSYM(x) \
164 + do \
165 + { \
166 + union { __typeof (cloog_pointers.p_##x) p; void *q; } u; \
167 + u.q = dlsym (h, #x); \
168 + if (u.q == NULL) \
169 + return false; \
170 + cloog_pointers.p_##x = u.p; \
171 + } \
172 + while (0)
173 + DYNSYMS
174 +#undef DYNSYM
175 + return true;
176 +}
177 +
178 static VEC (scop_p, heap) *current_scops;
179
180 /* Converts a GMP constant V to a tree and returns it. */
181 @@ -4075,10 +4179,10 @@ clast_get_body_of_loop (struct clast_stmt *stmt)
182 STMT. */
183
184 static tree
185 -gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for)
186 +gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora)
187 {
188 - struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_for);
189 - const char *cloog_iv = stmt_for->iterator;
190 + struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_fora);
191 + const char *cloog_iv = stmt_fora->iterator;
192 CloogStatement *cs = stmt->statement;
193 graphite_bb_p gbb = (graphite_bb_p) cloog_statement_usr (cs);
194
195 @@ -6109,6 +6213,12 @@ graphite_transform_loops (void)
196 if (number_of_loops () <= 1)
197 return;
198
199 + if (!init_cloog_pointers ())
200 + {
201 + sorry ("Graphite loop optimizations cannot be used");
202 + return;
203 + }
204 +
205 current_scops = VEC_alloc (scop_p, heap, 3);
206 recompute_all_dominators ();