<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/utils/TableGen/TableGen.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[Clang] Fix cleanup attribute by delaying type checks after the type is deduced (#164440)</title>
<updated>2025-11-18T12:36:51+00:00</updated>
<author>
<name>Guillot Tony</name>
<email>tony.guillot@protonmail.com</email>
</author>
<published>2025-11-18T12:36:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=22a2cae5d6735a510b17859848b14f60d2e5cdfa'/>
<id>22a2cae5d6735a510b17859848b14f60d2e5cdfa</id>
<content type='text'>
Previously, the handling of the `cleanup` attribute had some checks
based on the type, but we were deducing the type after handling the
attribute.
This PR fixes the way the are dealing with type checks for the `cleanup`
attribute by delaying these checks after we are deducing the type.

It is also fixed in a way that the solution can be adapted for other
attributes that does some type based checks.
This is the list of C/C++ attributes that are doing type based checks
and will need to be fixed in additional PRs:
- CUDAShared
- MutualExclusions
- PassObjectSize
- InitPriority
- Sentinel
- AcquireCapability
- RequiresCapability
- LocksExcluded
- AcquireHandle

NB: Some attributes could have been missed in my shallow search.

Fixes #129631</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the handling of the `cleanup` attribute had some checks
based on the type, but we were deducing the type after handling the
attribute.
This PR fixes the way the are dealing with type checks for the `cleanup`
attribute by delaying these checks after we are deducing the type.

It is also fixed in a way that the solution can be adapted for other
attributes that does some type based checks.
This is the list of C/C++ attributes that are doing type based checks
and will need to be fixed in additional PRs:
- CUDAShared
- MutualExclusions
- PassObjectSize
- InitPriority
- Sentinel
- AcquireCapability
- RequiresCapability
- LocksExcluded
- AcquireHandle

NB: Some attributes could have been missed in my shallow search.

Fixes #129631</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang][Sema] Extend test coverage for SVE/SME builtin usage. (#156908)</title>
<updated>2025-10-08T09:58:17+00:00</updated>
<author>
<name>Paul Walker</name>
<email>paul.walker@arm.com</email>
</author>
<published>2025-10-08T09:58:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ff9cdbdb1af25d77014707754e8d4ec72f4b75dd'/>
<id>ff9cdbdb1af25d77014707754e8d4ec72f4b75dd</id>
<content type='text'>
Adds SEMA tests to verify correct SVE/SME builtin usage based on the
calling function's type (i.e. normal, streaming or streaming
compatible).

For invalid uses the tests verify the expected diagnostic is emitted.
This exposed an issue whereby some builtins are incorrectly callable by
streaming compatible functions, which this PR fixes.

The tests are autogenerated based on the builtin definitions (e.g.
arm_sve.td). This is achieved by extending SVEEmitter, which can now
emit a JSON file containing builtin usage information that can be fed to
aarch64_builtins_test_generator.py that is also part of this PR.

Everything currently in `clang/test/Sema/AArch64` is the result of:
```
clang/utils/aarch64_builtins_test_generator.py --gen-streaming-guard-tests &lt;LLVM_BUILD_DIR&gt;/tools/clang/include/clang/Basic/arm_sve_builtins.json --out-dir clang/test/Sema/AArch64/
clang/utils/aarch64_builtins_test_generator.py --gen-streaming-guard-tests &lt;LLVM_BUILD_DIR&gt;/tools/clang/include/clang/Basic/arm_sme_builtins.json --out-dir clang/test/Sema/AArch64/
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds SEMA tests to verify correct SVE/SME builtin usage based on the
calling function's type (i.e. normal, streaming or streaming
compatible).

For invalid uses the tests verify the expected diagnostic is emitted.
This exposed an issue whereby some builtins are incorrectly callable by
streaming compatible functions, which this PR fixes.

The tests are autogenerated based on the builtin definitions (e.g.
arm_sve.td). This is achieved by extending SVEEmitter, which can now
emit a JSON file containing builtin usage information that can be fed to
aarch64_builtins_test_generator.py that is also part of this PR.

Everything currently in `clang/test/Sema/AArch64` is the result of:
```
clang/utils/aarch64_builtins_test_generator.py --gen-streaming-guard-tests &lt;LLVM_BUILD_DIR&gt;/tools/clang/include/clang/Basic/arm_sve_builtins.json --out-dir clang/test/Sema/AArch64/
clang/utils/aarch64_builtins_test_generator.py --gen-streaming-guard-tests &lt;LLVM_BUILD_DIR&gt;/tools/clang/include/clang/Basic/arm_sme_builtins.json --out-dir clang/test/Sema/AArch64/
```</pre>
</div>
</content>
</entry>
<entry>
<title>[CIR][NFC] Use TableGen to generate LLVM lowering patterns (#159390)</title>
<updated>2025-09-18T13:43:08+00:00</updated>
<author>
<name>Sirui Mu</name>
<email>msrlancern@gmail.com</email>
</author>
<published>2025-09-18T13:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=81aaca359b2d5a6529d9620fa4181c4d89c83c7c'/>
<id>81aaca359b2d5a6529d9620fa4181c4d89c83c7c</id>
<content type='text'>
Most lowering patterns have exactly the same class declaration with
different names and different `matchAndRewrite` implementations, yet
their declaration occupies near 1000 lines of code in `LowerToLLVM.h`,
making this file difficult to read and boring to maintain. In this
patch, I migrate their declarations to be generated from `CIROps.td`
using `clang-tblgen`. Some extra `CIR_Op` TableGen fields are introduced
to help this:

- The `CIR_Op` class now defines a `bit` field `hasLLVMLowering` which
defaults to `true`. If its value is `true`, `clang-tblgen` would
generate an LLVM lowering pattern declaration for the operation.

- Some LLVM lowering patterns has bounded recursion. This could be
enabled by setting the `isLLVMLoweringRecursive` field in a `CIR_Op`
record to `true`.

- Some LLVM lowering patterns have defined additional class members.
They could be listed in the `extraLLVMLoweringPatternDecl` field.

Note that in the incubator we have a similar TableGen code generator
that generates LLVM lowering code for CIR builtin ops which has a
one-to-one correspondence to LLVM dialect operations. This patch does
NOT try to upstream it.

Some additional noticeable changes made by this patch:

- This patch adds the `dataLayout` member to every LLVM lowering pattern
class to make the job easier for a code generator. In the future we
might want to add more members to the lowering patterns, and we will
need to update the code generator to make such changes.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most lowering patterns have exactly the same class declaration with
different names and different `matchAndRewrite` implementations, yet
their declaration occupies near 1000 lines of code in `LowerToLLVM.h`,
making this file difficult to read and boring to maintain. In this
patch, I migrate their declarations to be generated from `CIROps.td`
using `clang-tblgen`. Some extra `CIR_Op` TableGen fields are introduced
to help this:

- The `CIR_Op` class now defines a `bit` field `hasLLVMLowering` which
defaults to `true`. If its value is `true`, `clang-tblgen` would
generate an LLVM lowering pattern declaration for the operation.

- Some LLVM lowering patterns has bounded recursion. This could be
enabled by setting the `isLLVMLoweringRecursive` field in a `CIR_Op`
record to `true`.

- Some LLVM lowering patterns have defined additional class members.
They could be listed in the `extraLLVMLoweringPatternDecl` field.

Note that in the incubator we have a similar TableGen code generator
that generates LLVM lowering code for CIR builtin ops which has a
one-to-one correspondence to LLVM dialect operations. This patch does
NOT try to upstream it.

Some additional noticeable changes made by this patch:

- This patch adds the `dataLayout` member to every LLVM lowering pattern
class to make the job easier for a code generator. In the future we
might want to add more members to the lowering patterns, and we will
need to update the code generator to make such changes.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] add typo correction for unknown attribute names (#140629)</title>
<updated>2025-05-22T14:03:32+00:00</updated>
<author>
<name>Oleksandr T.</name>
<email>oleksandr.tarasiuk@outlook.com</email>
</author>
<published>2025-05-22T14:03:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=50127ac054a08321b64f4ac24bda5cad20e20ac1'/>
<id>50127ac054a08321b64f4ac24bda5cad20e20ac1</id>
<content type='text'>
This patch enhances Clang's diagnosis for unknown attributes by
providing typo correction suggestions for known attributes.

```cpp
[[gmu::deprected]] // expected-warning {{unknown attribute 'gmu::deprected' ignored; did you mean 'gnu::deprecated'?}}
int f1(void) {
  return 0;
}

[[deprected]] // expected-warning {{unknown attribute 'deprected' ignored; did you mean 'deprecated'?}}
int f2(void) {
  return 0;
}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch enhances Clang's diagnosis for unknown attributes by
providing typo correction suggestions for known attributes.

```cpp
[[gmu::deprected]] // expected-warning {{unknown attribute 'gmu::deprected' ignored; did you mean 'gnu::deprecated'?}}
int f1(void) {
  return 0;
}

[[deprected]] // expected-warning {{unknown attribute 'deprected' ignored; did you mean 'deprecated'?}}
int f2(void) {
  return 0;
}
```</pre>
</div>
</content>
</entry>
<entry>
<title>[RISCV] Implement intrinsics for XAndesVPackFPH (#140007)</title>
<updated>2025-05-20T05:16:51+00:00</updated>
<author>
<name>Jim Lin</name>
<email>jim@andestech.com</email>
</author>
<published>2025-05-20T05:16:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d561d595c4ee741f873972c03afa829e6c566ffd'/>
<id>d561d595c4ee741f873972c03afa829e6c566ffd</id>
<content type='text'>
This patch implements clang intrinsic support for XAndesVPackFPH.

The document for the intrinsics can be found at:

https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/intrinsic_funcs.adoc#andes-vector-packed-fp16-extensionxandesvpackfph
and with policy variants

https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/policy_funcs/intrinsic_funcs.adoc#andes-vector-packed-fp16-extensionxandesvpackfph

Co-authored-by: Tony Chuan-Yue Yuan &lt;yuan593@andestech.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch implements clang intrinsic support for XAndesVPackFPH.

The document for the intrinsics can be found at:

https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/intrinsic_funcs.adoc#andes-vector-packed-fp16-extensionxandesvpackfph
and with policy variants

https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/policy_funcs/intrinsic_funcs.adoc#andes-vector-packed-fp16-extensionxandesvpackfph

Co-authored-by: Tony Chuan-Yue Yuan &lt;yuan593@andestech.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] [NFC] Tablegen component diags headers (#134777)</title>
<updated>2025-04-08T15:21:45+00:00</updated>
<author>
<name>Sirraide</name>
<email>aeternalmail@gmail.com</email>
</author>
<published>2025-04-08T15:21:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6c74fe9087fd85059158719ad1ab67e0f5098300'/>
<id>6c74fe9087fd85059158719ad1ab67e0f5098300</id>
<content type='text'>
The component diagnostic headers (i.e. `DiagnosticAST.h` and friends)
all follow the same format, and there’s enough of them (and in them) to
where updating all of them has become rather tedious (at least it was
for me while working on #132348), so this patch instead generates all of
them (or rather their contents) via Tablegen.

Also, it seems that `%enum_select` currently wouldn’t work in
`DiagnosticCommonKinds.td` because the infrastructure for that was
missing from `DiagnosticIDs.h`; this patch should fix that as well.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The component diagnostic headers (i.e. `DiagnosticAST.h` and friends)
all follow the same format, and there’s enough of them (and in them) to
where updating all of them has become rather tedious (at least it was
for me while working on #132348), so this patch instead generates all of
them (or rather their contents) via Tablegen.

Also, it seems that `%enum_select` currently wouldn’t work in
`DiagnosticCommonKinds.td` because the infrastructure for that was
missing from `DiagnosticIDs.h`; this patch should fix that as well.</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[Clang] [NFC] Introduce a helper for emitting compatibility diagnostics (#132348)" (#134043)</title>
<updated>2025-04-02T08:40:05+00:00</updated>
<author>
<name>Sirraide</name>
<email>aeternalmail@gmail.com</email>
</author>
<published>2025-04-02T08:40:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=10c6ebc42711fa12ff790f3462cbce0e02538ab7'/>
<id>10c6ebc42711fa12ff790f3462cbce0e02538ab7</id>
<content type='text'>
This reapplies #132348 with a fix to the python bindings tests, reverting
https://github.com/llvm/llvm-project/commit/076397ff3217cf45fd08024dd7bcd2bc8fb229ab.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reapplies #132348 with a fix to the python bindings tests, reverting
https://github.com/llvm/llvm-project/commit/076397ff3217cf45fd08024dd7bcd2bc8fb229ab.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Clang] [NFC] Introduce a helper for emitting compatibility diagnostics" (#134036)</title>
<updated>2025-04-02T06:29:05+00:00</updated>
<author>
<name>Sirraide</name>
<email>aeternalmail@gmail.com</email>
</author>
<published>2025-04-02T06:29:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=076397ff3217cf45fd08024dd7bcd2bc8fb229ab'/>
<id>076397ff3217cf45fd08024dd7bcd2bc8fb229ab</id>
<content type='text'>
Reverts llvm/llvm-project#132348

Some tests are failing and I still need to figure out what is going on
here.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#132348

Some tests are failing and I still need to figure out what is going on
here.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] [NFC] Introduce a helper for emitting compatibility diagnostics (#132348)</title>
<updated>2025-04-02T06:06:29+00:00</updated>
<author>
<name>Sirraide</name>
<email>aeternalmail@gmail.com</email>
</author>
<published>2025-04-02T06:06:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9d06e0879b5600b19cd8cebd98e4f92b5e62400f'/>
<id>9d06e0879b5600b19cd8cebd98e4f92b5e62400f</id>
<content type='text'>
This is a follow-up to #132129.

Currently, only `Parser` and `SemaBase` get a `DiagCompat()` helper; I’m
planning to keep refactoring compatibility warnings and add more helpers
to other classes as needed. I also refactored a single parser compat
warning just to make sure everything works properly when diagnostics
across multiple components (i.e. Sema and Parser in this case) are
involved.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a follow-up to #132129.

Currently, only `Parser` and `SemaBase` get a `DiagCompat()` helper; I’m
planning to keep refactoring compatibility warnings and add more helpers
to other classes as needed. I also refactored a single parser compat
warning just to make sure everything works properly when diagnostics
across multiple components (i.e. Sema and Parser in this case) are
involved.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] Add BuiltinTemplates.td to generate code for builtin templates (#123736)</title>
<updated>2025-02-26T15:01:14+00:00</updated>
<author>
<name>Nikolas Klauser</name>
<email>nikolasklauser@berlin.de</email>
</author>
<published>2025-02-26T15:01:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8dd8e5f7d692cc43f4322f04034f5c472381aa43'/>
<id>8dd8e5f7d692cc43f4322f04034f5c472381aa43</id>
<content type='text'>
This makes it significantly easier to add new builtin templates, since
you only have to modify two places instead of a dozen or so.

The `BuiltinTemplates.td` could also be extended to generate
documentation from it in the future.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes it significantly easier to add new builtin templates, since
you only have to modify two places instead of a dozen or so.

The `BuiltinTemplates.td` could also be extended to generate
documentation from it in the future.</pre>
</div>
</content>
</entry>
</feed>
