[PATCH] D106056: [CVP] processSwitch: Remove default case when switch cover all possible values.

Alexander Kornienko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 26 22:02:28 PDT 2021


alexfh added a comment.

In D106056#3021866 <https://reviews.llvm.org/D106056#3021866>, @xbolva00 wrote:

> In D106056#3021783 <https://reviews.llvm.org/D106056#3021783>, @alexfh wrote:
>
>> FYI, we see a ~5x increase in compile time on some of our code (mainly on some large protobuf-generated files) after rG8ba2adcf9e54b34ba8efa73ac0d81a1192e4f614 <https://reviews.llvm.org/rG8ba2adcf9e54b34ba8efa73ac0d81a1192e4f614>. We're working on an isolated test case.
>
> With switches with the huge number of cases?

Yes, there are switches with large number of cases. I'm still working on a reduced test case though.

While it's running, maybe this information will help: I collected profile using `perf record --call-graph lbr` and these are the hottest functions:

  -   98.71%     0.00%  clang-after  clang-after         [.] llvm::FPPassManager::runOnFunction                                                                                                                  ◆
     - llvm::FPPassManager::runOnFunction                                                                                                                                                                        ▒
        - 98.00% llvm::MachineFunctionPass::runOnFunction                                                                                                                                                        ▒
           - 86.87% (anonymous namespace)::MachineBlockPlacement::runOnMachineFunction                                                                                                                           ▒
              - 86.85% (anonymous namespace)::MachineBlockPlacement::buildCFGChains                                                                                                                              ▒
                 - 80.96% (anonymous namespace)::MachineBlockPlacement::buildLoopChains                                                                                                                          ▒
                    - 80.35% (anonymous namespace)::MachineBlockPlacement::TopFallThroughFreq                                                                                                                    ▒
                         73.34% llvm::MachineBranchProbabilityInfo::getEdgeProbability                                                                                                                           ▒
                 - 5.89% (anonymous namespace)::MachineBlockPlacement::buildChain                                                                                                                                ▒
                    - 5.88% (anonymous namespace)::MachineBlockPlacement::canTailDuplicateUnplacedPreds                                                                                                          ▒
                       - 5.82% hasSameSuccessors                                                                                                                                                                 ▒
                            llvm::SmallPtrSetImplBase::FindBucketFor                                                                                                                                             ▒
           - 4.57% (anonymous namespace)::BranchFolderPass::runOnMachineFunction                                                                                                                                 ▒
              - llvm::BranchFolder::OptimizeFunction                                                                                                                                                             ▒
                 - 4.18% llvm::BranchFolder::TailMergeBlocks                                                                                                                                                     ▒
                      2.32% llvm::MachineBasicBlock::hasEHPadSuccessor                                                                                                                                           ▒
                      1.77% llvm::MachineBasicBlock::mayHaveInlineAsmBr                                                                                                                                          ▒
           - 3.75% (anonymous namespace)::PHIElimination::runOnMachineFunction                                                                                                                                   ▒
                3.43% llvm::LiveVariables::isLiveOut                                                                                                                                                             ▒
           - 0.65% (anonymous namespace)::TailDuplicateBase::runOnMachineFunction                                                                                                                                ▒
              - llvm::TailDuplicator::tailDuplicateBlocks                                                                                                                                                        ▒
                   0.64% llvm::TailDuplicator::tailDuplicateAndUpdate                                                                                                                                            ▒
          0.68% (anonymous namespace)::CodeGenPrepare::runOnFunction                                                                                                                                             ▒
  ...
  -   73.82%    71.11%  clang-after  clang-after         [.] llvm::MachineBranchProbabilityInfo::getEdgeProbability                                                                                              ▒
     - 70.99% llvm::FPPassManager::runOnFunction                                                                                                                                                                 ▒
          llvm::MachineFunctionPass::runOnFunction                                                                                                                                                               ▒
          (anonymous namespace)::MachineBlockPlacement::runOnMachineFunction                                                                                                                                     ▒
        - (anonymous namespace)::MachineBlockPlacement::buildCFGChains                                                                                                                                           ▒
           - 70.99% (anonymous namespace)::MachineBlockPlacement::buildLoopChains                                                                                                                                ▒
              - 70.65% (anonymous namespace)::MachineBlockPlacement::TopFallThroughFreq                                                                                                                          ▒
                   llvm::MachineBranchProbabilityInfo::getEdgeProbability                                                                                                                                        ▒
       2.71% llvm::MachineBranchProbabilityInfo::getEdgeProbability                                                                                                                                              ▒


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106056/new/

https://reviews.llvm.org/D106056



More information about the llvm-commits mailing list