Skip to content

Commit 7be0dd2

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:52770d83bf00fc56e9496e32f083f0f940bf7315 into amd-gfx:a59cc49ff7ab
Local branch amd-gfx a59cc49 Merged main:fdb87640ee2be63af9b0e0cd943cb13d79686a03 into amd-gfx:1a07563b1c04 Remote branch main 52770d8 [Serialization] Dont pack bits for the function scope index of ParmVarDecl
2 parents a59cc49 + 52770d8 commit 7be0dd2

File tree

12 files changed

+90
-21
lines changed

12 files changed

+90
-21
lines changed

clang/lib/Sema/SemaModule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc,
529529
if (!Mod)
530530
return true;
531531

532-
if (!Mod->isInterfaceOrPartition() && !ModuleName.empty()) {
532+
if (!Mod->isInterfaceOrPartition() && !ModuleName.empty() &&
533+
!getLangOpts().ObjC) {
533534
Diag(ImportLoc, diag::err_module_import_non_interface_nor_parition)
534535
<< ModuleName;
535536
return true;

clang/lib/Serialization/ASTReaderDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,10 +1706,10 @@ void ASTDeclReader::VisitImplicitParamDecl(ImplicitParamDecl *PD) {
17061706
void ASTDeclReader::VisitParmVarDecl(ParmVarDecl *PD) {
17071707
VisitVarDecl(PD);
17081708

1709+
unsigned scopeIndex = Record.readInt();
17091710
BitsUnpacker ParmVarDeclBits(Record.readInt());
17101711
unsigned isObjCMethodParam = ParmVarDeclBits.getNextBit();
17111712
unsigned scopeDepth = ParmVarDeclBits.getNextBits(/*Width=*/7);
1712-
unsigned scopeIndex = ParmVarDeclBits.getNextBits(/*Width=*/8);
17131713
unsigned declQualifier = ParmVarDeclBits.getNextBits(/*Width=*/7);
17141714
if (isObjCMethodParam) {
17151715
assert(scopeDepth == 0);

clang/lib/Serialization/ASTWriterDecl.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,10 +1163,14 @@ void ASTDeclWriter::VisitImplicitParamDecl(ImplicitParamDecl *D) {
11631163
void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) {
11641164
VisitVarDecl(D);
11651165

1166+
// See the implementation of `ParmVarDecl::getParameterIndex()`, which may
1167+
// exceed the size of the normal bitfield. So it may be better to not pack
1168+
// these bits.
1169+
Record.push_back(D->getFunctionScopeIndex());
1170+
11661171
BitsPacker ParmVarDeclBits;
11671172
ParmVarDeclBits.addBit(D->isObjCMethodParameter());
11681173
ParmVarDeclBits.addBits(D->getFunctionScopeDepth(), /*BitsWidth=*/7);
1169-
ParmVarDeclBits.addBits(D->getFunctionScopeIndex(), /*BitsWidth=*/8);
11701174
// FIXME: stable encoding
11711175
ParmVarDeclBits.addBits(D->getObjCDeclQualifier(), /*BitsWidth=*/7);
11721176
ParmVarDeclBits.addBit(D->isKNRPromoted());
@@ -2350,10 +2354,11 @@ void ASTWriter::WriteDeclAbbrevs() {
23502354
// isARCPseudoStrong, Linkage, ModulesCodegen
23512355
Abv->Add(BitCodeAbbrevOp(0)); // VarKind (local enum)
23522356
// ParmVarDecl
2357+
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // ScopeIndex
23532358
Abv->Add(BitCodeAbbrevOp(
23542359
BitCodeAbbrevOp::Fixed,
2355-
27)); // Packed Parm Var Decl bits: IsObjCMethodParameter, ScopeDepth,
2356-
// ScopeIndex, ObjCDeclQualifier, KNRPromoted,
2360+
19)); // Packed Parm Var Decl bits: IsObjCMethodParameter, ScopeDepth,
2361+
// ObjCDeclQualifier, KNRPromoted,
23572362
// HasInheritedDefaultArg, HasUninstantiatedDefaultArg
23582363
// Type Source Info
23592364
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));

clang/test/Modules/pr64755.cppm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fmodule-file=a0=%t/a0.pcm -verify -fsyntax-only
88
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fprebuilt-module-path=%t -verify -fsyntax-only
99

10+
// RUN: %clang_cc1 -std=c++20 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%t -fmodule-name=a0 -x objective-c++ -emit-module %t/module.modulemap -o %t/a0.pcm
11+
// RUN: %clang_cc1 -std=c++20 -x objective-c++ %t/use_obj.cpp -fmodule-file=%t/a0.pcm -verify -fsyntax-only
12+
// RUN: %clang_cc1 -std=c++20 -x objective-c++ %t/use_obj.cpp -fmodule-file=a0=%t/a0.pcm -verify -fsyntax-only
13+
// RUN: %clang_cc1 -std=c++20 -x objective-c++ %t/use_obj.cpp -fprebuilt-module-path=%t -verify -fsyntax-only
14+
1015
//--- module.modulemap
1116
module a0 { header "a0.h" export * }
1217

@@ -15,3 +20,7 @@ void a0() {}
1520

1621
//--- use.cpp
1722
import a0; // expected-error {{import of module 'a0' imported non C++20 importable modules}}
23+
24+
//--- use_obj.cpp
25+
// expected-no-diagnostics
26+
@import a0;

clang/test/PCH/pr76443.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: rm -rf %t
2+
// RUN: mkdir -p %t
3+
//
4+
// RUN: %clang_cc1 -std=c++17 -emit-pch %s -o %t/h.pcm
5+
6+
//--- header.h
7+
template <int... Nx> int stringData(const char (&...x)[Nx]) {
8+
return 0;
9+
}
10+
int qt_meta_stringdata_CLASSQStyleENDCLASS = stringData(
11+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
12+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
13+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
14+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
15+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
16+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
17+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
18+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
19+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
20+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
21+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
22+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
23+
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
24+
"", "", "", "", "", "", "", "", "", "");

clang/test/Preprocessor/predefined-arch-macros.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,7 +2515,7 @@
25152515
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SRF_M32
25162516
// RUN: %clang -march=grandridge -m32 -E -dM %s -o - 2>&1 \
25172517
// RUN: --target=i386 \
2518-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32,CHECK_GRR_M32
2518+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M32
25192519
// RUN: %clang -march=arrowlake -m32 -E -dM %s -o - 2>&1 \
25202520
// RUN: -target i386-unknown-linux \
25212521
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SRF_M32
@@ -2572,7 +2572,6 @@
25722572
// CHECK_SRF_M32: #define __PRFCHW__ 1
25732573
// CHECK_SRF_M32: #define __PTWRITE__ 1
25742574
// CHECK_SRF_M32-NOT: #define __RAOINT__ 1
2575-
// CHECK_GRR_M32: #define __RAOINT__ 1
25762575
// CHECK_SRF_M32: #define __RDPID__ 1
25772576
// CHECK_SRF_M32: #define __RDRND__ 1
25782577
// CHECK_SRF_M32: #define __RDSEED__ 1
@@ -2618,7 +2617,7 @@
26182617
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SRF_M64
26192618
// RUN: %clang -march=grandridge -m64 -E -dM %s -o - 2>&1 \
26202619
// RUN: --target=i386 \
2621-
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M64,CHECK_GRR_M64
2620+
// RUN: | FileCheck -match-full-lines %s -check-prefixes=CHECK_SRF_M64
26222621
// RUN: %clang -march=arrowlake -m64 -E -dM %s -o - 2>&1 \
26232622
// RUN: -target i386-unknown-linux \
26242623
// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SRF_M64
@@ -2675,7 +2674,6 @@
26752674
// CHECK_SRF_M64: #define __PRFCHW__ 1
26762675
// CHECK_SRF_M64: #define __PTWRITE__ 1
26772676
// CHECK_SRF_M64-NOT: #define __RAOINT__ 1
2678-
// CHECK_GRR_M64: #define __RAOINT__ 1
26792677
// CHECK_SRF_M64: #define __RDPID__ 1
26802678
// CHECK_SRF_M64: #define __RDRND__ 1
26812679
// CHECK_SRF_M64: #define __RDSEED__ 1

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 484821
19+
#define LLVM_MAIN_REVISION 484825
2020

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

llvm/lib/Target/X86/X86.td

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,6 @@ def ProcessorFeatures {
12561256
list<SubtargetFeature> SRFFeatures =
12571257
!listconcat(ADLFeatures, SRFAdditionalFeatures);
12581258

1259-
// Grandridge
1260-
list<SubtargetFeature> GRRAdditionalFeatures = [FeatureRAOINT];
1261-
list<SubtargetFeature> GRRFeatures =
1262-
!listconcat(SRFFeatures, GRRAdditionalFeatures);
1263-
12641259
// Arrowlake S
12651260
list<SubtargetFeature> ARLSAdditionalFeatures = [FeatureAVXVNNIINT16,
12661261
FeatureSHA512,
@@ -1706,10 +1701,10 @@ foreach P = ["goldmont_plus", "goldmont-plus"] in {
17061701
}
17071702
def : ProcModel<"tremont", SLMModel, ProcessorFeatures.TRMFeatures,
17081703
ProcessorFeatures.TRMTuning>;
1709-
def : ProcModel<"sierraforest", AlderlakePModel, ProcessorFeatures.SRFFeatures,
1710-
ProcessorFeatures.TRMTuning>;
1711-
def : ProcModel<"grandridge", AlderlakePModel, ProcessorFeatures.GRRFeatures,
1704+
foreach P = ["sierraforest", "grandridge"] in {
1705+
def : ProcModel<P, AlderlakePModel, ProcessorFeatures.SRFFeatures,
17121706
ProcessorFeatures.TRMTuning>;
1707+
}
17131708

17141709
// "Arrandale" along with corei3 and corei5
17151710
foreach P = ["nehalem", "corei7", "core_i7_sse4_2"] in {

llvm/lib/Target/X86/X86InstrAVX512.td

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,17 @@ def : Pat<(vselect_mask VK8WM:$mask,
14471447
(VBROADCASTI32X4Z256rmk VR256X:$src0, VK8WM:$mask, addr:$src)>;
14481448
}
14491449

1450+
let Predicates = [HasBF16] in {
1451+
def : Pat<(v32bf16 (X86SubVBroadcastld256 addr:$src)),
1452+
(VBROADCASTF64X4rm addr:$src)>;
1453+
def : Pat<(v32bf16 (X86SubVBroadcastld128 addr:$src)),
1454+
(VBROADCASTF32X4rm addr:$src)>;
1455+
}
1456+
1457+
let Predicates = [HasBF16, HasVLX] in
1458+
def : Pat<(v16bf16 (X86SubVBroadcastld128 addr:$src)),
1459+
(VBROADCASTF32X4Z256rm addr:$src)>;
1460+
14501461
let Predicates = [HasVLX, HasDQI] in {
14511462
defm VBROADCASTI64X2Z128 : avx512_subvec_broadcast_rm_dq<0x5a, "vbroadcasti64x2",
14521463
X86SubVBroadcastld128, v4i64x_info, v2i64x_info>, VEX_W1X,

llvm/lib/Target/X86/X86InstrSSE.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7160,6 +7160,10 @@ def : Pat<(v32i8 (X86SubVBroadcastld128 addr:$src)),
71607160
(VBROADCASTF128rm addr:$src)>;
71617161
}
71627162

7163+
let Predicates = [HasAVXNECONVERT, NoVLX] in
7164+
def : Pat<(v16bf16 (X86SubVBroadcastld128 addr:$src)),
7165+
(VBROADCASTF128rm addr:$src)>;
7166+
71637167
//===----------------------------------------------------------------------===//
71647168
// VPERM2F128 - Permute Floating-Point Values in 128-bit chunks
71657169
//

llvm/lib/TargetParser/X86TargetParser.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ constexpr FeatureBitset FeaturesAlderlake =
162162
constexpr FeatureBitset FeaturesSierraforest =
163163
FeaturesAlderlake | FeatureCMPCCXADD | FeatureAVXIFMA | FeatureUINTR |
164164
FeatureENQCMD | FeatureAVXNECONVERT | FeatureAVXVNNIINT8;
165-
constexpr FeatureBitset FeaturesGrandridge =
166-
FeaturesSierraforest | FeatureRAOINT;
167165
constexpr FeatureBitset FeaturesArrowlakeS = FeaturesSierraforest |
168166
FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 | FeatureSM4;
169167
constexpr FeatureBitset FeaturesPantherlake =
@@ -369,7 +367,7 @@ constexpr ProcInfo Processors[] = {
369367
// Sierraforest microarchitecture based processors.
370368
{ {"sierraforest"}, CK_Sierraforest, FEATURE_AVX2, FeaturesSierraforest, 'p', false },
371369
// Grandridge microarchitecture based processors.
372-
{ {"grandridge"}, CK_Grandridge, FEATURE_AVX2, FeaturesGrandridge, 'p', false },
370+
{ {"grandridge"}, CK_Grandridge, FEATURE_AVX2, FeaturesSierraforest, 'p', false },
373371
// Granite Rapids microarchitecture based processors.
374372
{ {"graniterapids"}, CK_Graniterapids, FEATURE_AVX512BF16, FeaturesGraniteRapids, 'n', false },
375373
// Granite Rapids D microarchitecture based processors.

llvm/test/CodeGen/X86/bfloat.ll

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,3 +2461,27 @@ define <8 x bfloat> @fptrunc_v8f64(<8 x double> %a) nounwind {
24612461
%b = fptrunc <8 x double> %a to <8 x bfloat>
24622462
ret <8 x bfloat> %b
24632463
}
2464+
2465+
define <32 x bfloat> @test_v8bf16_v32bf16(ptr %0) {
2466+
; SSE2-LABEL: test_v8bf16_v32bf16:
2467+
; SSE2: # %bb.0:
2468+
; SSE2-NEXT: movaps (%rdi), %xmm0
2469+
; SSE2-NEXT: movaps %xmm0, %xmm1
2470+
; SSE2-NEXT: movaps %xmm0, %xmm2
2471+
; SSE2-NEXT: movaps %xmm0, %xmm3
2472+
; SSE2-NEXT: retq
2473+
;
2474+
; F16-LABEL: test_v8bf16_v32bf16:
2475+
; F16: # %bb.0:
2476+
; F16-NEXT: vbroadcastf32x4 {{.*#+}} zmm0 = mem[0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]
2477+
; F16-NEXT: retq
2478+
;
2479+
; AVXNC-LABEL: test_v8bf16_v32bf16:
2480+
; AVXNC: # %bb.0:
2481+
; AVXNC-NEXT: vbroadcastf128 {{.*#+}} ymm0 = mem[0,1,0,1]
2482+
; AVXNC-NEXT: vmovaps %ymm0, %ymm1
2483+
; AVXNC-NEXT: retq
2484+
%2 = load <8 x bfloat>, ptr %0, align 16
2485+
%3 = shufflevector <8 x bfloat> %2, <8 x bfloat> %2, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
2486+
ret <32 x bfloat> %3
2487+
}

0 commit comments

Comments
 (0)