Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
polly/lib/Support/RegisterPasses.cpp | ||
---|---|---|
333–340 | The legacy pass manger is till present and people are still using it (which includes me). That is, the old functionality should not be removed, especially without giving any notification (such as report_fatal_error as with the NPM). In other places, common code was extracted into a separate function such as runSimplifyUsingNPM or wrapper passes provided. Could you do the same? |
polly/include/polly/ScopGraphPrinter.h | ||
---|---|---|
53 | I realized that this specialization doesn't take effect. I should use DOTGraphTraits<ScopDetection>. |
polly/include/polly/ScopGraphPrinter.h | ||
---|---|---|
53 | Are you going to make this change? |
polly/include/polly/ScopGraphPrinter.h | ||
---|---|---|
53 | Yes. I'm doing it right now (after the Labor Day holiday 😄 ) |
When compiling under Windows with cmake -DPOLLY_ENABLE_GPGPU_CODEGEN=ON, I get a linker error:
Polly.lib(PPCGCodeGeneration.obj) : error LNK2019: unresolved external symbol "class llvm::Pass * __cdecl polly::createDOTOnlyPrinterPass(void)" (?createDOTOnlyPrinterPass@polly@@YAPEAVPass@llvm@@XZ) referenced in function "public: __cdecl `anonymous namespace'::PollyForcePassLinki ng::PollyForcePassLinking(void)" (??0PollyForcePassLinking@?A0x3c23cca7@@QEAA@XZ) [C:\Users\meinersbur\build\llvm-project\debug_vs17\tools\opt\opt.vcxproj] Polly.lib(PPCGCodeGeneration.obj) : error LNK2019: unresolved external symbol "class llvm::Pass * __cdecl polly::createDOTOnlyViewerPass(void)" (?createDOTOnlyViewerPass@polly@@YAPEAVPass@llvm@@XZ) referenced in function "public: __cdecl `anonymous namespace'::PollyForcePassLinking ::PollyForcePassLinking(void)" (??0PollyForcePassLinking@?A0x3c23cca7@@QEAA@XZ) [C:\Users\meinersbur\build\llvm-project\debug_vs17\tools\opt\opt.vcxproj] Polly.lib(PPCGCodeGeneration.obj) : error LNK2019: unresolved external symbol "class llvm::Pass * __cdecl polly::createDOTPrinterPass(void)" (?createDOTPrinterPass@polly@@YAPEAVPass@llvm@@XZ) referenced in function "public: __cdecl `anonymous namespace'::PollyForcePassLinking::Poll yForcePassLinking(void)" (??0PollyForcePassLinking@?A0x3c23cca7@@QEAA@XZ) [C:\Users\meinersbur\build\llvm-project\debug_vs17\tools\opt\opt.vcxproj] Polly.lib(PPCGCodeGeneration.obj) : error LNK2019: unresolved external symbol "class llvm::Pass * __cdecl polly::createDOTViewerPass(void)" (?createDOTViewerPass@polly@@YAPEAVPass@llvm@@XZ) referenced in function "public: __cdecl `anonymous namespace'::PollyForcePassLinking::PollyF orcePassLinking(void)" (??0PollyForcePassLinking@?A0x3c23cca7@@QEAA@XZ) [C:\Users\meinersbur\build\llvm-project\debug_vs17\tools\opt\opt.vcxproj] C:\Users\meinersbur\build\llvm-project\debug_vs17\Debug\bin\opt.exe : fatal error LNK1120: 4 unresolved externals [C:\Users\meinersbur\build\llvm-project\debug_vs17\tools\opt\opt.vcxproj]
I could not yet find a config that also fails under Linux, but it looks like some library dependencies are wrong.
polly/lib/Analysis/ScopGraphPrinter.cpp | ||
---|---|---|
73–76 | I get a compiler error here: /home/meinersbur/src/llvm-project/polly/lib/Analysis/ScopGraphPrinter.cpp:73:6: error: redeclaration of ‘static void llvm::DOTGraphTraits<polly::ScopDetection>::printRegionCluster(const polly::ScopDetection&, const llvm::Region*, llvm::raw_ostream&, unsigned int)’ may not have default arguments [-fpermissive] 73 | void DOTGraphTraits<ScopDetection>::printRegionCluster(const ScopDetection &SD, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The compiler is correct here, default parameters belong to the declaration, not definition. The pre-merge check does not seem to have caught this, maybe using a different compiler version (I am using gcc 11.2) |
Is it a clean build? I guess there are some cache breaks the linking. The function createDOTOnlyViewerPass is removed and replaced by createDOTOnlyViewerWrapperPass in this commit. Check the PollyForcePassLinking, it only calls the createDOTOnlyViewerWrapperPass.
I'm not sure whether this problem shows potential "dependencies issues" (as it seems failed to invalidate the cache) in the build system.
llvm/include/llvm/Analysis/RegionPrinter.h | ||
---|---|---|
30 ↗ | (On Diff #426927) | Nothing unusual of a declaration in RegionPrinter.h to be implemented in RegionPrinter.cpp. |
polly/include/polly/ScopGraphPrinter.h | ||
34 | Looking at other specializations, all GraphTraits of an analysis are a pointer of the the analysis (GraphTraits<ScopDetection>). Why the change? I fear that GraphTraits users may accidentally try to copy the object. | |
63 | Consider using llvm::StringRef | |
65–66 | Use doxygen comments for API documentation. | |
polly/lib/Analysis/ScopGraphPrinter.cpp | ||
95 | Consider DOTGraphTraits<ScopDetection*> |
polly/include/polly/ScopGraphPrinter.h | ||
---|---|---|
34 |
Because we could get the reference to ScopDetection from FAM.getResult, and it's quite straightforward to pass the reference to everywhere.
When will it happen? The arguments of the functions are all passing through reference. But as I'm not familiar with GraphTraits and its other usage, I think it's fine not to touch it in this commit. I will use GraphTraits<ScopDetection *> instead. |
polly/include/polly/ScopGraphPrinter.h | ||
---|---|---|
29 | @YangKeao Can you remove the 'using namespace' from the header and move them internally to each source file? This might be the cause of the namespace resolution build failures on: https://github.com/compiler-explorer/compiler-workflows/runs/6452927622 |
polly/include/polly/ScopGraphPrinter.h | ||
---|---|---|
29 | I was just looking into it when I noticed you already changed it. Thanks you. |
Polly :: ScopDetect/dot-scops-npm.ll test has been flaking on our bots since this change landed with the following test error:
Script: -- : 'RUN: at line 1'; /opt/s/w/ir/x/w/staging/llvm_build/bin/opt -polly-process-unprofitable -polly-remarks-minimal -polly-use-llvm-names -polly-import-jscop-dir=/opt/s/w/ir/x/w/llvm-llvm-project/polly/test/ScopDetect -polly-codegen-verify "-passes=polly-scop-printer" -disable-output < /opt/s/w/ir/x/w/llvm-llvm-project/polly/test/ScopDetect/dot-scops-npm.ll : 'RUN: at line 2'; /opt/s/w/ir/x/w/staging/llvm_build/bin/FileCheck /opt/s/w/ir/x/w/llvm-llvm-project/polly/test/ScopDetect/dot-scops-npm.ll -input-file=scops.func.dot -- Exit Code: 2 Command Output (stderr): -- Writing 'scops.func.dot'... FileCheck error: 'scops.func.dot' is empty. FileCheck command line: /opt/s/w/ir/x/w/staging/llvm_build/bin/FileCheck /opt/s/w/ir/x/w/llvm-llvm-project/polly/test/ScopDetect/dot-scops-npm.ll -input-file=scops.func.dot --
Would it be possible to take a look?
@phosek Where can I find more information about the test execution? I want to know the platform, architecture, compiler...
I tried to execute the same command (with the latest llvm and polly) several times, but none of them produce this error.
@Meinersbur Do you have any idea about why it could fail or how to debug this problem 🤔 ?
I could only observe a single failure with my own buildbot was assuming it was something else.
https://lab.llvm.org/buildbot/#/builders/10/builds/15406
******************** TEST 'Polly :: ScopDetect/dot-scops-npm.ll' FAILED ******************** Script: -- : 'RUN: at line 1'; /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.obj/bin/opt -polly-process-unprofitable -polly-remarks-minimal -polly-use-llvm-names -polly-import-jscop-dir=/home/worker/src/llvm-project/polly/test/ScopDetect -polly-codegen-verify "-passes=polly-scop-printer" -disable-output < /home/worker/src/llvm-project/polly/test/ScopDetect/dot-scops-npm.ll : 'RUN: at line 2'; /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.obj/bin/FileCheck /home/worker/src/llvm-project/polly/test/ScopDetect/dot-scops-npm.ll -input-file=scops.func.dot -- Exit Code: 2 Command Output (stderr): -- Writing 'scops.func.dot'... FileCheck error: 'scops.func.dot' is empty. FileCheck command line: /home/worker/buildbot-workers/polly-x86_64-gce1/rundir/llvm.obj/bin/FileCheck /home/worker/src/llvm-project/polly/test/ScopDetect/dot-scops-npm.ll -input-file=scops.func.dot -- ********************
The test is suspicious in that it does not use %t for its temporary file, it could potentially clash with another test using the same file concurrently. I suspect it is ScopDetect/dot-scops-npm.ll. Don't we have a means to specify which file to write?
polly/test/ScopDetect/dot-scops-npm.ll | ||
---|---|---|
32–60 ↗ | (On Diff #428152) | CHECK_NEXT is uneffective. It was fixed in rGad1d60c3befd606d6864b367f939238e50fb0f7e. |
I hope I fixed the race condition issue in rGcc871cf6b50f6a76f2083d192e2254a16832224b. Another possibility would have been to put both tests into the same file.
@YangKeao Can you remove the 'using namespace' from the header and move them internally to each source file? This might be the cause of the namespace resolution build failures on:
https://github.com/compiler-explorer/compiler-workflows/runs/6452927622