Skip to content

Commit 1440af0

Browse files
committed
Merge main into amd-gfx
This includes a cherry-pick of llvm#110650 This includes a cherry-pick of llvm#110818 Change-Id: I95b223ab1eb575465d96502b2cf69b95f994ad8a
2 parents 59557e5 + c897c13 commit 1440af0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1581
-488
lines changed

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,9 @@ bool Compiler<Emitter>::VisitFixedPointLiteral(const FixedPointLiteral *E) {
763763
assert(E->getType()->isFixedPointType());
764764
assert(classifyPrim(E) == PT_FixedPoint);
765765

766+
if (DiscardResult)
767+
return true;
768+
766769
auto Sem = Ctx.getASTContext().getFixedPointSemantics(E->getType());
767770
APInt Value = E->getValue();
768771
return this->emitConstFixedPoint(FixedPoint(Value, Sem), E);

clang/test/AST/ByteCode/fixed-point.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ static_assert(1.0k != 1.0k); // both-error {{failed due to requirement '1.0k !=
1111
static_assert(1.0k != 1); // both-error {{failed due to requirement '1.0k != 1'}}
1212
static_assert(-12.0k == -(-(-12.0k)));
1313

14+
constexpr _Accum acc = (0.5r, 6.9k);
15+
1416
/// Zero-init.
1517
constexpr _Accum A{};
1618
static_assert(A == 0.0k);

clang/test/Frontend/amdgcn-machine-analysis-remarks.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -target-cpu gfx908 -Rpass-analysis=kernel-resource-usage -S -O0 -verify %s -o /dev/null
33

44
// expected-remark@+10 {{Function Name: foo}}
5-
// expected-remark@+9 {{ SGPRs: 13}}
5+
// expected-remark@+9 {{ TotalSGPRs: 13}}
66
// expected-remark@+8 {{ VGPRs: 10}}
77
// expected-remark@+7 {{ AGPRs: 12}}
88
// expected-remark@+6 {{ ScratchSize [bytes/lane]: 0}}

clang/test/Frontend/fixed_point_crash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 -verify -ffixed-point %s
2+
// RUN: %clang_cc1 -verify -ffixed-point %s -fexperimental-new-constant-interpreter
23

34
union a {
45
_Accum x;

llvm/docs/AMDGPUUsage.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,55 @@ As part of the AMDGPU MC layer, AMDGPU provides the following target specific
17571757

17581758
=================== ================= ========================================================
17591759

1760+
Function Resource Usage
1761+
-----------------------
1762+
1763+
A function's resource usage depends on each of its callees' resource usage. The
1764+
expressions used to denote resource usage reflect this by propagating each
1765+
callees' equivalent expressions. Said expressions are emitted as symbols by the
1766+
compiler when compiling to either assembly or object format and should not be
1767+
overwritten or redefined.
1768+
1769+
The following describes all emitted function resource usage symbols:
1770+
1771+
.. table:: Function Resource Usage:
1772+
:name: function-usage-table
1773+
1774+
===================================== ========= ========================================= ===============================================================================
1775+
Symbol Type Description Example
1776+
===================================== ========= ========================================= ===============================================================================
1777+
<function_name>.num_vgpr Integer Number of VGPRs used by <function_name>, .set foo.num_vgpr, max(32, bar.num_vgpr, baz.num_vgpr)
1778+
worst case of itself and its callees'
1779+
VGPR use
1780+
<function_name>.num_agpr Integer Number of AGPRs used by <function_name>, .set foo.num_agpr, max(35, bar.num_agpr)
1781+
worst case of itself and its callees'
1782+
AGPR use
1783+
<function_name>.numbered_sgpr Integer Number of SGPRs used by <function_name>, .set foo.num_sgpr, 21
1784+
worst case of itself and its callees'
1785+
SGPR use (without any of the implicitly
1786+
used SGPRs)
1787+
<function_name>.private_seg_size Integer Total stack size required for .set foo.private_seg_size, 16+max(bar.private_seg_size, baz.private_seg_size)
1788+
<function_name>, expression is the
1789+
locally used stack size + the worst case
1790+
callee
1791+
<function_name>.uses_vcc Bool Whether <function_name>, or any of its .set foo.uses_vcc, or(0, bar.uses_vcc)
1792+
callees, uses vcc
1793+
<function_name>.uses_flat_scratch Bool Whether <function_name>, or any of its .set foo.uses_flat_scratch, 1
1794+
callees, uses flat scratch or not
1795+
<function_name>.has_dyn_sized_stack Bool Whether <function_name>, or any of its .set foo.has_dyn_sized_stack, 1
1796+
callees, is dynamically sized
1797+
<function_name>.has_recursion Bool Whether <function_name>, or any of its .set foo.has_recursion, 0
1798+
callees, contains recursion
1799+
<function_name>.has_indirect_call Bool Whether <function_name>, or any of its .set foo.has_indirect_call, max(0, bar.has_indirect_call)
1800+
callees, contains an indirect call
1801+
===================================== ========= ========================================= ===============================================================================
1802+
1803+
Futhermore, three symbols are additionally emitted describing the compilation
1804+
unit's worst case (i.e, maxima) ``num_vgpr``, ``num_agpr``, and
1805+
``numbered_sgpr`` which may be referenced and used by the aforementioned
1806+
symbolic expressions. These three symbols are ``amdgcn.max_num_vgpr``,
1807+
``amdgcn.max_num_agpr``, and ``amdgcn.max_num_sgpr``.
1808+
17601809
.. _amdgpu-elf-code-object:
17611810

17621811
ELF Code Object

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 513453
19+
#define LLVM_MAIN_REVISION 513455
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

0 commit comments

Comments
 (0)