[all-commits] [llvm/llvm-project] baca3c: Move SIMD alignment calculation to LLVM Frontend

Dominik Adamski via All-commits all-commits at lists.llvm.org
Fri Feb 10 02:19:18 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: baca3c150733c89686287ba4927c351eec9695e2
      https://github.com/llvm/llvm-project/commit/baca3c150733c89686287ba4927c351eec9695e2
  Author: Dominik Adamski <dominik.adamski at amd.com>
  Date:   2023-02-10 (Fri, 10 Feb 2023)

  Changed paths:
    M clang/include/clang/Basic/TargetInfo.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/CMakeLists.txt
    M clang/lib/Basic/TargetInfo.cpp
    M clang/lib/Basic/Targets/PPC.h
    M clang/lib/Basic/Targets/WebAssembly.h
    M clang/lib/Basic/Targets/X86.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
    M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

  Log Message:
  -----------
  Move SIMD alignment calculation to LLVM Frontend

Currently default simd alignment is defined by Clang specific TargetInfo class.
This class cannot be reused for LLVM Flang. That's why default simd alignment
calculation has been moved to OMPIRBuilder which is common for Flang and Clang.

Previous attempt: https://reviews.llvm.org/D138496 was wrong because
the default alignment depended on the number of built LLVM targets.

If we wanted to calculate the default alignment for PPC and we hadn't specified
PPC LLVM target to build, then we would get 0 as the alignment because
OMPIRBuilder couldn't create PPCTargetMachine object and it returned 0 as
the default value.

If PPC LLVM target had been built earlier, then OMPIRBuilder could have created
PPCTargetMachine object and it would have returned 128.

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

Reviewed By: jdoerfert




More information about the All-commits mailing list