[llvm] [CVP] Check whether the default case is reachable (PR #79993)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 06:01:00 PST 2024


alexfh wrote:

Well, actually it's not a 5x increase, it's an increase from ~7s to "I got bored to wait" minutes (thus, either a superlinear from code size or an infinite loop). I ran clang under `perf`, and it seems to spend a lot of time in:
```
        __libc_start_main                                                                                                                                                                                                                           ▒        main                                                                                                                                                                                                                                        ▒        clang_main(int, char**, llvm::ToolContext const&)                                                                                                                                                                                           ▒        clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__u::pair<int, clang::driver::Command const*> >&)                                                                                         ▒        clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__u::pair<int, clang::driver::Command const*> >&, bool) const                                                                             ▒        clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const                                                                                                                       ▒        clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__u::optional<llvm::StringRef> >, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char> >*, bool*) const                                               ▒        llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)                                                                                                                                                                          ▒        void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__u::optional<llvm::StringRef> >, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char> >*, bool*) const:▒        ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&)                                                                                                                                                               ▒        cc1_main(llvm::ArrayRef<char const*>, char const*, void*)                                                                                                                                                                                   ▒        clang::ExecuteCompilerInvocation(clang::CompilerInstance*)                                                                                                                                                                                  ▒        clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)                                                                                                                                                                              ▒        clang::FrontendAction::Execute()                                                                                                                                                                                                            ▒
        clang::ParseAST(clang::Sema&, bool, bool)                                                                                                                                                                                                   ▒
        clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)                                                                                                                                                                           ▒
        clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::Int▒
        llvm::legacy::PassManagerImpl::run(llvm::Module&)                                                                                                                                                                                           ▒
        llvm::FPPassManager::runOnModule(llvm::Module&)                                                                                                                                                                                             ▒
        llvm::FPPassManager::runOnFunction(llvm::Function&)                                                                                                                                                                                         ▒
      - llvm::MachineFunctionPass::runOnFunction(llvm::Function&)                                                                                                                                                                                   ▒
         - 45.61% (anonymous namespace)::TailDuplicateBase::runOnMachineFunction(llvm::MachineFunction&)                                                                                                                                            ▒
              llvm::TailDuplicator::tailDuplicateBlocks()                                                                                                                                                                                           ▒
              llvm::TailDuplicator::shouldTailDuplicate(bool, llvm::MachineBasicBlock&)                                                                                                                                                             ▒
```

https://github.com/llvm/llvm-project/pull/79993


More information about the llvm-commits mailing list