Skip to content

Commit b32bd82

Browse files
committed
Merge branch 'main' into sg_distr_minor_fixes
2 parents b52a038 + 70046cd commit b32bd82

File tree

121 files changed

+1917
-132
lines changed

Some content is hidden

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

121 files changed

+1917
-132
lines changed

.github/new-prs-labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ mlgo:
717717
- llvm/lib/Analysis/IR2Vec.cpp
718718
- llvm/lib/Analysis/models/**
719719
- llvm/test/Analysis/IR2Vec/**
720+
- llvm/tools/llvm-ir2vec/**
720721

721722
tools:llvm-exegesis:
722723
- llvm/tools/llvm-exegesis/**

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ TARGET_BUILTIN(__builtin_amdgcn_s_monitor_sleep, "vIs", "n", "gfx1250-insts")
669669
TARGET_BUILTIN(__builtin_amdgcn_s_wait_asynccnt, "vIUs", "n", "gfx1250-insts")
670670
TARGET_BUILTIN(__builtin_amdgcn_s_wait_tensorcnt, "vIUs", "n", "gfx1250-insts")
671671

672+
TARGET_BUILTIN(__builtin_amdgcn_tanhf, "ff", "nc", "tanh-insts")
672673
TARGET_BUILTIN(__builtin_amdgcn_tanh_bf16, "yy", "nc", "bf16-trans-insts")
673674
TARGET_BUILTIN(__builtin_amdgcn_rcp_bf16, "yy", "nc", "bf16-trans-insts")
674675
TARGET_BUILTIN(__builtin_amdgcn_rsq_bf16, "yy", "nc", "bf16-trans-insts")

clang/lib/AST/ExprConstant.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4450,7 +4450,8 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E,
44504450
}
44514451
} else if (!IsAccess) {
44524452
return CompleteObject(LVal.getLValueBase(), nullptr, BaseType);
4453-
} else if (IsConstant && Info.checkingPotentialConstantExpression() &&
4453+
} else if ((IsConstant || BaseType->isReferenceType()) &&
4454+
Info.checkingPotentialConstantExpression() &&
44544455
BaseType->isLiteralType(Info.Ctx) && !VD->hasDefinition()) {
44554456
// This variable might end up being constexpr. Don't diagnose it yet.
44564457
} else if (IsConstant) {
@@ -4491,9 +4492,11 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E,
44914492
// a null BaseVal. Any constexpr-unknown variable seen here is an error:
44924493
// we can't access a constexpr-unknown object.
44934494
if (AK != clang::AK_Dereference && !BaseVal) {
4494-
Info.FFDiag(E, diag::note_constexpr_access_unknown_variable, 1)
4495-
<< AK << VD;
4496-
Info.Note(VD->getLocation(), diag::note_declared_at);
4495+
if (!Info.checkingPotentialConstantExpression()) {
4496+
Info.FFDiag(E, diag::note_constexpr_access_unknown_variable, 1)
4497+
<< AK << VD;
4498+
Info.Note(VD->getLocation(), diag::note_declared_at);
4499+
}
44974500
return CompleteObject();
44984501
}
44994502
} else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) {

clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID,
503503
Function *F = CGM.getIntrinsic(Intrinsic::amdgcn_ballot, { ResultType });
504504
return Builder.CreateCall(F, { Src });
505505
}
506+
case AMDGPU::BI__builtin_amdgcn_tanhf:
506507
case AMDGPU::BI__builtin_amdgcn_tanh_bf16:
507508
return emitBuiltinWithOneOverloadedType<1>(*this, E,
508509
Intrinsic::amdgcn_tanh);

clang/test/CodeGenOpenCL/amdgpu-features.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
// GFX1153: "target-features"="+16-bit-insts,+atomic-fadd-rtn-insts,+ci-insts,+dl-insts,+dot10-insts,+dot12-insts,+dot5-insts,+dot7-insts,+dot8-insts,+dot9-insts,+dpp,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx8-insts,+gfx9-insts,+wavefrontsize32"
109109
// GFX1200: "target-features"="+16-bit-insts,+atomic-buffer-global-pk-add-f16-insts,+atomic-buffer-pk-add-bf16-inst,+atomic-ds-pk-add-16-insts,+atomic-fadd-rtn-insts,+atomic-flat-pk-add-16-insts,+atomic-global-pk-add-bf16-inst,+ci-insts,+dl-insts,+dot10-insts,+dot11-insts,+dot12-insts,+dot7-insts,+dot8-insts,+dot9-insts,+dpp,+fp8-conversion-insts,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx12-insts,+gfx8-insts,+gfx9-insts,+wavefrontsize32"
110110
// GFX1201: "target-features"="+16-bit-insts,+atomic-buffer-global-pk-add-f16-insts,+atomic-buffer-pk-add-bf16-inst,+atomic-ds-pk-add-16-insts,+atomic-fadd-rtn-insts,+atomic-flat-pk-add-16-insts,+atomic-global-pk-add-bf16-inst,+ci-insts,+dl-insts,+dot10-insts,+dot11-insts,+dot12-insts,+dot7-insts,+dot8-insts,+dot9-insts,+dpp,+fp8-conversion-insts,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx12-insts,+gfx8-insts,+gfx9-insts,+wavefrontsize32"
111-
// GFX1250: "target-features"="+16-bit-insts,+ashr-pk-insts,+atomic-buffer-global-pk-add-f16-insts,+atomic-buffer-pk-add-bf16-inst,+atomic-ds-pk-add-16-insts,+atomic-fadd-rtn-insts,+atomic-flat-pk-add-16-insts,+atomic-global-pk-add-bf16-inst,+bf16-trans-insts,+bitop3-insts,+ci-insts,+dl-insts,+dot7-insts,+dot8-insts,+dpp,+fp8-conversion-insts,+fp8e5m3-insts,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx12-insts,+gfx1250-insts,+gfx8-insts,+gfx9-insts,+permlane16-swap,+prng-inst,+setprio-inc-wg-inst,+transpose-load-f4f6-insts,+wavefrontsize32"
111+
// GFX1250: "target-features"="+16-bit-insts,+ashr-pk-insts,+atomic-buffer-global-pk-add-f16-insts,+atomic-buffer-pk-add-bf16-inst,+atomic-ds-pk-add-16-insts,+atomic-fadd-rtn-insts,+atomic-flat-pk-add-16-insts,+atomic-global-pk-add-bf16-inst,+bf16-trans-insts,+bitop3-insts,+ci-insts,+dl-insts,+dot7-insts,+dot8-insts,+dpp,+fp8-conversion-insts,+fp8e5m3-insts,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx12-insts,+gfx1250-insts,+gfx8-insts,+gfx9-insts,+permlane16-swap,+prng-inst,+setprio-inc-wg-inst,+tanh-insts,+transpose-load-f4f6-insts,+wavefrontsize32
112112

113113
// GFX1103-W64: "target-features"="+16-bit-insts,+atomic-fadd-rtn-insts,+ci-insts,+dl-insts,+dot10-insts,+dot12-insts,+dot5-insts,+dot7-insts,+dot8-insts,+dot9-insts,+dpp,+gfx10-3-insts,+gfx10-insts,+gfx11-insts,+gfx8-insts,+gfx9-insts,+wavefrontsize64"
114114

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,25 @@ void test_s_wait_tensorcnt() {
4242
__builtin_amdgcn_s_wait_tensorcnt(0);
4343
}
4444

45+
// CHECK-LABEL: @test_tanh_f32(
46+
// CHECK-NEXT: entry:
47+
// CHECK-NEXT: [[OUT_ADDR:%.*]] = alloca ptr addrspace(1), align 8, addrspace(5)
48+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca float, align 4, addrspace(5)
49+
// CHECK-NEXT: [[OUT_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[OUT_ADDR]] to ptr
50+
// CHECK-NEXT: [[A_ADDR_ASCAST:%.*]] = addrspacecast ptr addrspace(5) [[A_ADDR]] to ptr
51+
// CHECK-NEXT: store ptr addrspace(1) [[OUT:%.*]], ptr [[OUT_ADDR_ASCAST]], align 8
52+
// CHECK-NEXT: store float [[A:%.*]], ptr [[A_ADDR_ASCAST]], align 4
53+
// CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[A_ADDR_ASCAST]], align 4
54+
// CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.amdgcn.tanh.f32(float [[TMP0]])
55+
// CHECK-NEXT: [[TMP2:%.*]] = load ptr addrspace(1), ptr [[OUT_ADDR_ASCAST]], align 8
56+
// CHECK-NEXT: store float [[TMP1]], ptr addrspace(1) [[TMP2]], align 4
57+
// CHECK-NEXT: ret void
58+
//
59+
void test_tanh_f32(global float* out, float a)
60+
{
61+
*out = __builtin_amdgcn_tanhf(a);
62+
}
63+
4564
// CHECK-LABEL: @test_tanh_bf16(
4665
// CHECK-NEXT: entry:
4766
// CHECK-NEXT: [[OUT_ADDR:%.*]] = alloca ptr addrspace(1), align 8, addrspace(5)

clang/test/SemaCXX/constant-expression-p2280r4.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,29 @@ namespace pointer_comparisons {
357357
static_assert(!f4()); // expected-error {{static assertion expression is not an integral constant expression}} \
358358
// expected-note {{in call to 'f4()'}}
359359
}
360+
361+
namespace GH149188 {
362+
namespace enable_if_1 {
363+
template <__SIZE_TYPE__ N>
364+
constexpr void foo(const char (&Str)[N])
365+
__attribute((enable_if(__builtin_strlen(Str), ""))) {}
366+
367+
void x() {
368+
foo("1234");
369+
}
370+
}
371+
372+
namespace enable_if_2 {
373+
constexpr const char (&f())[];
374+
extern const char (&Str)[];
375+
constexpr int foo()
376+
__attribute((enable_if(__builtin_strlen(Str), "")))
377+
{return __builtin_strlen(Str);}
378+
379+
constexpr const char (&f())[] {return "a";}
380+
constexpr const char (&Str)[] = f();
381+
void x() {
382+
constexpr int x = foo();
383+
}
384+
}
385+
}

clang/test/SemaCXX/constexpr-never-constant.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ constexpr void other_func() {
2424

2525
throw 12;
2626
}
27+
28+
namespace GH149041 {
29+
// Make sure these don't trigger the diagnostic.
30+
extern const bool& b;
31+
constexpr bool fun1() { return b; }
32+
constexpr bool fun2(const bool& b) { return b; }
33+
}

compiler-rt/lib/asan/asan_descriptions.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,12 @@ AddressDescription::AddressDescription(uptr addr, uptr access_size,
449449
// are put to the STACK region for unknown reasons. Check global first can
450450
// workaround this issue.
451451
// TODO: Look into whether there's a different solution to this problem.
452+
#if SANITIZER_AIX
452453
if (GetGlobalAddressInformation(addr, access_size, &data.global)) {
453454
data.kind = kAddressKindGlobal;
454455
return;
455456
}
457+
#endif
456458

457459
if (GetHeapAddressInformation(addr, access_size, &data.heap)) {
458460
data.kind = kAddressKindHeap;
@@ -471,6 +473,14 @@ AddressDescription::AddressDescription(uptr addr, uptr access_size,
471473
return;
472474
}
473475

476+
// GetGlobalAddressInformation is called earlier on AIX due to a workaround
477+
#if !SANITIZER_AIX
478+
if (GetGlobalAddressInformation(addr, access_size, &data.global)) {
479+
data.kind = kAddressKindGlobal;
480+
return;
481+
}
482+
#endif
483+
474484
data.kind = kAddressKindWild;
475485
data.wild.addr = addr;
476486
data.wild.access_size = access_size;

compiler-rt/test/asan/TestCases/Darwin/lit.local.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ def getRoot(config):
66

77
root = getRoot(config)
88

9-
if root.host_os not in ["Darwin"]:
9+
if root.target_os not in ["Darwin"]:
1010
config.unsupported = True

0 commit comments

Comments
 (0)