[all-commits] [llvm/llvm-project] 536f65: [X86] Optimize getImpliedDisabledFeatures & getImp...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Aug 18 03:39:23 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 536f65f47fcb314f269355c4001c0f2b4744c0b6
      https://github.com/llvm/llvm-project/commit/536f65f47fcb314f269355c4001c0f2b4744c0b6
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-08-18 (Tue, 18 Aug 2020)

  Changed paths:
    M llvm/lib/Support/X86TargetParser.cpp

  Log Message:
  -----------
  [X86] Optimize getImpliedDisabledFeatures & getImpliedEnabledFeatures after D83273

Previously the time complexity is O(|number of paths from the root to an
implied feature| * CPU_FWATURE_MAX) where CPU_FEATURE_MAX is 92.

The number of paths can be large (theoretically exponential).

For an inline asm statement, there is a code path
`clang::Parser::ParseAsmStatement -> clang::Sema::ActOnGCCAsmStmt -> ASTContext::getFunctionFeatureMap`
leading to potentially many calls of getImpliedEnabledFeatures (41 for my -march=native case).

We should improve the performance a bit in case the number of inline asm
statements is large (Linux kernel builds).

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D85257

(cherry picked from commit 0c7af8c83bd1acb0ca78f35ddde29b6fde4363a0)




More information about the All-commits mailing list