Skip to content

Commit 65bf2a5

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:e40bc8e509cdad67926fcd208c320cb4d50f6aec into amd-gfx:de71bf8c4239
Local branch amd-gfx de71bf8 Merged main:c56bd7ab7934355ed19d4d3ec299b5784bf02379 into amd-gfx:02fd22716224 Remote branch main e40bc8e [ORC][MachO] Make BuildVersionOpts::fromTriple result optional, add test.
2 parents de71bf8 + e40bc8e commit 65bf2a5

File tree

142 files changed

+3103
-1308
lines changed

Some content is hidden

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

142 files changed

+3103
-1308
lines changed

clang/include/clang/Basic/Builtins.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4572,6 +4572,12 @@ def HLSLFrac : LangBuiltin<"HLSL_LANG"> {
45724572
let Prototype = "void(...)";
45734573
}
45744574

4575+
def HLSLIsinf : LangBuiltin<"HLSL_LANG"> {
4576+
let Spellings = ["__builtin_hlsl_elementwise_isinf"];
4577+
let Attributes = [NoThrow, Const];
4578+
let Prototype = "void(...)";
4579+
}
4580+
45754581
def HLSLLerp : LangBuiltin<"HLSL_LANG"> {
45764582
let Spellings = ["__builtin_hlsl_lerp"];
45774583
let Attributes = [NoThrow, Const];
@@ -4590,6 +4596,12 @@ def HLSLRcp : LangBuiltin<"HLSL_LANG"> {
45904596
let Prototype = "void(...)";
45914597
}
45924598

4599+
def HLSLRSqrt : LangBuiltin<"HLSL_LANG"> {
4600+
let Spellings = ["__builtin_hlsl_elementwise_rsqrt"];
4601+
let Attributes = [NoThrow, Const, CustomTypeChecking];
4602+
let Prototype = "void(...)";
4603+
}
4604+
45934605
// Builtins for XRay.
45944606
def XRayCustomEvent : Builtin {
45954607
let Spellings = ["__xray_customevent"];

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18062,6 +18062,20 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
1806218062
/*ReturnType=*/Op0->getType(), Intrinsic::dx_frac,
1806318063
ArrayRef<Value *>{Op0}, nullptr, "dx.frac");
1806418064
}
18065+
case Builtin::BI__builtin_hlsl_elementwise_isinf: {
18066+
Value *Op0 = EmitScalarExpr(E->getArg(0));
18067+
llvm::Type *Xty = Op0->getType();
18068+
llvm::Type *retType = llvm::Type::getInt1Ty(this->getLLVMContext());
18069+
if (Xty->isVectorTy()) {
18070+
auto *XVecTy = E->getArg(0)->getType()->getAs<VectorType>();
18071+
retType = llvm::VectorType::get(
18072+
retType, ElementCount::getFixed(XVecTy->getNumElements()));
18073+
}
18074+
if (!E->getArg(0)->getType()->hasFloatingRepresentation())
18075+
llvm_unreachable("isinf operand must have a float representation");
18076+
return Builder.CreateIntrinsic(retType, Intrinsic::dx_isinf,
18077+
ArrayRef<Value *>{Op0}, nullptr, "dx.isinf");
18078+
}
1806518079
case Builtin::BI__builtin_hlsl_mad: {
1806618080
Value *M = EmitScalarExpr(E->getArg(0));
1806718081
Value *A = EmitScalarExpr(E->getArg(1));
@@ -18089,6 +18103,14 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
1808918103
/*ReturnType=*/Op0->getType(), Intrinsic::dx_rcp,
1809018104
ArrayRef<Value *>{Op0}, nullptr, "dx.rcp");
1809118105
}
18106+
case Builtin::BI__builtin_hlsl_elementwise_rsqrt: {
18107+
Value *Op0 = EmitScalarExpr(E->getArg(0));
18108+
if (!E->getArg(0)->getType()->hasFloatingRepresentation())
18109+
llvm_unreachable("rsqrt operand must have a float representation");
18110+
return Builder.CreateIntrinsic(
18111+
/*ReturnType=*/Op0->getType(), Intrinsic::dx_rsqrt,
18112+
ArrayRef<Value *>{Op0}, nullptr, "dx.rsqrt");
18113+
}
1809218114
}
1809318115
return nullptr;
1809418116
}

clang/lib/Headers/hlsl/hlsl_intrinsics.h

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,39 @@ float3 frac(float3);
525525
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_frac)
526526
float4 frac(float4);
527527

528+
//===----------------------------------------------------------------------===//
529+
// isinf builtins
530+
//===----------------------------------------------------------------------===//
531+
532+
/// \fn T isinf(T x)
533+
/// \brief Determines if the specified value \a x is infinite.
534+
/// \param x The specified input value.
535+
///
536+
/// Returns a value of the same size as the input, with a value set
537+
/// to True if the x parameter is +INF or -INF. Otherwise, False.
538+
539+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
540+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_isinf)
541+
bool isinf(half);
542+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
543+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_isinf)
544+
bool2 isinf(half2);
545+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
546+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_isinf)
547+
bool3 isinf(half3);
548+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
549+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_isinf)
550+
bool4 isinf(half4);
551+
552+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_isinf)
553+
bool isinf(float);
554+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_isinf)
555+
bool2 isinf(float2);
556+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_isinf)
557+
bool3 isinf(float3);
558+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_isinf)
559+
bool4 isinf(float4);
560+
528561
//===----------------------------------------------------------------------===//
529562
// lerp builtins
530563
//===----------------------------------------------------------------------===//
@@ -1153,6 +1186,39 @@ double3 rcp(double3);
11531186
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rcp)
11541187
double4 rcp(double4);
11551188

1189+
//===----------------------------------------------------------------------===//
1190+
// rsqrt builtins
1191+
//===----------------------------------------------------------------------===//
1192+
1193+
/// \fn T rsqrt(T x)
1194+
/// \brief Returns the reciprocal of the square root of the specified value.
1195+
/// ie 1 / sqrt( \a x).
1196+
/// \param x The specified input value.
1197+
///
1198+
/// This function uses the following formula: 1 / sqrt(x).
1199+
1200+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
1201+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rsqrt)
1202+
half rsqrt(half);
1203+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
1204+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rsqrt)
1205+
half2 rsqrt(half2);
1206+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
1207+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rsqrt)
1208+
half3 rsqrt(half3);
1209+
_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2)
1210+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rsqrt)
1211+
half4 rsqrt(half4);
1212+
1213+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rsqrt)
1214+
float rsqrt(float);
1215+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rsqrt)
1216+
float2 rsqrt(float2);
1217+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rsqrt)
1218+
float3 rsqrt(float3);
1219+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_rsqrt)
1220+
float4 rsqrt(float4);
1221+
11561222
//===----------------------------------------------------------------------===//
11571223
// round builtins
11581224
//===----------------------------------------------------------------------===//

clang/lib/Sema/SemaChecking.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5268,6 +5268,15 @@ bool CheckAllArgsHaveFloatRepresentation(Sema *S, CallExpr *TheCall) {
52685268
return false;
52695269
}
52705270

5271+
void SetElementTypeAsReturnType(Sema *S, CallExpr *TheCall,
5272+
QualType ReturnType) {
5273+
auto *VecTyA = TheCall->getArg(0)->getType()->getAs<VectorType>();
5274+
if (VecTyA)
5275+
ReturnType = S->Context.getVectorType(ReturnType, VecTyA->getNumElements(),
5276+
VectorKind::Generic);
5277+
TheCall->setType(ReturnType);
5278+
}
5279+
52715280
// Note: returning true in this case results in CheckBuiltinFunctionCall
52725281
// returning an ExprError
52735282
bool Sema::CheckHLSLBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
@@ -5286,12 +5295,21 @@ bool Sema::CheckHLSLBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
52865295
return true;
52875296
break;
52885297
}
5298+
case Builtin::BI__builtin_hlsl_elementwise_isinf: {
5299+
if (checkArgCount(*this, TheCall, 1))
5300+
return true;
5301+
if (CheckAllArgsHaveFloatRepresentation(this, TheCall))
5302+
return true;
5303+
SetElementTypeAsReturnType(this, TheCall, this->Context.BoolTy);
5304+
break;
5305+
}
5306+
case Builtin::BI__builtin_hlsl_elementwise_rsqrt:
52895307
case Builtin::BI__builtin_hlsl_elementwise_rcp:
52905308
case Builtin::BI__builtin_hlsl_elementwise_frac: {
5291-
if (PrepareBuiltinElementwiseMathOneArgCall(TheCall))
5292-
return true;
52935309
if (CheckAllArgsHaveFloatRepresentation(this, TheCall))
52945310
return true;
5311+
if (PrepareBuiltinElementwiseMathOneArgCall(TheCall))
5312+
return true;
52955313
break;
52965314
}
52975315
case Builtin::BI__builtin_hlsl_lerp: {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
2+
// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
3+
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
4+
// RUN: --check-prefixes=CHECK,NATIVE_HALF
5+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
6+
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
7+
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
8+
9+
// CHECK: define noundef i1 @
10+
// NATIVE_HALF: %dx.isinf = call i1 @llvm.dx.isinf.f16(
11+
// NO_HALF: %dx.isinf = call i1 @llvm.dx.isinf.f32(
12+
// CHECK: ret i1 %dx.isinf
13+
bool test_isinf_half(half p0) { return isinf(p0); }
14+
// CHECK: define noundef <2 x i1> @
15+
// NATIVE_HALF: %dx.isinf = call <2 x i1> @llvm.dx.isinf.v2f16
16+
// NO_HALF: %dx.isinf = call <2 x i1> @llvm.dx.isinf.v2f32(
17+
// CHECK: ret <2 x i1> %dx.isinf
18+
bool2 test_isinf_half2(half2 p0) { return isinf(p0); }
19+
// NATIVE_HALF: define noundef <3 x i1> @
20+
// NATIVE_HALF: %dx.isinf = call <3 x i1> @llvm.dx.isinf.v3f16
21+
// NO_HALF: %dx.isinf = call <3 x i1> @llvm.dx.isinf.v3f32(
22+
// CHECK: ret <3 x i1> %dx.isinf
23+
bool3 test_isinf_half3(half3 p0) { return isinf(p0); }
24+
// NATIVE_HALF: define noundef <4 x i1> @
25+
// NATIVE_HALF: %dx.isinf = call <4 x i1> @llvm.dx.isinf.v4f16
26+
// NO_HALF: %dx.isinf = call <4 x i1> @llvm.dx.isinf.v4f32(
27+
// CHECK: ret <4 x i1> %dx.isinf
28+
bool4 test_isinf_half4(half4 p0) { return isinf(p0); }
29+
30+
// CHECK: define noundef i1 @
31+
// CHECK: %dx.isinf = call i1 @llvm.dx.isinf.f32(
32+
// CHECK: ret i1 %dx.isinf
33+
bool test_isinf_float(float p0) { return isinf(p0); }
34+
// CHECK: define noundef <2 x i1> @
35+
// CHECK: %dx.isinf = call <2 x i1> @llvm.dx.isinf.v2f32
36+
// CHECK: ret <2 x i1> %dx.isinf
37+
bool2 test_isinf_float2(float2 p0) { return isinf(p0); }
38+
// CHECK: define noundef <3 x i1> @
39+
// CHECK: %dx.isinf = call <3 x i1> @llvm.dx.isinf.v3f32
40+
// CHECK: ret <3 x i1> %dx.isinf
41+
bool3 test_isinf_float3(float3 p0) { return isinf(p0); }
42+
// CHECK: define noundef <4 x i1> @
43+
// CHECK: %dx.isinf = call <4 x i1> @llvm.dx.isinf.v4f32
44+
// CHECK: ret <4 x i1> %dx.isinf
45+
bool4 test_isinf_float4(float4 p0) { return isinf(p0); }
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
2+
// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
3+
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
4+
// RUN: --check-prefixes=CHECK,NATIVE_HALF
5+
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
6+
// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
7+
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
8+
9+
// NATIVE_HALF: define noundef half @
10+
// NATIVE_HALF: %dx.rsqrt = call half @llvm.dx.rsqrt.f16(
11+
// NATIVE_HALF: ret half %dx.rsqrt
12+
// NO_HALF: define noundef float @"?test_rsqrt_half@@YA$halff@$halff@@Z"(
13+
// NO_HALF: %dx.rsqrt = call float @llvm.dx.rsqrt.f32(
14+
// NO_HALF: ret float %dx.rsqrt
15+
half test_rsqrt_half(half p0) { return rsqrt(p0); }
16+
// NATIVE_HALF: define noundef <2 x half> @
17+
// NATIVE_HALF: %dx.rsqrt = call <2 x half> @llvm.dx.rsqrt.v2f16
18+
// NATIVE_HALF: ret <2 x half> %dx.rsqrt
19+
// NO_HALF: define noundef <2 x float> @
20+
// NO_HALF: %dx.rsqrt = call <2 x float> @llvm.dx.rsqrt.v2f32(
21+
// NO_HALF: ret <2 x float> %dx.rsqrt
22+
half2 test_rsqrt_half2(half2 p0) { return rsqrt(p0); }
23+
// NATIVE_HALF: define noundef <3 x half> @
24+
// NATIVE_HALF: %dx.rsqrt = call <3 x half> @llvm.dx.rsqrt.v3f16
25+
// NATIVE_HALF: ret <3 x half> %dx.rsqrt
26+
// NO_HALF: define noundef <3 x float> @
27+
// NO_HALF: %dx.rsqrt = call <3 x float> @llvm.dx.rsqrt.v3f32(
28+
// NO_HALF: ret <3 x float> %dx.rsqrt
29+
half3 test_rsqrt_half3(half3 p0) { return rsqrt(p0); }
30+
// NATIVE_HALF: define noundef <4 x half> @
31+
// NATIVE_HALF: %dx.rsqrt = call <4 x half> @llvm.dx.rsqrt.v4f16
32+
// NATIVE_HALF: ret <4 x half> %dx.rsqrt
33+
// NO_HALF: define noundef <4 x float> @
34+
// NO_HALF: %dx.rsqrt = call <4 x float> @llvm.dx.rsqrt.v4f32(
35+
// NO_HALF: ret <4 x float> %dx.rsqrt
36+
half4 test_rsqrt_half4(half4 p0) { return rsqrt(p0); }
37+
38+
// CHECK: define noundef float @
39+
// CHECK: %dx.rsqrt = call float @llvm.dx.rsqrt.f32(
40+
// CHECK: ret float %dx.rsqrt
41+
float test_rsqrt_float(float p0) { return rsqrt(p0); }
42+
// CHECK: define noundef <2 x float> @
43+
// CHECK: %dx.rsqrt = call <2 x float> @llvm.dx.rsqrt.v2f32
44+
// CHECK: ret <2 x float> %dx.rsqrt
45+
float2 test_rsqrt_float2(float2 p0) { return rsqrt(p0); }
46+
// CHECK: define noundef <3 x float> @
47+
// CHECK: %dx.rsqrt = call <3 x float> @llvm.dx.rsqrt.v3f32
48+
// CHECK: ret <3 x float> %dx.rsqrt
49+
float3 test_rsqrt_float3(float3 p0) { return rsqrt(p0); }
50+
// CHECK: define noundef <4 x float> @
51+
// CHECK: %dx.rsqrt = call <4 x float> @llvm.dx.rsqrt.v4f32
52+
// CHECK: ret <4 x float> %dx.rsqrt
53+
float4 test_rsqrt_float4(float4 p0) { return rsqrt(p0); }

clang/test/SemaHLSL/BuiltIns/frac-errors.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ float2 test_too_many_arg(float2 p0) {
1313

1414
float builtin_bool_to_float_type_promotion(bool p1) {
1515
return __builtin_hlsl_elementwise_frac(p1);
16-
// expected-error@-1 {{1st argument must be a vector, integer or floating point type (was 'bool')}}
16+
// expected-error@-1 {{passing 'bool' to parameter of incompatible type 'float'}}
1717
}
1818

1919
float builtin_frac_int_to_float_promotion(int p1) {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -verify -verify-ignore-unexpected
3+
4+
bool test_too_few_arg() {
5+
return __builtin_hlsl_elementwise_isinf();
6+
// expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
7+
}
8+
9+
bool2 test_too_many_arg(float2 p0) {
10+
return __builtin_hlsl_elementwise_isinf(p0, p0);
11+
// expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
12+
}
13+
14+
bool builtin_bool_to_float_type_promotion(bool p1) {
15+
return __builtin_hlsl_elementwise_isinf(p1);
16+
// expected-error@-1 {passing 'bool' to parameter of incompatible type 'float'}}
17+
}
18+
19+
bool builtin_isinf_int_to_float_promotion(int p1) {
20+
return __builtin_hlsl_elementwise_isinf(p1);
21+
// expected-error@-1 {{passing 'int' to parameter of incompatible type 'float'}}
22+
}
23+
24+
bool2 builtin_isinf_int2_to_float2_promotion(int2 p1) {
25+
return __builtin_hlsl_elementwise_isinf(p1);
26+
// expected-error@-1 {{passing 'int2' (aka 'vector<int, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
27+
}

clang/test/SemaHLSL/BuiltIns/rcp-errors.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ float2 test_too_many_arg(float2 p0) {
1313

1414
float builtin_bool_to_float_type_promotion(bool p1) {
1515
return __builtin_hlsl_elementwise_rcp(p1);
16-
// expected-error@-1 {{1st argument must be a vector, integer or floating point type (was 'bool')}}
16+
// expected-error@-1 {passing 'bool' to parameter of incompatible type 'float'}}
1717
}
1818

1919
float builtin_rcp_int_to_float_promotion(int p1) {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -verify -verify-ignore-unexpected
3+
4+
float test_too_few_arg() {
5+
return __builtin_hlsl_elementwise_rsqrt();
6+
// expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
7+
}
8+
9+
float2 test_too_many_arg(float2 p0) {
10+
return __builtin_hlsl_elementwise_rsqrt(p0, p0);
11+
// expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
12+
}
13+
14+
float builtin_bool_to_float_type_promotion(bool p1) {
15+
return __builtin_hlsl_elementwise_rsqrt(p1);
16+
// expected-error@-1 {{passing 'bool' to parameter of incompatible type 'float'}}
17+
}
18+
19+
float builtin_rsqrt_int_to_float_promotion(int p1) {
20+
return __builtin_hlsl_elementwise_rsqrt(p1);
21+
// expected-error@-1 {{passing 'int' to parameter of incompatible type 'float'}}
22+
}
23+
24+
float2 builtin_rsqrt_int2_to_float2_promotion(int2 p1) {
25+
return __builtin_hlsl_elementwise_rsqrt(p1);
26+
// expected-error@-1 {{passing 'int2' (aka 'vector<int, 2>') to parameter of incompatible type '__attribute__((__vector_size__(2 * sizeof(float)))) float' (vector of 2 'float' values)}}
27+
}

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 492735
19+
#define LLVM_MAIN_REVISION 492744
2020

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

llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class MachOPlatform : public Platform {
6060

6161
struct BuildVersionOpts {
6262

63-
// Derive platform from triple.
64-
static BuildVersionOpts fromTriple(const Triple &TT, uint32_t MinOS,
65-
uint32_t SDK);
63+
// Derive platform from triple if possible.
64+
static std::optional<BuildVersionOpts>
65+
fromTriple(const Triple &TT, uint32_t MinOS, uint32_t SDK);
6666

6767
uint32_t Platform; // Platform.
6868
uint32_t MinOS; // X.Y.Z is encoded in nibbles xxxx.yy.zz

llvm/include/llvm/IR/IntrinsicsDirectX.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ def int_dx_dot :
2929

3030
def int_dx_frac : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
3131

32+
def int_dx_isinf :
33+
DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
34+
[llvm_anyfloat_ty]>;
35+
3236
def int_dx_lerp :
3337
Intrinsic<[LLVMScalarOrSameVectorWidth<0, LLVMVectorElementType<0>>],
3438
[llvm_anyvector_ty, LLVMScalarOrSameVectorWidth<0, LLVMVectorElementType<0>>,LLVMScalarOrSameVectorWidth<0, LLVMVectorElementType<0>>],
@@ -37,4 +41,5 @@ def int_dx_lerp :
3741
def int_dx_imad : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>]>;
3842
def int_dx_umad : DefaultAttrsIntrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>]>;
3943
def int_dx_rcp : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
44+
def int_dx_rsqrt : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
4045
}

0 commit comments

Comments
 (0)