[all-commits] [llvm/llvm-project] d9b3d7: [WebAssembly] Don't depend on the flags set by han...

topperc via All-commits all-commits at lists.llvm.org
Tue Aug 18 03:36:40 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: d9b3d7557a8e98f91cca6f1ce2b1f1f784eaa355
      https://github.com/llvm/llvm-project/commit/d9b3d7557a8e98f91cca6f1ce2b1f1f784eaa355
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-08-18 (Tue, 18 Aug 2020)

  Changed paths:
    M clang/lib/Basic/Targets/WebAssembly.cpp
    M clang/lib/Basic/Targets/WebAssembly.h

  Log Message:
  -----------
  [WebAssembly] Don't depend on the flags set by handleTargetFeatures in initFeatureMap.

Properly set "simd128" in the feature map when "unimplemented-simd128"
is requested.

initFeatureMap is used to create the feature vector used by
handleTargetFeatures. There are later calls to initFeatureMap in
CodeGen that were using these flags to recreate the map. But the
original feature vector should be passed to those calls. So that
should be enough to rebuild the map.

The only issue seemed to be that simd128 was not enabled in the
map by the first call to initFeatureMap. Using the SIMDLevel set
by handleTargetFeatures in the later calls allowed simd128 to be
set in the later versions of the map.

To fix this I've added an override of setFeatureEnabled that
will update the map the first time with the correct simd dependency.

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

(cherry picked from commit 2b8ad6b6040833f4f8702721ebaa7749e5c23e60)


  Commit: 2d010325ea233fc97e61c00806b46ab2abab3a94
      https://github.com/llvm/llvm-project/commit/2d010325ea233fc97e61c00806b46ab2abab3a94
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-08-18 (Tue, 18 Aug 2020)

  Changed paths:
    M clang/include/clang/Basic/TargetOptions.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Basic/Targets.cpp
    M clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp

  Log Message:
  -----------
  [Target] Cache the command line derived feature map in TargetOptions.

We can use this to remove some calls to initFeatureMap from Sema
and CodeGen when a function doesn't have a target attribute.

This reduces compile time of the linux kernel where this map
is needed to diagnose some inline assembly constraints based
on whether sse, avx, or avx512 is enabled.

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

(cherry picked from commit 5c1fe4e20f887286baac6989943a0875e12834fe)


Compare: https://github.com/llvm/llvm-project/compare/522eeb66edfb...2d010325ea23


More information about the All-commits mailing list