[PATCH] Enable ISL's small integer optimization

Michael Kruse llvm at meinersbur.de
Wed Jun 17 10:20:32 PDT 2015


Hi grosser,

This option can give a significant speedup depending on usage.
It is using C99 extern inline semantics, therefore we need to enable the compile option for C99.

http://reviews.llvm.org/D10506

Files:
  Makefile.config.in
  lib/CMakeLists.txt
  lib/External/isl/isl_config.h
  lib/Makefile

Index: Makefile.config.in
===================================================================
--- Makefile.config.in
+++ Makefile.config.in
@@ -39,8 +39,13 @@
 #
 # We also disable all warnings, as these should be fixed upstream. There is
 # no value in reporting them here.
+#
+# ISL with activated small integer optimization use C99 extern inline
+# semantics. In order to work, we need to enable C99 mode (instead the default
+# -std=gnu89)
 POLLY_CFLAGS := -fvisibility=hidden
 POLLY_CFLAGS += -w
+POLLY_CFLAGS += -std=c99
 
 CUDALIB_FOUND := @cuda_found@
 
Index: lib/CMakeLists.txt
===================================================================
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -48,6 +48,7 @@
     External/isl/isl_ilp.c
     External/isl/isl_imath.c
     External/isl/isl_input.c
+    External/isl/isl_int_sioimath.c
     External/isl/isl_local_space.c
     External/isl/isl_lp.c
     External/isl/isl_map.c
@@ -84,7 +85,7 @@
     External/isl/isl_transitive_closure.c
     External/isl/isl_union_map.c
     External/isl/isl_val.c
-    External/isl/isl_val_imath.c
+    External/isl/isl_val_sioimath.c
     External/isl/isl_vec.c
     External/isl/isl_version.c
     External/isl/isl_vertices.c
@@ -128,6 +129,16 @@
   ${ISL_FILES}
   )
 
+# Enable C99 for ISL
+if (CMAKE_VERSION VERSION_GREATER "3.1")
+  set_target_properties(Polly PROPERTIES
+    C_STANDARD 99
+    C_STANDARD_REQUIRED ON
+  )
+elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+  set_source_files_properties(${ISL_FILES} COMPILE_FLAGS "-std=c99")
+endif ()
+
 if (BUILD_SHARED_LIBS)
   target_link_libraries(Polly
     LLVMSupport
Index: lib/External/isl/isl_config.h
===================================================================
--- lib/External/isl/isl_config.h
+++ lib/External/isl/isl_config.h
@@ -150,7 +150,7 @@
 #define USE_IMATH_FOR_MP /**/
 
 /* Use small integer optimization */
-/* #undef USE_SMALL_INT_OPT */
+#define USE_SMALL_INT_OPT /**/
 
 /* Version number of package */
 #define VERSION "0.15"
Index: lib/Makefile
===================================================================
--- lib/Makefile
+++ lib/Makefile
@@ -61,6 +61,7 @@
            External/isl/isl_ilp.c \
            External/isl/isl_imath.c \
            External/isl/isl_input.c \
+           External/isl/isl_int_sioimath.c \
            External/isl/isl_local_space.c \
            External/isl/isl_lp.c \
            External/isl/isl_map.c \
@@ -97,7 +98,7 @@
            External/isl/isl_transitive_closure.c \
            External/isl/isl_union_map.c \
            External/isl/isl_val.c \
-           External/isl/isl_val_imath.c \
+           External/isl/isl_val_sioimath.c \
            External/isl/isl_vec.c \
            External/isl/isl_version.c \
            External/isl/isl_vertices.c \

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10506.27842.patch
Type: text/x-patch
Size: 2817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150617/c2d7d7b8/attachment.bin>


More information about the llvm-commits mailing list