Skip to content

Commit 65ddde4

Browse files
committed
Merge branch 'main' into vector_extract_strided_slice_distribution
2 parents 1f976be + 82cbd68 commit 65ddde4

File tree

118 files changed

+2957
-862
lines changed

Some content is hidden

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

118 files changed

+2957
-862
lines changed

clang/bindings/python/tests/cindex/test_file.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
inputs_dir = os.path.join(os.path.dirname(__file__), "INPUTS")
1111

12+
1213
class TestFile(unittest.TestCase):
1314
def test_file(self):
1415
index = Index.create()

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,5 +642,8 @@ TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_f16_f32, "V2hV2hfUiIb", "nc", "f32-to-f16
642642

643643
TARGET_BUILTIN(__builtin_amdgcn_s_setprio_inc_wg, "vIs", "n", "setprio-inc-wg-inst")
644644

645+
TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_f16_fp8, "V2hs", "nc", "gfx1250-insts")
646+
TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_f16_bf8, "V2hs", "nc", "gfx1250-insts")
647+
645648
#undef BUILTIN
646649
#undef TARGET_BUILTIN

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -159,92 +159,92 @@ struct MissingFeatures {
159159
static bool addressPointerAuthInfo() { return false; }
160160

161161
// Misc
162-
static bool cirgenABIInfo() { return false; }
163162
static bool abiArgInfo() { return false; }
164-
static bool tryEmitAsConstant() { return false; }
165-
static bool constructABIArgDirectExtend() { return false; }
166-
static bool opGlobalViewAttr() { return false; }
167-
static bool lowerModeOptLevel() { return false; }
168-
static bool opTBAA() { return false; }
169-
static bool objCLifetime() { return false; }
170-
static bool objCBlocks() { return false; }
171-
static bool emitNullabilityCheck() { return false; }
172-
static bool emitLValueAlignmentAssumption() { return false; }
173-
static bool emitLifetimeMarkers() { return false; }
174-
static bool astVarDeclInterface() { return false; }
175-
static bool stackSaveOp() { return false; }
163+
static bool addHeapAllocSiteMetadata() { return false; }
176164
static bool aggValueSlot() { return false; }
177-
static bool aggValueSlotMayOverlap() { return false; }
178-
static bool aggValueSlotVolatile() { return false; }
179-
static bool aggValueSlotDestructedFlag() { return false; }
180165
static bool aggValueSlotAlias() { return false; }
166+
static bool aggValueSlotDestructedFlag() { return false; }
181167
static bool aggValueSlotGC() { return false; }
182-
static bool generateDebugInfo() { return false; }
183-
static bool pointerOverflowSanitizer() { return false; }
184-
static bool fpConstraints() { return false; }
185-
static bool sanitizers() { return false; }
186-
static bool addHeapAllocSiteMetadata() { return false; }
187-
static bool targetCIRGenInfoArch() { return false; }
188-
static bool targetCIRGenInfoOS() { return false; }
189-
static bool targetCodeGenInfoGetNullPointer() { return false; }
190-
static bool loopInfoStack() { return false; }
191-
static bool requiresCleanups() { return false; }
192-
static bool createProfileWeightsForLoop() { return false; }
193-
static bool emitCondLikelihoodViaExpectIntrinsic() { return false; }
194-
static bool pgoUse() { return false; }
195-
static bool cgFPOptionsRAII() { return false; }
196-
static bool metaDataNode() { return false; }
197-
static bool fastMathFlags() { return false; }
168+
static bool aggValueSlotMayOverlap() { return false; }
169+
static bool aggValueSlotVolatile() { return false; }
198170
static bool alignCXXRecordDecl() { return false; }
199-
static bool setNonGC() { return false; }
200-
static bool incrementProfileCounter() { return false; }
201-
static bool insertBuiltinUnpredictable() { return false; }
202-
static bool objCGC() { return false; }
203-
static bool weakRefReference() { return false; }
204-
static bool hip() { return false; }
205-
static bool setObjCGCLValueClass() { return false; }
206-
static bool setDLLStorageClass() { return false; }
207-
static bool openMP() { return false; }
208-
static bool emitCheckedInBoundsGEP() { return false; }
209-
static bool preservedAccessIndexRegion() { return false; }
171+
static bool armComputeVolatileBitfields() { return false; }
172+
static bool asmLabelAttr() { return false; }
173+
static bool astVarDeclInterface() { return false; }
174+
static bool attributeNoBuiltin() { return false; }
210175
static bool bitfields() { return false; }
211-
static bool msabi() { return false; }
212-
static bool typeChecks() { return false; }
213-
static bool lambdaFieldToName() { return false; }
214-
static bool moduleNameHash() { return false; }
215-
static bool constantFoldSwitchStatement() { return false; }
216-
static bool cudaSupport() { return false; }
217-
static bool maybeHandleStaticInExternC() { return false; }
176+
static bool builtinCall() { return false; }
177+
static bool builtinCallF128() { return false; }
178+
static bool builtinCallMathErrno() { return false; }
179+
static bool cgFPOptionsRAII() { return false; }
180+
static bool cirgenABIInfo() { return false; }
181+
static bool cleanupAfterErrorDiags() { return false; }
182+
static bool cleanupsToDeactivate() { return false; }
218183
static bool constEmitterArrayILE() { return false; }
219184
static bool constEmitterVectorILE() { return false; }
220-
static bool needsGlobalCtorDtor() { return false; }
221-
static bool emitTypeCheck() { return false; }
222-
static bool writebacks() { return false; }
223-
static bool cleanupsToDeactivate() { return false; }
224-
static bool stackBase() { return false; }
225-
static bool deferredCXXGlobalInit() { return false; }
226-
static bool setTargetAttributes() { return false; }
185+
static bool constantFoldSwitchStatement() { return false; }
186+
static bool constructABIArgDirectExtend() { return false; }
227187
static bool coverageMapping() { return false; }
228-
static bool peepholeProtection() { return false; }
229-
static bool instrumentation() { return false; }
230-
static bool cleanupAfterErrorDiags() { return false; }
188+
static bool createProfileWeightsForLoop() { return false; }
189+
static bool ctorMemcpyizer() { return false; }
190+
static bool cudaSupport() { return false; }
231191
static bool cxxRecordStaticMembers() { return false; }
232-
static bool isMemcpyEquivalentSpecialMember() { return false; }
233-
static bool isTrivialCtorOrDtor() { return false; }
192+
static bool dataLayoutTypeAllocSize() { return false; }
193+
static bool deferredCXXGlobalInit() { return false; }
194+
static bool emitCheckedInBoundsGEP() { return false; }
195+
static bool emitCondLikelihoodViaExpectIntrinsic() { return false; }
196+
static bool emitLifetimeMarkers() { return false; }
197+
static bool emitLValueAlignmentAssumption() { return false; }
198+
static bool emitNullabilityCheck() { return false; }
199+
static bool emitTypeCheck() { return false; }
200+
static bool fastMathFlags() { return false; }
201+
static bool fpConstraints() { return false; }
202+
static bool generateDebugInfo() { return false; }
203+
static bool hip() { return false; }
234204
static bool implicitConstructorArgs() { return false; }
205+
static bool incrementProfileCounter() { return false; }
206+
static bool insertBuiltinUnpredictable() { return false; }
207+
static bool instrumentation() { return false; }
235208
static bool intrinsics() { return false; }
236-
static bool attributeNoBuiltin() { return false; }
237-
static bool thunks() { return false; }
238-
static bool runCleanupsScope() { return false; }
209+
static bool isMemcpyEquivalentSpecialMember() { return false; }
210+
static bool isTrivialCtorOrDtor() { return false; }
211+
static bool lambdaFieldToName() { return false; }
212+
static bool loopInfoStack() { return false; }
239213
static bool lowerAggregateLoadStore() { return false; }
240-
static bool dataLayoutTypeAllocSize() { return false; }
241-
static bool asmLabelAttr() { return false; }
242-
static bool builtinCall() { return false; }
243-
static bool builtinCallF128() { return false; }
244-
static bool builtinCallMathErrno() { return false; }
214+
static bool lowerModeOptLevel() { return false; }
215+
static bool maybeHandleStaticInExternC() { return false; }
216+
static bool metaDataNode() { return false; }
217+
static bool moduleNameHash() { return false; }
218+
static bool msabi() { return false; }
219+
static bool needsGlobalCtorDtor() { return false; }
245220
static bool nonFineGrainedBitfields() { return false; }
246-
static bool armComputeVolatileBitfields() { return false; }
247-
static bool ctorMemcpyizer() { return false; }
221+
static bool objCBlocks() { return false; }
222+
static bool objCGC() { return false; }
223+
static bool objCLifetime() { return false; }
224+
static bool openMP() { return false; }
225+
static bool opGlobalViewAttr() { return false; }
226+
static bool opTBAA() { return false; }
227+
static bool peepholeProtection() { return false; }
228+
static bool pgoUse() { return false; }
229+
static bool pointerOverflowSanitizer() { return false; }
230+
static bool preservedAccessIndexRegion() { return false; }
231+
static bool requiresCleanups() { return false; }
232+
static bool runCleanupsScope() { return false; }
233+
static bool sanitizers() { return false; }
234+
static bool setDLLStorageClass() { return false; }
235+
static bool setNonGC() { return false; }
236+
static bool setObjCGCLValueClass() { return false; }
237+
static bool setTargetAttributes() { return false; }
238+
static bool stackBase() { return false; }
239+
static bool stackSaveOp() { return false; }
240+
static bool targetCIRGenInfoArch() { return false; }
241+
static bool targetCIRGenInfoOS() { return false; }
242+
static bool targetCodeGenInfoGetNullPointer() { return false; }
243+
static bool thunks() { return false; }
244+
static bool tryEmitAsConstant() { return false; }
245+
static bool typeChecks() { return false; }
246+
static bool weakRefReference() { return false; }
247+
static bool writebacks() { return false; }
248248

249249
// Missing types
250250
static bool dataMemberType() { return false; }

clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -614,14 +614,6 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd, cir::RecordType *ty) {
614614
}
615615
}
616616

617-
if (llvm::isa<CXXRecordDecl>(rd) && !rd->isUnion() &&
618-
!rd->hasAttr<FinalAttr>()) {
619-
if (lowering.astRecordLayout.getNonVirtualSize() !=
620-
lowering.astRecordLayout.getSize()) {
621-
cgm.errorNYI(rd->getSourceRange(), "computeRecordLayout: CXXRecordDecl");
622-
}
623-
}
624-
625617
// Fill in the record *after* computing the base type. Filling in the body
626618
// signifies that the type is no longer opaque and record layout is complete,
627619
// but we may need to recursively layout rd while laying D out as a base type.

clang/test/CodeGenOpenCL/builtins-amdgcn-gfx1250.cl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -triple amdgcn-unknown-unknown -target-cpu gfx1250 -emit-llvm -o - %s | FileCheck %s
33
// REQUIRES: amdgpu-registered-target
44

5+
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
6+
7+
typedef half __attribute__((ext_vector_type(2))) half2;
8+
59
// CHECK-LABEL: @test_setprio_inc_wg(
610
// CHECK-NEXT: entry:
711
// CHECK-NEXT: call void @llvm.amdgcn.s.setprio.inc.wg(i16 10)
@@ -10,3 +14,43 @@
1014
void test_setprio_inc_wg() {
1115
__builtin_amdgcn_s_setprio_inc_wg(10);
1216
}
17+
18+
// CHECK-LABEL: @test_cvt_pk_f16_fp8(
19+
// CHECK-NEXT: entry:
20+
// CHECK-NEXT: [[OUT_ADDR:%.*]] = alloca ptr addrspace(1), align 8, addrspace(5)
21+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i16, align 2, addrspace(5)
22+
// CHECK-NEXT: [[OUT_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[OUT_ADDR]] to ptr
23+
// CHECK-NEXT: [[A_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[A_ADDR]] to ptr
24+
// CHECK-NEXT: store ptr addrspace(1) [[OUT:%.*]], ptr [[OUT_ADDR_ASCAST]], align 8
25+
// CHECK-NEXT: store i16 [[A:%.*]], ptr [[A_ADDR_ASCAST]], align 2
26+
// CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A_ADDR_ASCAST]], align 2
27+
// CHECK-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.amdgcn.cvt.pk.f16.fp8(i16 [[TMP0]])
28+
// CHECK-NEXT: [[TMP2:%.*]] = load ptr addrspace(1), ptr [[OUT_ADDR_ASCAST]], align 8
29+
// CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds <2 x half>, ptr addrspace(1) [[TMP2]], i64 0
30+
// CHECK-NEXT: store <2 x half> [[TMP1]], ptr addrspace(1) [[ARRAYIDX]], align 4
31+
// CHECK-NEXT: ret void
32+
//
33+
void test_cvt_pk_f16_fp8(global half2* out, short a)
34+
{
35+
out[0] = __builtin_amdgcn_cvt_pk_f16_fp8(a);
36+
}
37+
38+
// CHECK-LABEL: @test_cvt_pk_f16_bf8(
39+
// CHECK-NEXT: entry:
40+
// CHECK-NEXT: [[OUT_ADDR:%.*]] = alloca ptr addrspace(1), align 8, addrspace(5)
41+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i16, align 2, addrspace(5)
42+
// CHECK-NEXT: [[OUT_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[OUT_ADDR]] to ptr
43+
// CHECK-NEXT: [[A_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[A_ADDR]] to ptr
44+
// CHECK-NEXT: store ptr addrspace(1) [[OUT:%.*]], ptr [[OUT_ADDR_ASCAST]], align 8
45+
// CHECK-NEXT: store i16 [[A:%.*]], ptr [[A_ADDR_ASCAST]], align 2
46+
// CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr [[A_ADDR_ASCAST]], align 2
47+
// CHECK-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.amdgcn.cvt.pk.f16.bf8(i16 [[TMP0]])
48+
// CHECK-NEXT: [[TMP2:%.*]] = load ptr addrspace(1), ptr [[OUT_ADDR_ASCAST]], align 8
49+
// CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds <2 x half>, ptr addrspace(1) [[TMP2]], i64 0
50+
// CHECK-NEXT: store <2 x half> [[TMP1]], ptr addrspace(1) [[ARRAYIDX]], align 4
51+
// CHECK-NEXT: ret void
52+
//
53+
void test_cvt_pk_f16_bf8(global half2* out, short a)
54+
{
55+
out[0] = __builtin_amdgcn_cvt_pk_f16_bf8(a);
56+
}

clang/test/Driver/print-supported-extensions-riscv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
// CHECK-NEXT: xsfmmbase 0.6 'XSfmmbase' (All non arithmetic instructions for all TEWs and sf.vtzero)
185185
// CHECK-NEXT: xsfvcp 1.0 'XSfvcp' (SiFive Custom Vector Coprocessor Interface Instructions)
186186
// CHECK-NEXT: xsfvfnrclipxfqf 1.0 'XSfvfnrclipxfqf' (SiFive FP32-to-int8 Ranged Clip Instructions)
187-
// CHECK-NEXT: xsfvfwmaccqqq 1.0 'XSfvfwmaccqqq' (SiFive Matrix Multiply Accumulate Instruction and 4-by-4))
187+
// CHECK-NEXT: xsfvfwmaccqqq 1.0 'XSfvfwmaccqqq' (SiFive Matrix Multiply Accumulate Instruction (4-by-4))
188188
// CHECK-NEXT: xsfvqmaccdod 1.0 'XSfvqmaccdod' (SiFive Int8 Matrix Multiplication Instructions (2-by-8 and 8-by-2))
189189
// CHECK-NEXT: xsfvqmaccqoq 1.0 'XSfvqmaccqoq' (SiFive Int8 Matrix Multiplication Instructions (4-by-8 and 8-by-4))
190190
// CHECK-NEXT: xsifivecdiscarddlone 1.0 'XSiFivecdiscarddlone' (SiFive sf.cdiscard.d.l1 Instruction)

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,7 @@ if(LLVM_LIBC_FULL_BUILD)
12511251
libc.src.wchar.mbrtowc
12521252
libc.src.wchar.mbtowc
12531253
libc.src.wchar.wcrtomb
1254+
libc.src.wchar.wctomb
12541255
)
12551256
endif()
12561257

libc/include/wchar.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ functions:
175175
- type: char *__restrict
176176
- type: wchar_t
177177
- type: mbstate_t *__restrict
178+
- name: wctomb
179+
standards:
180+
- stdc
181+
return_type: int
182+
arguments:
183+
- type: char *
184+
- type: wchar_t
178185
- name: wcscpy
179186
standards:
180187
- stdc

libc/src/__support/wchar/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ add_object_library(
2727
SRCS
2828
wcrtomb.cpp
2929
DEPENDS
30+
libc.hdr.errno_macros
3031
libc.hdr.types.char32_t
3132
libc.hdr.types.size_t
3233
libc.hdr.types.wchar_t
@@ -43,6 +44,7 @@ add_object_library(
4344
SRCS
4445
mbrtowc.cpp
4546
DEPENDS
47+
libc.hdr.errno_macros
4648
libc.hdr.types.wchar_t
4749
libc.hdr.types.size_t
4850
libc.src.__support.common

libc/src/__support/wchar/mbrtowc.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/__support/wchar/mbrtowc.h"
10+
#include "hdr/errno_macros.h"
1011
#include "hdr/types/mbstate_t.h"
1112
#include "hdr/types/size_t.h"
1213
#include "hdr/types/wchar_t.h"
@@ -22,6 +23,8 @@ namespace internal {
2223
ErrorOr<size_t> mbrtowc(wchar_t *__restrict pwc, const char *__restrict s,
2324
size_t n, mbstate *__restrict ps) {
2425
CharacterConverter char_conv(ps);
26+
if (!char_conv.isValidState())
27+
return Error(EINVAL);
2528
if (s == nullptr)
2629
return 0;
2730
size_t i = 0;
@@ -30,7 +33,7 @@ ErrorOr<size_t> mbrtowc(wchar_t *__restrict pwc, const char *__restrict s,
3033
int err = char_conv.push(static_cast<char8_t>(s[i]));
3134
// Encoding error
3235
if (err == -1)
33-
return Error(-1);
36+
return Error(EILSEQ);
3437
}
3538
auto wc = char_conv.pop_utf32();
3639
if (wc.has_value()) {

0 commit comments

Comments
 (0)