[PATCH] D114171: [SLP]Improve reductions analysis and emission, part 1.
Alexander Kornienko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 23 16:37:21 PDT 2022
alexfh added a comment.
Current profile:
- 73.25% clang::BackendConsumer::HandleTranslationUnit ▒
- 72.69% clang::EmitBackendOutput ▒
- 52.79% (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline ▒
- 52.79% llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run ▒
- 31.80% llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run ▒
- 31.77% llvm::ModuleToFunctionPassAdaptor::run ▒
- 31.44% llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run ▒
- 31.43% llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run ▒
- 28.23% llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run ▒
llvm::SLPVectorizerPass::run ▒
- llvm::SLPVectorizerPass::runImpl ▒
- 28.19% llvm::SLPVectorizerPass::vectorizeChainsInBlock ▒
- 27.76% llvm::SLPVectorizerPass::vectorizeSimpleInstructions ▒
- 25.69% llvm::SLPVectorizerPass::vectorizeRootInstruction ▒
- 25.50% (anonymous namespace)::HorizontalReduction::tryToReduce ▒
- 5.27% llvm::MapVector<llvm::Value*, llvm::SmallVector<llvm::Instruction*, 2u>, llvm::DenseMap<llvm::Value*, unsigned int, llvm::DenseMapInfo<llvm::Value*, void>, llvm::detail::DenseMapPair<llvm::Va▒
- 3.12% llvm::DenseMapBase<llvm::DenseMap<llvm::Value*, unsigned int, llvm::DenseMapInfo<llvm::Value*, void>, llvm::detail::DenseMapPair<llvm::Value*, unsigned int> >, llvm::Value*, unsigned int, ▒
2.71% llvm::DenseMap<llvm::Value*, unsigned int, llvm::DenseMapInfo<llvm::Value*, void>, llvm::detail::DenseMapPair<llvm::Value*, unsigned int> >::grow ▒
0.63% std::__u::vector<std::__u::pair<llvm::Value*, llvm::SmallVector<llvm::Instruction*, 2u> >, std::__u::allocator<std::__u::pair<llvm::Value*, llvm::SmallVector<llvm::Instruction*, 2u> > > >:▒
- 3.11% llvm::slpvectorizer::BoUpSLP::buildTree_rec ▒
- 1.66% llvm::slpvectorizer::BoUpSLP::buildTree_rec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&)::$_32::operator() ▒
- 0.85% llvm::DenseMapBase<llvm::DenseMap<llvm::Value*, unsigned int, llvm::DenseMapInfo<llvm::Value*, void>, llvm::detail::DenseMapPair<llvm::Value*, unsigned int> >, llvm::Value*, unsigned in▒
0.69% llvm::DenseMap<llvm::Value*, unsigned int, llvm::DenseMapInfo<llvm::Value*, void>, llvm::detail::DenseMapPair<llvm::Value*, unsigned int> >::grow ▒
- 2.21% llvm::SmallPtrSetImpl<llvm::Value*>::insert ▒
- 1.98% llvm::SmallPtrSetImplBase::insert_imp_big ▒
1.10% llvm::SmallPtrSetImplBase::Grow ▒
- 1.60% llvm::SmallPtrSetImplBase::insert_imp_big ▒
0.77% llvm::SmallPtrSetImplBase::Grow ▒
- 2.06% tryToVectorizeSequence<llvm::Value> ▒
- 2.04% llvm::SLPVectorizerPass::tryToVectorizeList ▒
- 1.49% llvm::slpvectorizer::BoUpSLP::buildTree_rec ▒
0.66% llvm::slpvectorizer::BoUpSLP::buildTree_rec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&)::$_32::operator() ▒
And the hottest part of `HorizontalReduction::tryToReduce`:
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:11138 ▒
│ ; switch (RdxKind) { ▒
0.00 │ movl 480(%rax), %edi ▒
│ movl $3134, %eax ▒
│ btl %edi, %eax ▒
│ ↓ jae 26ba ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:11146 ▒
│ ; unsigned RdxOpcode = RecurrenceDescriptor::getOpcode(RdxKind); ▒
│ → callq llvm::RecurrenceDescriptor::getOpcode ▒
│ movl %eax, %r15d ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:11147 ▒
│ ; if (!AllConsts) ▒
│ testb %r13b, %r13b ▒
│ ↓ je 273b ▒
│ xorl %r13d, %r13d ▒
│ movl $0, -104(%rbp) ▒
│ movq -184(%rbp), %rbx ▒
│ ↓ jmp 276a ▒
│ nop ▒
0.34 │25e0: movq %rcx, %rsi ▒
0.03 │25e3: movq %rsi, %rcx ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/ADT/DenseMap.h:1256 ▒
│ ; return LHS.Ptr == RHS.Ptr; ▒
0.18 │ cmpq %r8, %rsi ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:10932 ▒
│ ; for (Value *U : IgnoreList) ▒
│ ↑ je 2515 ◆
0.20 │25ef: movq (%rcx), %r9 ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Value.h:533 ▒
│ ; return SubclassID; ▒
9.77 │ movzbl 16(%r9), %edx ▒
│ cmpl $27, %edx ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Operator.h:296 ▒
│ ; if (auto *I = dyn_cast<Instruction>(V)) ▒
0.26 │ ↓ jae 2610 ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Constants.h:1355 ▒
│ ; return V->getValueID() == ConstantExprVal; ▒
│ cmpb $5, %dl ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Operator.h:298 ▒
│ ; else if (auto *CE = dyn_cast<ConstantExpr>(V)) ▒
│ ↓ jne 2631 ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Value.h:852 ▒
│ ; unsigned short getSubclassDataFromValue() const { return SubclassData; } ▒
│ movzwl 18(%r9), %edx ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Operator.h:303 ▒
│ ; switch (Opcode) { ▒
│ cmpl $57, %edx ▒
│ ↓ jbe 2618 ▒
│ ↓ jmp 2631 ▒
│ nop ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Instruction.h:157 ▒
│ ; unsigned getOpcode() const { return getValueID() - InstructionVal; } ▒
0.01 │2610: addl $-27, %edx ▒
│ ; /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Operator.h:303 ▒
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114171/new/
https://reviews.llvm.org/D114171
More information about the llvm-commits
mailing list