Commit 889c42b
committed
[CodeGen] Do not emit call site attributes for LLVM intrinsics.
When a function is declared with the `asm(...)` attribute to change the
mangled name to reference a LLVM intrinsic, the AST->IR translation for
the function declaration already skips any function/parameter attribute
that is either deduced from the AST function declaration or implied by
language options/target properties. Instead the attributes associated
to the LLVM intrinsic function are being generated.
When emitting calls to such function declarations, however, call site
attributes are emitted based on the AST function declaration or language
options/target properties.
This can lead to undesired outcomes, e.g. the call site of a LLVM
intrinsic marked `convergent` when the language options implies
`convergent` by default.
This commit fixes the call lowering logic to ignore all attributes in
the case the generate call instruction is an intrinsic call, such that
the only attributes from the intrinsic declaration will be implicitly
considered.1 parent 1eaa179 commit 889c42b
File tree
3 files changed
+22
-3
lines changed- clang
- lib/CodeGen
- test
- CodeGenCUDA
- CodeGen
3 files changed
+22
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5793 | 5793 | | |
5794 | 5794 | | |
5795 | 5795 | | |
5796 | | - | |
5797 | | - | |
| 5796 | + | |
| 5797 | + | |
| 5798 | + | |
| 5799 | + | |
| 5800 | + | |
| 5801 | + | |
| 5802 | + | |
| 5803 | + | |
5798 | 5804 | | |
5799 | 5805 | | |
5800 | 5806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments