[Bug 50021] New: 12.0.0: polly is not LTO ready

5 views
Skip to first unread message

bugzill...@llvm.org

unread,
Apr 18, 2021, 5:06:04 PMApr 18
to poll...@googlegroups.com
Bug ID 50021
Summary 12.0.0: polly is not LTO ready
Product Polly
Version unspecified
Hardware PC
OS Windows NT
Status NEW
Severity enhancement
Priority P
Component isl
Assignee poll...@googlegroups.com
Reporter kloczko...@gmail.com
CC llvm...@lists.llvm.org

Looks like polly 12.0.0 is not LTO ready.
Below was reproduced using gcc 11.0.1 from fedora rawhide.

color=
make[2]: Leaving directory
'/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu'
make  -f lib/External/CMakeFiles/PollyPPCG.dir/build.make
lib/External/CMakeFiles/PollyPPCG.dir/build
make[2]: Entering directory
'/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu'
[ 88%] Linking C shared library libPollyPPCG.so
cd
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu/lib/External
&& /usr/bin/cmake -E cmake_link_script CMakeFiles/PollyPPCG.dir/link.txt
--verbose=1
/usr/bin/gcc -fPIC -O2 -g -grecord-gcc-switches -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-fdata-sections -ffunction-sections -flto=auto -flto-partition=none
-fno-strict-aliasing -fPIC -Werror=date-time -Wall -Wextra
-Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers
-Wimplicit-fallthrough -Wno-comment -ffunction-sections -fdata-sections -fPIC
-DNDEBUG -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none
-fuse-linker-plugin -Wl,-z,defs -Wl,-z,nodelete -shared
-Wl,-soname,libPollyPPCG.so -o libPollyPPCG.so
CMakeFiles/PollyPPCG.dir/ppcg/cuda.c.o
CMakeFiles/PollyPPCG.dir/ppcg/cuda_common.c.o
CMakeFiles/PollyPPCG.dir/ppcg/external.c.o
CMakeFiles/PollyPPCG.dir/ppcg/gpu_array_tile.c.o
CMakeFiles/PollyPPCG.dir/ppcg/gpu.c.o
CMakeFiles/PollyPPCG.dir/ppcg/gpu_group.c.o
CMakeFiles/PollyPPCG.dir/ppcg/gpu_hybrid.c.o
CMakeFiles/PollyPPCG.dir/ppcg/gpu_print.c.o
CMakeFiles/PollyPPCG.dir/ppcg/gpu_tree.c.o
CMakeFiles/PollyPPCG.dir/ppcg/grouping.c.o
CMakeFiles/PollyPPCG.dir/ppcg/hybrid.c.o CMakeFiles/PollyPPCG.dir/ppcg/ppcg.c.o
CMakeFiles/PollyPPCG.dir/ppcg/ppcg_options.c.o
CMakeFiles/PollyPPCG.dir/ppcg/print.c.o
CMakeFiles/PollyPPCG.dir/ppcg/schedule.c.o
CMakeFiles/PollyPPCG.dir/ppcg/util.c.o 
-Wl,-rpath,/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu/lib/External:
libPollyISL.so
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/ppcg/print.c:54:14:
warning: type of ‘isl_id_alloc’ does not match original declaration
[-Wlto-type-mismatch]
   54 |         id = isl_id_alloc(ctx, note_name, NULL);
      |              ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:22:20:
note: return value type mismatch
   22 | __isl_give isl_id *isl_id_alloc(isl_ctx *ctx,
      |                    ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:22:20:
note: ‘isl_id_alloc’ was previously declared here
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:22:20:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/ppcg/print.c:164:29:
warning: type of ‘isl_id_set_free_user’ does not match original declaration
[-Wlto-type-mismatch]
  164 |                 macros_id = isl_id_set_free_user(macros_id,
&ppcg_macros_free);
      |                             ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:31:20:
note: return value type mismatch
   31 | __isl_give isl_id *isl_id_set_free_user(__isl_take isl_id *id,
      |                    ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:31:20:
note: ‘isl_id_set_free_user’ was previously declared here
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:31:20:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/ppcg/print.c:78:44:
warning: type of ‘isl_id_copy’ does not match original declaration
[-Wlto-type-mismatch]
   78 |         return isl_printer_set_note(p, id, isl_id_copy(id));
      |                                            ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:24:20:
note: return value type mismatch
   24 | __isl_give isl_id *isl_id_copy(isl_id *id);
      |                    ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:24:20:
note: ‘isl_id_copy’ was previously declared here
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:24:20:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/pet/include/pet.h:20:1:
error: function ‘pet_options_args’ redeclared as variable
   20 | ISL_ARG_DECL(pet_options, struct pet_options, pet_options_args)
      | ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/ppcg/external.c:107:6:
note: previously declared here
  107 | void pet_options_args() {
      |      ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/ppcg/print.c:191:18:
warning: type of ‘isl_id_get_user’ does not match original declaration
[-Wlto-type-mismatc ]
  191 |         macros = isl_id_get_user(id);
      |                  ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:27:7:
note: return value type mismatch
   27 | void *isl_id_get_user(__isl_keep isl_id *id);
      |       ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:27:7:
note: ‘isl_id_get_user’ was previously declared here
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:27:7:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/ppcg/print.c:56:9:
warning: type of ‘isl_id_free’ does not match original declaration
[-Wlto-type-mismatch]
   56 |         isl_id_free(id);
      |         ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:25:20:
note: return value type mismatch
   25 | __isl_null isl_id *isl_id_free(__isl_take isl_id *id);
      |                    ^
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:25:20:
note: ‘isl_id_free’ was previously declared here
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External/isl/include/isl/id.h:25:20:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: fatal error: /usr/bin/gcc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [lib/External/CMakeFiles/PollyPPCG.dir/build.make:332:
lib/External/libPollyPPCG.so] Error 1
make[2]: Target 'lib/External/CMakeFiles/PollyPPCG.dir/build' not remade
because of errors.
make[2]: Leaving directory
'/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:564:
lib/External/CMakeFiles/PollyPPCG.dir/all] Error 2
make  -f lib/External/CMakeFiles/polly-isl-test.dir/build.make
lib/External/CMakeFiles/polly-isl-test.dir/depend
make[2]: Entering directory
'/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu'
cd /home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu &&
/usr/bin/cmake -E cmake_depends "Unix Makefiles"
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/lib/External
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu/lib/External
/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu/lib/External/CMakeFiles/polly-isl-test.dir/DependInfo.cmake
--color=
make[2]: Leaving directory
'/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu'
make  -f lib/External/CMakeFiles/polly-isl-test.dir/build.make
lib/External/CMakeFiles/polly-isl-test.dir/build
make[2]: Entering directory
'/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu'
make[2]: Nothing to be done for
'lib/External/CMakeFiles/polly-isl-test.dir/build'.
make[2]: Leaving directory
'/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu'
[ 90%] Built target polly-isl-test
make[1]: Target 'all' not remade because of errors.
make[1]: Leaving directory
'/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu'
make: *** [Makefile:152: all] Error 2
make: Target 'default_target' not remade because of errors.


cmake settings:

[tkloczko@barrel x86_64-redhat-linux-gnu]$ cmake -L
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


CMake Error: The source directory
"/home/tkloczko/rpmbuild/BUILD/polly-12.0.0.src/x86_64-redhat-linux-gnu" does
not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
-- Cache values
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr
LLVM_DIR:PATH=/usr/lib64/cmake/llvm
LLVM_ENABLE_IDE:BOOL=OFF
LLVM_ENABLE_LTO:STRING=OFF
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS:BOOL=OFF
LLVM_EXTERNAL_LIT:STRING=/usr/bin/lit
LLVM_FILECHECK:FILEPATH=/usr/bin/FileCheck
LLVM_FORCE_ENABLE_STATS:BOOL=OFF
LLVM_NOT:FILEPATH=/usr/bin/not
LLVM_OPT:FILEPATH=/usr/bin/opt
LLVM_PARALLEL_COMPILE_JOBS:STRING=
LLVM_PARALLEL_LINK_JOBS:STRING=
LLVM_POLLY_LINK_INTO_TOOLS:BOOL=OFF
LLVM_SOURCE_PREFIX:STRING=
LLVM_SOURCE_ROOT:PATH=/home/tkloczko/rpmbuild/BUILD/llvm-12.0.0.src
LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO:BOOL=OFF
LLVM_USE_RELATIVE_PATHS_IN_FILES:BOOL=OFF
POLLY_BUNDLED_ISL:BOOL=ON
POLLY_ENABLE_GPGPU_CODEGEN:BOOL=OFF
SPHINX_EXECUTABLE:FILEPATH=/usr/bin/sphinx-build
SPHINX_OUTPUT_HTML:BOOL=ON
SPHINX_OUTPUT_MAN:BOOL=ON
SPHINX_WARNINGS_AS_ERRORS:BOOL=OFF


You are receiving this mail because:
  • You are the assignee for the bug.

bugzill...@llvm.org

unread,
Apr 21, 2021, 2:14:16 AMApr 21
to poll...@googlegroups.com
Michael Kruse changed bug 50021
What Removed Added
Status NEW RESOLVED
Resolution --- FIXED
Fixed By Commit(s)   90e5ce0b0d6b0e72fdc034cbb612f67d67de0fdd
Blocks   49317

Comment # 3 on bug 50021 from Michael Kruse
Fixed by 90e5ce0b0d6b0e72fdc034cbb612f67d67de0fdd (Avoid implicit function
definitions).

Commit 6048d1d19c55a107f67cd617d6ed386831b5adee also stops PollyPPCG from being
defined if POLLY_ENABLE_GPGPU_CODEGEN is OFF, so not even gmake would build it.

@Tom Stellard: Only include 90e5ce0b0d6b0e72fdc034cbb612f67d67de0fdd for 12.0.1


Referenced Bugs:

bugzill...@llvm.org

unread,
Apr 21, 2021, 3:39:03 AMApr 21
to poll...@googlegroups.com
Tomasz Kłoczko changed bug 50021
What Removed Added
Status RESOLVED REOPENED
Resolution FIXED ---

bugzill...@llvm.org

unread,
Apr 21, 2021, 4:05:10 PMApr 21
to poll...@googlegroups.com
Michael Kruse changed bug 50021
What Removed Added
Fixed By Commit(s) 90e5ce0b0d6b0e72fdc034cbb612f67d67de0fdd 90e5ce0b0d6b0e72fdc034cbb612f67d67de0fdd 89b59345ee29d2cc1afa1f60445916ae2e74be6d
Resolution --- FIXED
Status REOPENED RESOLVED

Comment # 5 on bug 50021 from Michael Kruse
Thanks for the report. I committed a fix in
89b59345ee29d2cc1afa1f60445916ae2e74be6d.

I also compiled Polly with -flto=auto myself to ensure that there no remaining
issues. 'opt' and 'clang' compile successfully, but there seem to be remaining
problems with LLVM itself, since check-llvm (and check-polly) does fail for
every unit test with the following (+ many warnings): 

/home/meinersbur/src/llvm-project/llvm/lib/Support/TimeProfiler.cpp:36:45:
error: only zero initializers are allowed in section
‘.tbss._ZL25TimeTraceProfilerInstance.lto_priv.9719’
 static LLVM_THREAD_LOCAL TimeTraceProfiler *TimeTraceProfilerInstance =
nullptr;

However, it's not a Polly issue.


@Tom Stellard: Please add 90e5ce0b0d6b0e72fdc034cbb612f67d67de0fdd and
89b59345ee29d2cc1afa1f60445916ae2e74be6d for 12.0.1

Reply all
Reply to author
Forward
0 new messages