<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/CodeGen/CodeGenModule.cpp, branch users/koachan/spr/main.sparcias-enable-parseforallfeatures-in-matchoperandparserimpl</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][Driver] Add HIPAMD Driver support for AMDGCN flavoured SPIR-V (#95061)</title>
<updated>2024-06-25T11:19:28+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2024-06-25T11:19:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9acb533c38be833ec1d8daa06e127a9de8f0a5ef'/>
<id>9acb533c38be833ec1d8daa06e127a9de8f0a5ef</id>
<content type='text'>
This patch augments the HIPAMD driver to allow it to target AMDGCN
flavoured SPIR-V compilation. It's mostly straightforward, as we re-use
some of the existing SPIRV infra, however there are a few notable
additions:

- we introduce an `amdgcnspirv` offload arch, rather than relying on
using `generic` (this is already fairly overloaded) or simply using
`spirv` or `spirv64` (we'll want to use these to denote unflavoured
SPIRV, once we bring up that capability)
- initially it is won't be possible to mix-in SPIR-V and concrete AMDGPU
targets, as it would require some relatively intrusive surgery in the
HIPAMD Toolchain and the Driver to deal with two triples
(`spirv64-amd-amdhsa` and `amdgcn-amd-amdhsa`, respectively)
- in order to retain user provided compiler flags and have them
available at JIT time, we rely on embedding the command line via
`-fembed-bitcode=marker`, which the bitcode writer had previously not
implemented for SPIRV; we only allow it conditionally for AMDGCN
flavoured SPIRV, and it is handled correctly by the Translator (it ends
up as a string literal)

Once the SPIRV BE is no longer experimental we'll switch to using that
rather than the translator. There's some additional work that'll come
via a separate PR around correctly piping through AMDGCN's
implementation of `printf`, for now we merely handle its flags
correctly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch augments the HIPAMD driver to allow it to target AMDGCN
flavoured SPIR-V compilation. It's mostly straightforward, as we re-use
some of the existing SPIRV infra, however there are a few notable
additions:

- we introduce an `amdgcnspirv` offload arch, rather than relying on
using `generic` (this is already fairly overloaded) or simply using
`spirv` or `spirv64` (we'll want to use these to denote unflavoured
SPIRV, once we bring up that capability)
- initially it is won't be possible to mix-in SPIR-V and concrete AMDGPU
targets, as it would require some relatively intrusive surgery in the
HIPAMD Toolchain and the Driver to deal with two triples
(`spirv64-amd-amdhsa` and `amdgcn-amd-amdhsa`, respectively)
- in order to retain user provided compiler flags and have them
available at JIT time, we rely on embedding the command line via
`-fembed-bitcode=marker`, which the bitcode writer had previously not
implemented for SPIRV; we only allow it conditionally for AMDGCN
flavoured SPIRV, and it is handled correctly by the Translator (it ends
up as a string literal)

Once the SPIRV BE is no longer experimental we'll switch to using that
rather than the translator. There's some additional work that'll come
via a separate PR around correctly piping through AMDGCN's
implementation of `printf`, for now we merely handle its flags
correctly.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][AArch64][FMV] Stop emitting alias to ifunc. (#96221)</title>
<updated>2024-06-24T11:01:48+00:00</updated>
<author>
<name>Alexandros Lamprineas</name>
<email>alexandros.lamprineas@arm.com</email>
</author>
<published>2024-06-24T11:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3d8079229e7571a5912e880bf7a960d809c8ee96'/>
<id>3d8079229e7571a5912e880bf7a960d809c8ee96</id>
<content type='text'>
Long story short the interaction of two optimizations happening in
GlobalOpt results in a crash. For more details look at the issue
https://github.com/llvm/llvm-project/issues/96197. I will be fixing this
in GlobalOpt but it is a conservative solution since it won't allow us
to optimize resolvers which return a pointer to a function whose
definition is in another TU when compiling without LTO:

```
__attribute__((target_version("simd"))) void bar(void);
__attribute__((target_version("default"))) void bar(void);
int foo() { bar(); }
```

fixes: #96197</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Long story short the interaction of two optimizations happening in
GlobalOpt results in a crash. For more details look at the issue
https://github.com/llvm/llvm-project/issues/96197. I will be fixing this
in GlobalOpt but it is a conservative solution since it won't allow us
to optimize resolvers which return a pointer to a function whose
definition is in another TU when compiling without LTO:

```
__attribute__((target_version("simd"))) void bar(void);
__attribute__((target_version("default"))) void bar(void);
int foo() { bar(); }
```

fixes: #96197</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Fix loss of `dllexport` for exported template specialization (#94664)</title>
<updated>2024-06-10T18:39:28+00:00</updated>
<author>
<name>Andrew Ng</name>
<email>andrew.ng@sony.com</email>
</author>
<published>2024-06-10T18:39:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=baba78daf2b3a3ee9bfa21f1f8ff3584aa982ac8'/>
<id>baba78daf2b3a3ee9bfa21f1f8ff3584aa982ac8</id>
<content type='text'>
When dropping DLL attributes, ensure that the most recent declaration is
being checked.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When dropping DLL attributes, ensure that the most recent declaration is
being checked.</pre>
</div>
</content>
</entry>
<entry>
<title>[ARM] r11 is reserved when using -mframe-chain=aapcs (#86951)</title>
<updated>2024-06-07T09:58:10+00:00</updated>
<author>
<name>Oliver Stannard</name>
<email>oliver.stannard@arm.com</email>
</author>
<published>2024-06-07T09:58:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1a5239251ead73ee57f4e2f7fc93433ac7cf18b1'/>
<id>1a5239251ead73ee57f4e2f7fc93433ac7cf18b1</id>
<content type='text'>
When using the -mframe-chain=aapcs or -mframe-chain=aapcs-leaf options,
we cannot use r11 as an allocatable register, even if
-fomit-frame-pointer is also used. This is so that r11 will always point
to a valid frame record, even if we don't create one in every function.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using the -mframe-chain=aapcs or -mframe-chain=aapcs-leaf options,
we cannot use r11 as an allocatable register, even if
-fomit-frame-pointer is also used. This is so that r11 will always point
to a valid frame record, even if we don't create one in every function.</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] Prevent null pointer dereference in target attribute mangling (#94228)</title>
<updated>2024-06-03T23:20:33+00:00</updated>
<author>
<name>smanna12</name>
<email>soumi.manna@intel.com</email>
</author>
<published>2024-06-03T23:20:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ccaccc3367aa3d892ca31eb11d4bcea4979bead1'/>
<id>ccaccc3367aa3d892ca31eb11d4bcea4979bead1</id>
<content type='text'>
This patch adds assertions in the getMangledNameImpl() function to
ensure that the expected target attributes (TargetAttr,
TargetVersionAttr, and TargetClonesAttr) are not null before they are
passed to appendAttributeMangling() to prevent potential null pointer
dereferences and improve the robustness of the attribute mangling
process.

This assertion will trigger a runtime error with a clear message in
debug build if any of the expected attributes are missing, facilitating
early and easier diagnosis and debugging of such issues related to
attribute mangling.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds assertions in the getMangledNameImpl() function to
ensure that the expected target attributes (TargetAttr,
TargetVersionAttr, and TargetClonesAttr) are not null before they are
passed to appendAttributeMangling() to prevent potential null pointer
dereferences and improve the robustness of the attribute mangling
process.

This assertion will trigger a runtime error with a clear message in
debug build if any of the expected attributes are missing, facilitating
early and easier diagnosis and debugging of such issues related to
attribute mangling.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Remove useless zero-index constant GEPs (NFCI)</title>
<updated>2024-05-30T08:24:57+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2024-05-29T15:09:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cd9a02e2c76ec2f37409c6f7becd61e605c117d8'/>
<id>cd9a02e2c76ec2f37409c6f7becd61e605c117d8</id>
<content type='text'>
Remove zero-index constant expression GEPs, which are not needed
with opaque pointers and will get folded away.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove zero-index constant expression GEPs, which are not needed
with opaque pointers and will get folded away.
</pre>
</div>
</content>
</entry>
<entry>
<title>[C++20] [Modules] Don't generate the defintition for non-const available external variables (#93530)</title>
<updated>2024-05-29T05:39:57+00:00</updated>
<author>
<name>Chuanqi Xu</name>
<email>yedeng.yd@linux.alibaba.com</email>
</author>
<published>2024-05-29T05:39:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b0f10a1dc34aa1b73faeeabdc2d348074a02c75d'/>
<id>b0f10a1dc34aa1b73faeeabdc2d348074a02c75d</id>
<content type='text'>
Close https://github.com/llvm/llvm-project/issues/93497

The root cause of the problem is, we mark the variable from other
modules as constnant in LLVM incorrectly. This patch fixes this problem
by not emitting the defintition for non-const available external
variables. Since the non const available externally variable is not
helpful to the optimization.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Close https://github.com/llvm/llvm-project/issues/93497

The root cause of the problem is, we mark the variable from other
modules as constnant in LLVM incorrectly. This patch fixes this problem
by not emitting the defintition for non-const available external
variables. Since the non const available externally variable is not
helpful to the optimization.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang][FMV] Allow declaration of function versions in namespaces. (#93044)</title>
<updated>2024-05-23T09:09:22+00:00</updated>
<author>
<name>Alexandros Lamprineas</name>
<email>alexandros.lamprineas@arm.com</email>
</author>
<published>2024-05-23T09:09:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8930ba98e01bc66949e482b396f8389d64388359'/>
<id>8930ba98e01bc66949e482b396f8389d64388359</id>
<content type='text'>
Fixes the following bug:

namespace Name {
int __attribute((target_version("default"))) foo() { return 0; }
}

namespace Name {
int __attribute((target_version("sve"))) foo() { return 1; }
}

int bar() { return Name::foo(); }

error: redefinition of 'foo'
  int __attribute((target_version("sve"))) foo() { return 1; }

note: previous definition is here
  int __attribute((target_version("default"))) foo() { return 0; }

While fixing this I also found that in the absence of default version
declaration, the one we implicitly create has incorrect mangling if
we are in a namespace:

namespace OtherName {
int __attribute((target_version("sve"))) foo() { return 2; }
}

int baz() { return OtherName::foo(); }

In this example instead of creating a declaration for the symbol
@_ZN9OtherName3fooEv.default we are creating one for the symbol
@_Z3foov.default (the namespace mangling prefix is omitted).
This has now been fixed.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes the following bug:

namespace Name {
int __attribute((target_version("default"))) foo() { return 0; }
}

namespace Name {
int __attribute((target_version("sve"))) foo() { return 1; }
}

int bar() { return Name::foo(); }

error: redefinition of 'foo'
  int __attribute((target_version("sve"))) foo() { return 1; }

note: previous definition is here
  int __attribute((target_version("default"))) foo() { return 0; }

While fixing this I also found that in the absence of default version
declaration, the one we implicitly create has incorrect mangling if
we are in a namespace:

namespace OtherName {
int __attribute((target_version("sve"))) foo() { return 2; }
}

int baz() { return OtherName::foo(); }

In this example instead of creating a declaration for the symbol
@_ZN9OtherName3fooEv.default we are creating one for the symbol
@_Z3foov.default (the namespace mangling prefix is omitted).
This has now been fixed.</pre>
</div>
</content>
</entry>
<entry>
<title>[clang] Fix crash passing function pointer without prototype. (#90255)</title>
<updated>2024-05-21T18:51:21+00:00</updated>
<author>
<name>lolloz98</name>
<email>lorenzocarpaneto@yahoo.it</email>
</author>
<published>2024-05-21T18:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=67ae86d700b899979db39883f4063257513498d5'/>
<id>67ae86d700b899979db39883f4063257513498d5</id>
<content type='text'>
Fixes use-after-free iterating over the uses of the function.

Closes #88917 </content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes use-after-free iterating over the uses of the function.

Closes #88917 </pre>
</div>
</content>
</entry>
<entry>
<title>[Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (#88182)</title>
<updated>2024-05-19T13:59:03+00:00</updated>
<author>
<name>Alex Voicu</name>
<email>alexandru.voicu@amd.com</email>
</author>
<published>2024-05-19T13:59:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=10edb4991c12738e60843d55cd9edbf6d702d9eb'/>
<id>10edb4991c12738e60843d55cd9edbf6d702d9eb</id>
<content type='text'>
At the moment, Clang is rather liberal in assuming that 0 (and by extension unqualified) is always a safe default. This does not work for targets that actually use a different value for the default / generic AS (for example, the SPIRV that obtains from HIPSPV or SYCL). This patch is a first, fairly safe step towards trying to clear things up by querying a modules' default AS from the target, rather than assuming it's 0, alongside fixing a few places where things break / we encode the 0 == DefaultAS assumption. A bunch of existing tests are extended to check for non-zero default AS usage.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At the moment, Clang is rather liberal in assuming that 0 (and by extension unqualified) is always a safe default. This does not work for targets that actually use a different value for the default / generic AS (for example, the SPIRV that obtains from HIPSPV or SYCL). This patch is a first, fairly safe step towards trying to clear things up by querying a modules' default AS from the target, rather than assuming it's 0, alongside fixing a few places where things break / we encode the 0 == DefaultAS assumption. A bunch of existing tests are extended to check for non-zero default AS usage.</pre>
</div>
</content>
</entry>
</feed>
