[all-commits] [llvm/llvm-project] b0276e: [RISCV][NFC] Reimplementation of target attribute ...

Piyou Chen via All-commits all-commits at lists.llvm.org
Sat Aug 31 05:03:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0276ec6b74cd65b765234f42b8e0e32597d3642
      https://github.com/llvm/llvm-project/commit/b0276ec6b74cd65b765234f42b8e0e32597d3642
  Author: Piyou Chen <piyou.chen at sifive.com>
  Date:   2024-08-31 (Sat, 31 Aug 2024)

  Changed paths:
    M clang/lib/Basic/Targets/RISCV.cpp

  Log Message:
  -----------
  [RISCV][NFC] Reimplementation of target attribute override mechanism (#106680)

This patch aims to replace the target attribute override mechanism based
on `__RISCV_TargetAttrNeedOverride` with the insertion of several
negative target features

When the target attribute uses the full architecture string
("arch=rv64gc") or specifies the CPU ("cpu=rocket-rv64") as the version,
it will override the module-level target feature. Currently, this
mechanism is implemented by inserting `__RISCV_TargetAttrNeedOverride`
as a dummy target feature immediately before the target attribute's
feature.

```
module target features + __RISCV_TargetAttrNeedOverride + target attribute's feature
```

The RISCVTargetInfo::initFeatureMap function will remove the "module
target features" and use only the "target attribute's features".

This patch changes the process as follows:

```
module target features + negative target feature for all supported extension + target attribute's feature
```

The `module target features` will be disable by `negative target feature
for all supported extension` in `TargetInfo::initFeatureMap`



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list