[flang-commits] [PATCH] D129018: [flang] Establish a single source of target information for semantics

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jul 4 01:01:21 PDT 2022


jeanPerier added a comment.

> Targets can implement it in any way they wish

@tschuett, the plan is to avoid re-implementing target information in flang. We wish to plug into the existing target description in llvm (probably from using the infrastructure in llvm/include/llvm/Target). What this patch does is to centralize the target dependent info in semantics into one class that has an interface in terms of Fortran types (which is not the case of llvm generic infrastructure). The next steps that will probably have to be taken to be able to configure the target data are:

- let the driver select the target triple (either command line or host), and get the LLVM representation for it (llvm::TargetMachine ? llvm::DataLayout ? ... ).
- to let the driver use relevant information from this target  to set up the TargetCharacteristics representation (whose ctor or member functions might have to be adapted to do that).
- ensure the driver passes the triple to lowering (the comdat point might require using it when selecting linkage if windows LLVM target does not fulfill the target independent LLVM linkonce attribute description from the manual).

Anyone is more than welcome to launch an RFC to precisely define how this target dependent configuration should occur.

So you should see the TargetCharacteristics  class as a generic wrapper to translate LLVM target info into something meaningful in terms of Fortran.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129018/new/

https://reviews.llvm.org/D129018



More information about the flang-commits mailing list