Page MenuHomePhabricator

[NewPM] Bail from PassManager::run() if there are no passes

Authored by aeubanks on Nov 7 2020, 4:49 PM.



With D89158, we have the possibility of creating empty pass managers due
to callbacks choosing to not add passes under -O0. e.g. Polly can add
EP callbacks but not add any passes. This affects some tests that use
-debug-pass-manager, like the one fixed in 8eb338a92a4e.

Diff Detail

Unit TestsFailed

370 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp
1,510 mswindows > LLVM.Other::new-pass-manager.ll
Script: -- : 'RUN: at line 8'; c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\opt.exe -disable-output -disable-verify -debug-pass-manager -passes=no-op-module C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\Other\new-pass-manager.ll 2>&1 | c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\Other\new-pass-manager.ll --check-prefix=CHECK-MODULE-PASS

Event Timeline

aeubanks created this revision.Nov 7 2020, 4:49 PM
Herald added a project: Restricted Project. · View Herald Transcript
aeubanks requested review of this revision.Nov 7 2020, 4:49 PM

Thank you for the quick fix, this resolves my reported issue. I can approve if need be but it would probably be better for there to be other eyes on this :)

MaskRay accepted this revision.Nov 7 2020, 7:21 PM


This revision is now accepted and ready to land.Nov 7 2020, 7:21 PM

Actually this causes the test to fail without polly since now there's no output since it's just an empty module pass manager. Will revert original change.

aeubanks abandoned this revision.Nov 8 2020, 12:44 AM