[PATCH] D141910: [OpenMP][OMPIRBuilder]Move SIMD alignment calculation to LLVM Frontend

Dominik Adamski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 03:00:40 PST 2023


domada created this revision.
domada added reviewers: dpalermo, skatrak, kiranktp, RogerV-AMD, NimishMishra, jsjodin.
Herald added subscribers: pmatos, asb, guansong, kbarton, hiraditya, jgravelle-google, sbc100, yaxunl, nemanjai, dschuff.
Herald added a project: All.
domada requested review of this revision.
Herald added subscribers: llvm-commits, lldb-commits, cfe-commits, sstefan1, aheejin.
Herald added a reviewer: jdoerfert.
Herald added projects: clang, LLDB, LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141910

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141910.489748.patch
Type: text/x-patch
Size: 6068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230117/032a2348/attachment.bin>


More information about the llvm-commits mailing list