[all-commits] [llvm/llvm-project] c0ef9c: [WebAssembly] Use SubtargetFeature's Implies field...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Thu Jul 9 00:05:14 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c0ef9c53ecca5f033dc6a022da2a986f6925c70e
      https://github.com/llvm/llvm-project/commit/c0ef9c53ecca5f033dc6a022da2a986f6925c70e
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2026-07-09 (Thu, 09 Jul 2026)

  Changed paths:
    M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
    M llvm/lib/Target/WebAssembly/WebAssembly.td
    M llvm/lib/Target/WebAssembly/WebAssemblySubtarget.cpp
    M llvm/test/MC/WebAssembly/function-alias.ll

  Log Message:
  -----------
  [WebAssembly] Use SubtargetFeature's Implies field (#206643)

This makes use of `SubtargetFeature`'s `Implies` field, which lets us
define feature dependencies:

https://github.com/llvm/llvm-project/blob/442c59c75ca384db53a6d6d81686b17ea4b397c3/llvm/include/llvm/Target/Target.td#L568-L571
and removes C++ code that specified feature dependencies.

These are the dependencies specified. EH dependencies are currently only
specified in clang options, and others are specified in
`WebAssemblySubtarget.cpp`.
- exception-handling implies multivalue and reference-types
- bulk-memory implifes bulk-memory-opt
- gc implies reference-types
- reference-types implies call-indirect-overlong

The features in `WebAssembly.td` were sorted in the alphabetical order,
but this changes it because implied features have to come before the
implying feature, e.g., multivalue and reference-types have to come
before exception-handling.

---

One semantic difference from the current code, is, when reference-types
implies call-indirect-overlong,
```console
llc -mattr=+reference-types,-call-indirect-overlong
```
this currently forces call-indirect-overlong to be true despite there is
`-call-indirect-overlong`, because

https://github.com/llvm/llvm-project/blob/442c59c75ca384db53a6d6d81686b17ea4b397c3/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.cpp#L63-L67

But with the `Implies` field, disabling call-indirect-overlong disabled
both features, because TableGen thinks reference-types depends on
call-indirect-overlong, so without call-indirect-overlong,
reference-types can't be enabled. This is not exactly true with the
relationship of reference-types and call-indirect-overlong, but
generally makes sense for true dependencies, like exception-handling
implying (=depending on) multivalue and reference-types.

Also this wouldn't really affect the end users because these are `llc`
flags.



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