Skip to content

Commit f6f7ab5

Browse files
committed
Fixed formatting, missing hlsl prefix in the builtin, and reflected the naming changes in the intrinsics
1 parent 628e7d8 commit f6f7ab5

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

clang/include/clang/Basic/Builtins.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4831,7 +4831,7 @@ def HLSLRadians : LangBuiltin<"HLSL_LANG"> {
48314831
}
48324832

48334833
def HLSLGroupMemoryBarrierWithGroupSync: LangBuiltin<"HLSL_LANG"> {
4834-
let Spellings = ["__builtin_group_memory_barrier_with_group_sync"];
4834+
let Spellings = ["__builtin_hlsl_group_memory_barrier_with_group_sync"];
48354835
let Attributes = [NoThrow, Const];
48364836
let Prototype = "void(...)";
48374837
}

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18901,8 +18901,9 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
1890118901
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef<Value *>{Op0},
1890218902
nullptr, "hlsl.radians");
1890318903
}
18904-
case Builtin::BI__builtin_group_memory_barrier_with_group_sync: {
18905-
Intrinsic::ID ID = CGM.getHLSLRuntime().getGroupMemoryBarrierWithGroupSyncIntrinsic();
18904+
case Builtin::BI__builtin_hlsl_group_memory_barrier_with_group_sync: {
18905+
Intrinsic::ID ID =
18906+
CGM.getHLSLRuntime().getGroupMemoryBarrierWithGroupSyncIntrinsic();
1890618907
return EmitRuntimeCall(Intrinsic::getDeclaration(&CGM.getModule(), ID));
1890718908
}
1890818909
}

clang/lib/CodeGen/CGHLSLRuntime.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ class CGHLSLRuntime {
8989
GENERATE_HLSL_INTRINSIC_FUNCTION(SDot, sdot)
9090
GENERATE_HLSL_INTRINSIC_FUNCTION(UDot, udot)
9191
GENERATE_HLSL_INTRINSIC_FUNCTION(WaveIsFirstLane, wave_is_first_lane)
92-
GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync, groupMemoryBarrierWithGroupSync)
92+
GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync,
93+
group_memory_barrier_with_group_sync)
9394

9495
//===----------------------------------------------------------------------===//
9596
// End of reserved area for HLSL intrinsic getters.

clang/lib/Headers/hlsl/hlsl_intrinsics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@ float4 radians(float4);
21772177
/// accesses have been completed and all threads in the group have reached this
21782178
/// call.
21792179

2180-
_HLSL_BUILTIN_ALIAS(__builtin_group_memory_barrier_with_group_sync)
2180+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_group_memory_barrier_with_group_sync)
21812181
void GroupMemoryBarrierWithGroupSync(void);
21822182

21832183
} // namespace hlsl

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2018,7 +2018,7 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
20182018
return true;
20192019
break;
20202020
}
2021-
case Builtin::BI__builtin_group_memory_barrier_with_group_sync: {
2021+
case Builtin::BI__builtin_hlsl_group_memory_barrier_with_group_sync: {
20222022
if (SemaRef.checkArgCountAtMost(TheCall, 0))
20232023
return true;
20242024
break;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected
22

33
void test_too_many_arg() {
4-
__builtin_group_memory_barrier_with_group_sync(0);
4+
__builtin_hlsl_group_memory_barrier_with_group_sync(0);
55
// expected-error@-1 {{too many arguments to function call, expected at most 0, have 1}}
66
}

clang/test/CodeGenHLSL/builtins/GroupMemoryBarrierWithGroupSync.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
// CHECK-DXIL: define void @
1111
// CHECK-SPIRV: define spir_func void @
1212
void test_GroupMemoryBarrierWithGroupSync() {
13-
// CHECK: call void @llvm.[[TARGET]].groupMemoryBarrierWithGroupSync()
13+
// CHECK: call void @llvm.[[TARGET]].group.memory.barrier.with.group.sync()
1414
GroupMemoryBarrierWithGroupSync();
1515
}
1616

17-
// CHECK: declare void @llvm.[[TARGET]].groupMemoryBarrierWithGroupSync() #[[ATTRS:[0-9]+]]
17+
// CHECK: declare void @llvm.[[TARGET]].group.memory.barrier.with.group.sync() #[[ATTRS:[0-9]+]]
1818
// CHECK-NOT: attributes #[[ATTRS]] = {{.+}}memory(none){{.+}}
1919
// CHECK: attributes #[[ATTRS]] = {

0 commit comments

Comments
 (0)