Skip to content

Commit d598872

Browse files
authored
merge main into amd-staging (llvm#1882)
2 parents c53358c + f623915 commit d598872

File tree

140 files changed

+1618
-1234
lines changed

Some content is hidden

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

140 files changed

+1618
-1234
lines changed

clang-tools-extra/clang-tidy/modernize/UseDesignatedInitializersCheck.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ void UseDesignatedInitializersCheck::registerMatchers(MatchFinder *Finder) {
121121
hasAnyBase(hasType(cxxRecordDecl(has(fieldDecl()))));
122122
Finder->addMatcher(
123123
initListExpr(
124-
hasType(cxxRecordDecl(RestrictToPODTypes ? isPOD() : isAggregate(),
125-
unless(HasBaseWithFields))
124+
hasType(cxxRecordDecl(
125+
RestrictToPODTypes ? isPOD() : isAggregate(),
126+
unless(anyOf(HasBaseWithFields, hasName("::std::array"))))
126127
.bind("type")),
127128
IgnoreSingleElementAggregates ? hasMoreThanOneElement() : anything(),
128129
unless(isFullyDesignated()))

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ Changes in existing checks
182182
``constexpr`` and ``static``` values on member initialization and by detecting
183183
explicit casting of built-in types within member list initialization.
184184

185+
- Improved :doc:`modernize-use-designated-initializers
186+
<clang-tidy/checks/modernize/use-designated-initializers>` check by avoiding
187+
diagnosing designated initializers for ``std::array`` initializations.
188+
185189
- Improved :doc:`modernize-use-ranges
186190
<clang-tidy/checks/modernize/use-ranges>` check by updating suppress
187191
warnings logic for ``nullptr`` in ``std::find``.

clang-tools-extra/docs/clang-tidy/checks/modernize/use-designated-initializers.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Options
5454

5555
The value `false` specifies that even initializers for aggregate types with
5656
only a single element should be checked. The default value is `true`.
57+
``std::array`` initializations are always excluded, as the type is a
58+
standard library abstraction and not intended to be initialized with
59+
designated initializers.
5760

5861
.. option:: RestrictToPODTypes
5962

clang-tools-extra/test/clang-tidy/checkers/modernize/use-designated-initializers.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,18 @@ struct S15{
209209
S15(S14& d):d{d}{}
210210
S14& d;
211211
};
212+
213+
//Issue #133715
214+
namespace std {
215+
template<typename T, unsigned int N>
216+
struct array {
217+
T __elems[N];
218+
};
219+
template<typename T, typename... U>
220+
array(T, U...) -> array<T, 1 + sizeof...(U)>;
221+
}
222+
223+
std::array a{1,2,3};
224+
std::array<int,2> b{10, 11};
225+
using array = std::array<int, 2>;
226+
array c{10, 11};

clang/include/clang/Frontend/CompilerInvocation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class CompilerInvocationBase {
8989
std::shared_ptr<PreprocessorOptions> PPOpts;
9090

9191
/// Options controlling the static analyzer.
92-
AnalyzerOptionsRef AnalyzerOpts;
92+
std::shared_ptr<AnalyzerOptions> AnalyzerOpts;
9393

9494
std::shared_ptr<MigratorOptions> MigratorOpts;
9595

clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class PositiveAnalyzerOption {
176176
/// and should be eventually converted into -analyzer-config flags. New analyzer
177177
/// options should not be implemented as frontend flags. Frontend flags still
178178
/// make sense for things that do not affect the actual analysis.
179-
class AnalyzerOptions : public RefCountedBase<AnalyzerOptions> {
179+
class AnalyzerOptions {
180180
public:
181181
using ConfigTable = llvm::StringMap<std::string>;
182182

@@ -416,8 +416,6 @@ class AnalyzerOptions : public RefCountedBase<AnalyzerOptions> {
416416
}
417417
};
418418

419-
using AnalyzerOptionsRef = IntrusiveRefCntPtr<AnalyzerOptions>;
420-
421419
//===----------------------------------------------------------------------===//
422420
// We'll use AnalyzerOptions in the frontend, but we can't link the frontend
423421
// with clangStaticAnalyzerCore, because clangStaticAnalyzerCore depends on

clang/lib/Basic/Targets/SPIR.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ static const unsigned SPIRDefIsPrivMap[] = {
5858
// Used by both the SPIR and SPIR-V targets.
5959
static const unsigned SPIRDefIsGenMap[] = {
6060
4, // Default
61-
// Some OpenCL address space values for this map are dummy and they can't be
62-
// used
6361
1, // opencl_global
64-
0, // opencl_local
65-
0, // opencl_constant
62+
3, // opencl_local
63+
2, // opencl_constant
6664
0, // opencl_private
67-
0, // opencl_generic
68-
0, // opencl_global_device
69-
0, // opencl_global_host
65+
4, // opencl_generic
66+
5, // opencl_global_device
67+
6, // opencl_global_host
7068
// cuda_* address space mapping is intended for HIPSPV (HIP to SPIR-V
7169
// translation). This mapping is enabled when the language mode is HIP.
7270
1, // cuda_device

clang/lib/CIR/CodeGen/CIRGenExpr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ LValue CIRGenFunction::emitLValueForField(LValue base, const FieldDecl *field) {
311311
assert(!cir::MissingFeatures::opTBAA());
312312

313313
Address addr = base.getAddress();
314-
if (auto *classDef = dyn_cast<CXXRecordDecl>(rec)) {
314+
if (isa<CXXRecordDecl>(rec)) {
315315
cgm.errorNYI(field->getSourceRange(), "emitLValueForField: C++ class");
316316
return LValue();
317317
}
@@ -701,7 +701,7 @@ CIRGenFunction::emitArraySubscriptExpr(const clang::ArraySubscriptExpr *e) {
701701
}
702702

703703
LValue CIRGenFunction::emitMemberExpr(const MemberExpr *e) {
704-
if (auto *vd = dyn_cast<VarDecl>(e->getMemberDecl())) {
704+
if (isa<VarDecl>(e->getMemberDecl())) {
705705
cgm.errorNYI(e->getSourceRange(), "emitMemberExpr: VarDecl");
706706
return LValue();
707707
}
@@ -734,7 +734,7 @@ LValue CIRGenFunction::emitMemberExpr(const MemberExpr *e) {
734734
return lv;
735735
}
736736

737-
if (const auto *fd = dyn_cast<FunctionDecl>(nd)) {
737+
if (isa<FunctionDecl>(nd)) {
738738
cgm.errorNYI(e->getSourceRange(), "emitMemberExpr: FunctionDecl");
739739
return LValue();
740740
}

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *vd,
366366
bool isTentative) {
367367
const QualType astTy = vd->getType();
368368
const mlir::Type type = convertType(vd->getType());
369-
if (clang::IdentifierInfo *identifier = vd->getIdentifier()) {
369+
if (vd->getIdentifier()) {
370370
StringRef name = getMangledName(GlobalDecl(vd));
371371
auto varOp =
372372
builder.create<cir::GlobalOp>(getLoc(vd->getSourceRange()), name, type);

clang/lib/Driver/SanitizerArgs.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,10 +1028,6 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
10281028
StableABI = Args.hasFlag(options::OPT_fsanitize_stable_abi,
10291029
options::OPT_fno_sanitize_stable_abi, false);
10301030

1031-
AsanUseAfterScope = Args.hasFlag(
1032-
options::OPT_fsanitize_address_use_after_scope,
1033-
options::OPT_fno_sanitize_address_use_after_scope, AsanUseAfterScope);
1034-
10351031
AsanPoisonCustomArrayCookie = Args.hasFlag(
10361032
options::OPT_fsanitize_address_poison_custom_array_cookie,
10371033
options::OPT_fno_sanitize_address_poison_custom_array_cookie,
@@ -1093,7 +1089,6 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
10931089
}
10941090

10951091
} else {
1096-
AsanUseAfterScope = false;
10971092
// -fsanitize=pointer-compare/pointer-subtract requires -fsanitize=address.
10981093
SanitizerMask DetectInvalidPointerPairs =
10991094
SanitizerKind::PointerCompare | SanitizerKind::PointerSubtract;
@@ -1107,6 +1102,14 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
11071102
}
11081103
}
11091104

1105+
if (AllAddedKinds & (SanitizerKind::Address | SanitizerKind::KernelAddress)) {
1106+
AsanUseAfterScope = Args.hasFlag(
1107+
options::OPT_fsanitize_address_use_after_scope,
1108+
options::OPT_fno_sanitize_address_use_after_scope, AsanUseAfterScope);
1109+
} else {
1110+
AsanUseAfterScope = false;
1111+
}
1112+
11101113
if (AllAddedKinds & SanitizerKind::HWAddress) {
11111114
if (Arg *HwasanAbiArg =
11121115
Args.getLastArg(options::OPT_fsanitize_hwaddress_abi_EQ)) {

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ CompilerInvocationBase::CompilerInvocationBase()
142142
DiagnosticOpts(llvm::makeIntrusiveRefCnt<DiagnosticOptions>()),
143143
HSOpts(std::make_shared<HeaderSearchOptions>()),
144144
PPOpts(std::make_shared<PreprocessorOptions>()),
145-
AnalyzerOpts(llvm::makeIntrusiveRefCnt<AnalyzerOptions>()),
145+
AnalyzerOpts(std::make_shared<AnalyzerOptions>()),
146146
MigratorOpts(std::make_shared<MigratorOptions>()),
147147
APINotesOpts(std::make_shared<APINotesOptions>()),
148148
CodeGenOpts(std::make_shared<CodeGenOptions>()),
@@ -159,7 +159,7 @@ CompilerInvocationBase::deep_copy_assign(const CompilerInvocationBase &X) {
159159
DiagnosticOpts = makeIntrusiveRefCntCopy(X.getDiagnosticOpts());
160160
HSOpts = make_shared_copy(X.getHeaderSearchOpts());
161161
PPOpts = make_shared_copy(X.getPreprocessorOpts());
162-
AnalyzerOpts = makeIntrusiveRefCntCopy(X.getAnalyzerOpts());
162+
AnalyzerOpts = make_shared_copy(X.getAnalyzerOpts());
163163
MigratorOpts = make_shared_copy(X.getMigratorOpts());
164164
APINotesOpts = make_shared_copy(X.getAPINotesOpts());
165165
CodeGenOpts = make_shared_copy(X.getCodeGenOpts());

clang/test/CodeGen/lifetime-sanitizer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
// RUN: -fsanitize=address -fsanitize-address-use-after-scope \
55
// RUN: -Xclang -disable-llvm-passes %s | FileCheck %s -check-prefix=LIFETIME
66
// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
7+
// RUN: -fsanitize=kernel-address -fsanitize-address-use-after-scope \
8+
// RUN: -Xclang -disable-llvm-passes %s | FileCheck %s -check-prefix=LIFETIME
9+
// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
710
// RUN: -fsanitize=memory -Xclang -disable-llvm-passes %s | \
811
// RUN: FileCheck %s -check-prefix=LIFETIME
912
// RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \

clang/test/CodeGenCXX/lifetime-sanitizer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// RUN: -fsanitize=address -fsanitize-address-use-after-scope \
66
// RUN: -Xclang -disable-llvm-passes %s | FileCheck %s -check-prefixes=CHECK,LIFETIME
77
// RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
8+
// RUN: -fsanitize=kernel-address -fsanitize-address-use-after-scope \
9+
// RUN: -Xclang -disable-llvm-passes %s | FileCheck %s -check-prefixes=CHECK,LIFETIME
10+
// RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
811
// RUN: -fsanitize=memory -Xclang -disable-llvm-passes %s | \
912
// RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
1013
// RUN: %clang -w -target aarch64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 \
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
2+
// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \
3+
// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF \
4+
// RUN: -DTARGET=dx -DFNATTRS=noundef -DFFNATTRS="nofpclass(nan inf)"
5+
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
6+
// RUN: -emit-llvm -disable-llvm-passes -o - | \
7+
// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF \
8+
// RUN: -DTARGET=dx -DFNATTRS=noundef -DFFNATTRS="nofpclass(nan inf)"
9+
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple spirv-unknown-vulkan-compute %s \
10+
// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - | \
11+
// RUN: FileCheck %s --check-prefixes=CHECK,NATIVE_HALF \
12+
// RUN: -DTARGET=spv -DFNATTRS="spir_func noundef" -DFFNATTRS="nofpclass(nan inf)"
13+
// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple spirv-unknown-vulkan-compute %s \
14+
// RUN: -emit-llvm -disable-llvm-passes -o - | \
15+
// RUN: FileCheck %s --check-prefixes=CHECK,NO_HALF \
16+
// RUN: -DTARGET=spv -DFNATTRS="spir_func noundef" -DFFNATTRS="nofpclass(nan inf)"
17+
18+
#ifdef __HLSL_ENABLE_16_BIT
19+
// NATIVE_HALF: define [[FNATTRS]] <4 x i16> {{.*}}test_clamp_short4_mismatch
20+
// NATIVE_HALF: call <4 x i16> @llvm.[[TARGET]].sclamp.v4i16
21+
int16_t4 test_clamp_short4_mismatch(int16_t4 p0, int16_t p1) { return clamp(p0, p0,p1); }
22+
23+
// NATIVE_HALF: define [[FNATTRS]] <4 x i16> {{.*}}test_clamp_ushort4_mismatch
24+
// NATIVE_HALF: call <4 x i16> @llvm.[[TARGET]].uclamp.v4i16
25+
uint16_t4 test_clamp_ushort4_mismatch(uint16_t4 p0, uint16_t p1) { return clamp(p0, p0,p1); }
26+
#endif
27+
28+
// CHECK: define [[FNATTRS]] <4 x i32> {{.*}}test_clamp_int4_mismatch
29+
// CHECK: call <4 x i32> @llvm.[[TARGET]].sclamp.v4i32
30+
int4 test_clamp_int4_mismatch(int4 p0, int p1) { return clamp(p0, p0,p1); }
31+
32+
// CHECK: define [[FNATTRS]] <4 x i32> {{.*}}test_clamp_uint4_mismatch
33+
// CHECK: call <4 x i32> @llvm.[[TARGET]].uclamp.v4i32
34+
uint4 test_clamp_uint4_mismatch(uint4 p0, uint p1) { return clamp(p0, p0,p1); }
35+
36+
// CHECK: define [[FNATTRS]] <4 x i64> {{.*}}test_clamp_long4_mismatch
37+
// CHECK: call <4 x i64> @llvm.[[TARGET]].sclamp.v4i64
38+
int64_t4 test_clamp_long4_mismatch(int64_t4 p0, int64_t p1) { return clamp(p0, p0,p1); }
39+
40+
// CHECK: define [[FNATTRS]] <4 x i64> {{.*}}test_clamp_ulong4_mismatch
41+
// CHECK: call <4 x i64> @llvm.[[TARGET]].uclamp.v4i64
42+
uint64_t4 test_clamp_ulong4_mismatch(uint64_t4 p0, uint64_t p1) { return clamp(p0, p0,p1); }
43+
44+
// NATIVE_HALF: define [[FNATTRS]] [[FFNATTRS]] <4 x half> {{.*}}test_clamp_half4_mismatch
45+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.[[TARGET]].nclamp.v4f16
46+
// NO_HALF: define [[FNATTRS]] [[FFNATTRS]] <4 x float> {{.*}}test_clamp_half4_mismatch
47+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].nclamp.v4f32(
48+
half4 test_clamp_half4_mismatch(half4 p0, half p1) { return clamp(p0, p0,p1); }
49+
50+
// CHECK: define [[FNATTRS]] [[FFNATTRS]] <4 x float> {{.*}}test_clamp_float4_mismatch
51+
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].nclamp.v4f32
52+
float4 test_clamp_float4_mismatch(float4 p0, float p1) { return clamp(p0, p0,p1); }
53+
54+
// CHECK: define [[FNATTRS]] [[FFNATTRS]] <4 x double> {{.*}}test_clamp_double4_mismatch
55+
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.[[TARGET]].nclamp.v4f64
56+
double4 test_clamp_double4_mismatch(double4 p0, double p1) { return clamp(p0, p0,p1); }
57+
// CHECK: define [[FNATTRS]] [[FFNATTRS]] <4 x double> {{.*}}test_clamp_double4_mismatch2
58+
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.[[TARGET]].nclamp.v4f64
59+
double4 test_clamp_double4_mismatch2(double4 p0, double p1) { return clamp(p0, p1,p0); }
60+
61+
// CHECK: define [[FNATTRS]] <3 x i32> {{.*}}test_overloads3
62+
// CHECK: call <3 x i32> @llvm.[[TARGET]].uclamp.v3i32
63+
uint3 test_overloads3(uint3 p0, uint p1, uint p2) { return clamp(p0, p1, p2); }

clang/test/CodeGenHLSL/builtins/clamp.hlsl

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ int16_t3 test_clamp_short3(int16_t3 p0, int16_t3 p1) { return clamp(p0, p1,p1);
2828
// NATIVE_HALF: define [[FNATTRS]] <4 x i16> @_Z17test_clamp_short4
2929
// NATIVE_HALF: call <4 x i16> @llvm.[[TARGET]].sclamp.v4i16
3030
int16_t4 test_clamp_short4(int16_t4 p0, int16_t4 p1) { return clamp(p0, p1,p1); }
31-
// NATIVE_HALF: define [[FNATTRS]] <4 x i16> {{.*}}test_clamp_short4_mismatch
32-
// NATIVE_HALF: call <4 x i16> @llvm.[[TARGET]].sclamp.v4i16
33-
int16_t4 test_clamp_short4_mismatch(int16_t4 p0, int16_t p1) { return clamp(p0, p0,p1); }
3431

3532
// NATIVE_HALF: define [[FNATTRS]] i16 @_Z17test_clamp_ushort
3633
// NATIVE_HALF: call i16 @llvm.[[TARGET]].uclamp.i16(
@@ -44,9 +41,6 @@ uint16_t3 test_clamp_ushort3(uint16_t3 p0, uint16_t3 p1) { return clamp(p0, p1,p
4441
// NATIVE_HALF: define [[FNATTRS]] <4 x i16> @_Z18test_clamp_ushort4
4542
// NATIVE_HALF: call <4 x i16> @llvm.[[TARGET]].uclamp.v4i16
4643
uint16_t4 test_clamp_ushort4(uint16_t4 p0, uint16_t4 p1) { return clamp(p0, p1,p1); }
47-
// NATIVE_HALF: define [[FNATTRS]] <4 x i16> {{.*}}test_clamp_ushort4_mismatch
48-
// NATIVE_HALF: call <4 x i16> @llvm.[[TARGET]].uclamp.v4i16
49-
uint16_t4 test_clamp_ushort4_mismatch(uint16_t4 p0, uint16_t p1) { return clamp(p0, p0,p1); }
5044
#endif
5145

5246
// CHECK: define [[FNATTRS]] i32 @_Z14test_clamp_int
@@ -61,9 +55,6 @@ int3 test_clamp_int3(int3 p0, int3 p1) { return clamp(p0, p1,p1); }
6155
// CHECK: define [[FNATTRS]] <4 x i32> @_Z15test_clamp_int4
6256
// CHECK: call <4 x i32> @llvm.[[TARGET]].sclamp.v4i32
6357
int4 test_clamp_int4(int4 p0, int4 p1) { return clamp(p0, p1,p1); }
64-
// CHECK: define [[FNATTRS]] <4 x i32> {{.*}}test_clamp_int4_mismatch
65-
// CHECK: call <4 x i32> @llvm.[[TARGET]].sclamp.v4i32
66-
int4 test_clamp_int4_mismatch(int4 p0, int p1) { return clamp(p0, p0,p1); }
6758

6859
// CHECK: define [[FNATTRS]] i32 @_Z15test_clamp_uint
6960
// CHECK: call i32 @llvm.[[TARGET]].uclamp.i32(
@@ -77,9 +68,6 @@ uint3 test_clamp_uint3(uint3 p0, uint3 p1) { return clamp(p0, p1,p1); }
7768
// CHECK: define [[FNATTRS]] <4 x i32> @_Z16test_clamp_uint4
7869
// CHECK: call <4 x i32> @llvm.[[TARGET]].uclamp.v4i32
7970
uint4 test_clamp_uint4(uint4 p0, uint4 p1) { return clamp(p0, p1,p1); }
80-
// CHECK: define [[FNATTRS]] <4 x i32> {{.*}}test_clamp_uint4_mismatch
81-
// CHECK: call <4 x i32> @llvm.[[TARGET]].uclamp.v4i32
82-
uint4 test_clamp_uint4_mismatch(uint4 p0, uint p1) { return clamp(p0, p0,p1); }
8371

8472
// CHECK: define [[FNATTRS]] i64 @_Z15test_clamp_long
8573
// CHECK: call i64 @llvm.[[TARGET]].sclamp.i64(
@@ -93,9 +81,6 @@ int64_t3 test_clamp_long3(int64_t3 p0, int64_t3 p1) { return clamp(p0, p1,p1); }
9381
// CHECK: define [[FNATTRS]] <4 x i64> @_Z16test_clamp_long4
9482
// CHECK: call <4 x i64> @llvm.[[TARGET]].sclamp.v4i64
9583
int64_t4 test_clamp_long4(int64_t4 p0, int64_t4 p1) { return clamp(p0, p1,p1); }
96-
// CHECK: define [[FNATTRS]] <4 x i64> {{.*}}test_clamp_long4_mismatch
97-
// CHECK: call <4 x i64> @llvm.[[TARGET]].sclamp.v4i64
98-
int64_t4 test_clamp_long4_mismatch(int64_t4 p0, int64_t p1) { return clamp(p0, p0,p1); }
9984

10085
// CHECK: define [[FNATTRS]] i64 @_Z16test_clamp_ulong
10186
// CHECK: call i64 @llvm.[[TARGET]].uclamp.i64(
@@ -109,9 +94,6 @@ uint64_t3 test_clamp_ulong3(uint64_t3 p0, uint64_t3 p1) { return clamp(p0, p1,p1
10994
// CHECK: define [[FNATTRS]] <4 x i64> @_Z17test_clamp_ulong4
11095
// CHECK: call <4 x i64> @llvm.[[TARGET]].uclamp.v4i64
11196
uint64_t4 test_clamp_ulong4(uint64_t4 p0, uint64_t4 p1) { return clamp(p0, p1,p1); }
112-
// CHECK: define [[FNATTRS]] <4 x i64> {{.*}}test_clamp_ulong4_mismatch
113-
// CHECK: call <4 x i64> @llvm.[[TARGET]].uclamp.v4i64
114-
uint64_t4 test_clamp_ulong4_mismatch(uint64_t4 p0, uint64_t p1) { return clamp(p0, p0,p1); }
11597

11698
// NATIVE_HALF: define [[FNATTRS]] [[FFNATTRS]] half @_Z15test_clamp_half
11799
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn half @llvm.[[TARGET]].nclamp.f16(
@@ -133,11 +115,6 @@ half3 test_clamp_half3(half3 p0, half3 p1) { return clamp(p0, p1,p1); }
133115
// NO_HALF: define [[FNATTRS]] [[FFNATTRS]] <4 x float> @_Z16test_clamp_half4
134116
// NO_HALF: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].nclamp.v4f32(
135117
half4 test_clamp_half4(half4 p0, half4 p1) { return clamp(p0, p1,p1); }
136-
// NATIVE_HALF: define [[FNATTRS]] [[FFNATTRS]] <4 x half> {{.*}}test_clamp_half4_mismatch
137-
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.[[TARGET]].nclamp.v4f16
138-
// NO_HALF: define [[FNATTRS]] [[FFNATTRS]] <4 x float> {{.*}}test_clamp_half4_mismatch
139-
// NO_HALF: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].nclamp.v4f32(
140-
half4 test_clamp_half4_mismatch(half4 p0, half p1) { return clamp(p0, p0,p1); }
141118

142119
// CHECK: define [[FNATTRS]] [[FFNATTRS]] float @_Z16test_clamp_float
143120
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].nclamp.f32(
@@ -151,9 +128,6 @@ float3 test_clamp_float3(float3 p0, float3 p1) { return clamp(p0, p1,p1); }
151128
// CHECK: define [[FNATTRS]] [[FFNATTRS]] <4 x float> @_Z17test_clamp_float4
152129
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].nclamp.v4f32
153130
float4 test_clamp_float4(float4 p0, float4 p1) { return clamp(p0, p1,p1); }
154-
// CHECK: define [[FNATTRS]] [[FFNATTRS]] <4 x float> {{.*}}test_clamp_float4_mismatch
155-
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].nclamp.v4f32
156-
float4 test_clamp_float4_mismatch(float4 p0, float p1) { return clamp(p0, p0,p1); }
157131

158132
// CHECK: define [[FNATTRS]] [[FFNATTRS]] double @_Z17test_clamp_double
159133
// CHECK: call reassoc nnan ninf nsz arcp afn double @llvm.[[TARGET]].nclamp.f64(
@@ -167,13 +141,3 @@ double3 test_clamp_double3(double3 p0, double3 p1) { return clamp(p0, p1,p1); }
167141
// CHECK: define [[FNATTRS]] [[FFNATTRS]] <4 x double> @_Z18test_clamp_double4
168142
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.[[TARGET]].nclamp.v4f64
169143
double4 test_clamp_double4(double4 p0, double4 p1) { return clamp(p0, p1,p1); }
170-
// CHECK: define [[FNATTRS]] [[FFNATTRS]] <4 x double> {{.*}}test_clamp_double4_mismatch
171-
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.[[TARGET]].nclamp.v4f64
172-
double4 test_clamp_double4_mismatch(double4 p0, double p1) { return clamp(p0, p0,p1); }
173-
// CHECK: define [[FNATTRS]] [[FFNATTRS]] <4 x double> {{.*}}test_clamp_double4_mismatch2
174-
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.[[TARGET]].nclamp.v4f64
175-
double4 test_clamp_double4_mismatch2(double4 p0, double p1) { return clamp(p0, p1,p0); }
176-
177-
// CHECK: define [[FNATTRS]] <3 x i32> {{.*}}test_overloads3
178-
// CHECK: call <3 x i32> @llvm.[[TARGET]].uclamp.v3i32
179-
uint3 test_overloads3(uint3 p0, uint p1, uint p2) { return clamp(p0, p1, p2); }

0 commit comments

Comments
 (0)