This is an archive of the discontinued LLVM Phabricator instance.

Cleanup codegen includes
ClosedPublic

Authored by serge-sans-paille on Mar 7 2022, 3:34 PM.

Details

Summary

after: 1061034926
before: 1063332844

That's a rather large diff, let's see what CI has to tell about this one. At least my Local CI is happy :-)

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 3:34 PM
serge-sans-paille requested review of this revision.Mar 7 2022, 3:34 PM
foad added a comment.Mar 8 2022, 1:23 AM

That's a rather large diff

... and a rather small description. Can you summarise what kind of things you changed and why?

lenary added a comment.Mar 8 2022, 2:44 AM

This is part of the work described here: https://discourse.llvm.org/t/include-what-you-use-include-cleanup/5831

There have been quite a few of these patches over the few weeks, each addressing a different part of LLVM.

foad added a comment.Mar 8 2022, 2:46 AM

This is part of the work described here: https://discourse.llvm.org/t/include-what-you-use-include-cleanup/5831

There have been quite a few of these patches over the few weeks, each addressing a different part of LLVM.

Thanks. I still think the commit message should say a bit more than "cleanup".

RKSimon accepted this revision.Mar 8 2022, 2:49 AM

This is part of the work described here: https://discourse.llvm.org/t/include-what-you-use-include-cleanup/5831

There have been quite a few of these patches over the few weeks, each addressing a different part of LLVM.

Thanks. I still think the commit message should say a bit more than "cleanup".

Yes - please ensure your summary references the https://discourse.llvm.org/t/include-what-you-use-include-cleanup/5831 conversation URL

LGTM

This revision is now accepted and ready to land.Mar 8 2022, 2:49 AM
This revision was landed with ongoing or failed builds.Mar 10 2022, 1:01 AM
This revision was automatically updated to reflect the committed changes.
foad added a comment.Mar 10 2022, 3:21 AM

This seems to have broken almost all NVPTX CodeGen tests in my Release build. They fail with something like:

********************
FAIL: LLVM :: CodeGen/NVPTX/bug17709.ll (195 of 195)
******************** TEST 'LLVM :: CodeGen/NVPTX/bug17709.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /home/jayfoad2/llvm-release/bin/llc < /home/jayfoad2/git/llvm-project/llvm/test/CodeGen/NVPTX/bug17709.ll -march=nvptx -mcpu=sm_20 -verify-machineinstrs | /home/jayfoad2/llvm-release/bin/FileCheck /home/jayfoad2/git/llvm-project/llvm/test/CodeGen/NVPTX/bug17709.ll
--
Exit Code: 2

Command Output (stderr):
--
+ : 'RUN: at line 1'
+ /home/jayfoad2/llvm-release/bin/llc -march=nvptx -mcpu=sm_20 -verify-machineinstrs
+ /home/jayfoad2/llvm-release/bin/FileCheck /home/jayfoad2/git/llvm-project/llvm/test/CodeGen/NVPTX/bug17709.ll
Pass ID not registered
UNREACHABLE executed at /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/TargetPassConfig.cpp:783!
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/jayfoad2/llvm-release/bin/llc -march=nvptx -mcpu=sm_20 -verify-machineinstrs
 #0 0x000000000531b903 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/jayfoad2/llvm-release/bin/llc+0x531b903)
 #1 0x000000000531963e llvm::sys::RunSignalHandlers() (/home/jayfoad2/llvm-release/bin/llc+0x531963e)
 #2 0x000000000531bc8f SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f5443db43c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
 #4 0x00007f544384703b raise /build/glibc-sMfBJT/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f5443826859 abort /build/glibc-sMfBJT/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00000000052848c1 (/home/jayfoad2/llvm-release/bin/llc+0x52848c1)
 #7 0x00000000048b6fd9 (/home/jayfoad2/llvm-release/bin/llc+0x48b6fd9)
 #8 0x000000000397f1af (anonymous namespace)::NVPTXPassConfig::addInstSelector() NVPTXTargetMachine.cpp:0:0
 #9 0x00000000048b773e llvm::TargetPassConfig::addCoreISelPasses() (/home/jayfoad2/llvm-release/bin/llc+0x48b773e)
#10 0x00000000048b7a8b llvm::TargetPassConfig::addISelPasses() (/home/jayfoad2/llvm-release/bin/llc+0x48b7a8b)
#11 0x00000000045b371c llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*) (/home/jayfoad2/llvm-release/bin/llc+0x45b371c)
#12 0x0000000002ead528 main (/home/jayfoad2/llvm-release/bin/llc+0x2ead528)
#13 0x00007f54438280b3 __libc_start_main /build/glibc-sMfBJT/glibc-2.31/csu/../csu/libc-start.c:342:3
#14 0x0000000002eaab6e _start (/home/jayfoad2/llvm-release/bin/llc+0x2eaab6e)
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/jayfoad2/llvm-release/bin/FileCheck /home/jayfoad2/git/llvm-project/llvm/test/CodeGen/NVPTX/bug17709.ll

Also, what happened to this:

Yes - please ensure your summary references the https://discourse.llvm.org/t/include-what-you-use-include-cleanup/5831 conversation URL

?

PPC buildbot too, https://lab.llvm.org/buildbot/#/builders/57/builds/15884/steps/6/logs/FAIL__LLVM__nary-slsr_ll

one example:

******************** TEST 'LLVM :: Transforms/NaryReassociate/NVPTX/nary-slsr.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/opt < /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll -slsr -nary-reassociate -S | /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/FileCheck /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll
: 'RUN: at line 2';   /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/opt < /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll -slsr -S | /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/opt -passes='nary-reassociate' -S | /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/FileCheck /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll
: 'RUN: at line 3';   /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/llc < /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll -march=nvptx64 -mcpu=sm_20 | /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/FileCheck /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll --check-prefix=PTX
--
Exit Code: 2
Command Output (stderr):
--
Pass ID not registered
UNREACHABLE executed at /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/lib/CodeGen/TargetPassConfig.cpp:783!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/llc -march=nvptx64 -mcpu=sm_20
 #0 0x000070659c661074 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMSupport.so.15git+0x221074)
 #1 0x000070659c661494 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #2 0x000070659c65e018 llvm::sys::RunSignalHandlers() (/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMSupport.so.15git+0x21e018)
 #3 0x000070659c6618ec SignalHandler(int) Signals.cpp:0:0
 #4 0x00007065a42604d8  0x4d8 abort
 #5 0x00007065a42604d8 /usr/src/debug/glibc-2.17-c758a686/stdlib/abort.c:75:0 
 #6 0x00007065a42604d8 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) (+0x4d8)
 #7 0x000070659bfd2134 llvm::TargetPassConfig::addPass(void const*) (/lib64/libc.so.6+0x42134)
 #8 0x000070659c54a9f4 (anonymous namespace)::NVPTXPassConfig::addInstSelector() NVPTXTargetMachine.cpp:0:0
 #9 0x000070659e4631f0 llvm::TargetPassConfig::addCoreISelPasses() (/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMCodeGen.so.15git+0x6731f0)
#10 0x00007065a1e79524 llvm::TargetPassConfig::addISelPasses() (/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMNVPTXCodeGen.so.15git+0x79524)
#11 0x000070659e463e54 llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*) (/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMCodeGen.so.15git+0x673e54)
#12 0x000070659e46437c main (/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMCodeGen.so.15git+0x67437c)
#13 0x000070659e084120 generic_start_main.isra.0 /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:266:0
#14 0x000000001000e49c __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../sysdeps/unix/sysv/linux/powerpc/libc-start.c:81:0
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMSupport.so.15git(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x44)[0x70659c661074]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMSupport.so.15git(+0x221494)[0x70659c661494]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMSupport.so.15git(_ZN4llvm3sys17RunSignalHandlersEv+0xc8)[0x70659c65e018]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMSupport.so.15git(+0x2218ec)[0x70659c6618ec]
[0x7065a42604d8]
/lib64/libc.so.6(abort+0x2b4)[0x70659bfd2134]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMSupport.so.15git(_ZN4llvm25llvm_unreachable_internalEPKcS1_j+0x284)[0x70659c54a9f4]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMCodeGen.so.15git(_ZN4llvm16TargetPassConfig7addPassEPKv+0xc0)[0x70659e4631f0]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMNVPTXCodeGen.so.15git(+0x79524)[0x7065a1e79524]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMCodeGen.so.15git(_ZN4llvm16TargetPassConfig17addCoreISelPassesEv+0xa4)[0x70659e463e54]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMCodeGen.so.15git(_ZN4llvm16TargetPassConfig13addISelPassesEv+0x12c)[0x70659e46437c]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/../lib/libLLVMCodeGen.so.15git(_ZN4llvm17LLVMTargetMachine19addPassesToEmitFileERNS_6legacy15PassManagerBaseERNS_17raw_pwrite_streamEPS4_NS_15CodeGenFileTypeEbPNS_28MachineModuleInfoWrapperPassE+0x100)[0x70659e084120]
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/llc(main+0x1f2c)[0x1000e49c]
/lib64/libc.so.6(+0x25300)[0x70659bfb5300]
/lib64/libc.so.6(__libc_start_main+0xc4)[0x70659bfb54f4]
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/bin/FileCheck /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll --check-prefix=PTX
--
********************
thakis added a subscriber: thakis.Mar 10 2022, 5:00 AM

Also breaks a small number of clang tests: http://45.33.8.238/linux/70644/step_7.txt

Reverted in a278250b0f85949d4f98e641786e5eb2b540c6b0 for now.

(Please run tests before landing changes, please look at the presubmit bot, please revert quickly when someone reports a problem so not many people have to re-analyze breakage, etc)

Also breaks a small number of clang tests: http://45.33.8.238/linux/70644/step_7.txt

Reverted in a278250b0f85949d4f98e641786e5eb2b540c6b0 for now.

(Please run tests before landing changes, please look at the presubmit bot, please revert quickly when someone reports a problem so not many people have to re-analyze breakage, etc)

Thanks for reverting. I did run the build, but not the tests as they generally are not impacted by include change. On that step, some passes are not registered, which is odd. I'll investigate and update that diff.