Skip to content

Commit 759d9cd

Browse files
committed
Fixed formatting, missing hlsl prefix in the builtin, and reflected the naming changes in the intrinsics
1 parent bff904d commit 759d9cd

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
@@ -4925,7 +4925,7 @@ def HLSLClip: LangBuiltin<"HLSL_LANG"> {
49254925
}
49264926

49274927
def HLSLGroupMemoryBarrierWithGroupSync: LangBuiltin<"HLSL_LANG"> {
4928-
let Spellings = ["__builtin_group_memory_barrier_with_group_sync"];
4928+
let Spellings = ["__builtin_hlsl_group_memory_barrier_with_group_sync"];
49294929
let Attributes = [NoThrow, Const];
49304930
let Prototype = "void(...)";
49314931
}

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19446,8 +19446,9 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
1944619446
assert(E->getArg(0)->getType()->hasFloatingRepresentation() &&
1944719447
"clip operands types mismatch");
1944819448
return handleHlslClip(E, this);
19449-
case Builtin::BI__builtin_group_memory_barrier_with_group_sync: {
19450-
Intrinsic::ID ID = CGM.getHLSLRuntime().getGroupMemoryBarrierWithGroupSyncIntrinsic();
19449+
case Builtin::BI__builtin_hlsl_group_memory_barrier_with_group_sync: {
19450+
Intrinsic::ID ID =
19451+
CGM.getHLSLRuntime().getGroupMemoryBarrierWithGroupSyncIntrinsic();
1945119452
return EmitRuntimeCall(Intrinsic::getDeclaration(&CGM.getModule(), ID));
1945219453
}
1945319454
}

clang/lib/CodeGen/CGHLSLRuntime.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ class CGHLSLRuntime {
103103

104104
GENERATE_HLSL_INTRINSIC_FUNCTION(CreateHandleFromBinding, handle_fromBinding)
105105
GENERATE_HLSL_INTRINSIC_FUNCTION(BufferUpdateCounter, bufferUpdateCounter)
106-
GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync, groupMemoryBarrierWithGroupSync)
106+
GENERATE_HLSL_INTRINSIC_FUNCTION(GroupMemoryBarrierWithGroupSync,
107+
group_memory_barrier_with_group_sync)
107108

108109
//===----------------------------------------------------------------------===//
109110
// 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
@@ -2490,7 +2490,7 @@ float4 radians(float4);
24902490
/// accesses have been completed and all threads in the group have reached this
24912491
/// call.
24922492

2493-
_HLSL_BUILTIN_ALIAS(__builtin_group_memory_barrier_with_group_sync)
2493+
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_group_memory_barrier_with_group_sync)
24942494
void GroupMemoryBarrierWithGroupSync(void);
24952495

24962496
} // namespace hlsl

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
22402240
return true;
22412241
}
22422242
}
2243-
case Builtin::BI__builtin_group_memory_barrier_with_group_sync: {
2243+
case Builtin::BI__builtin_hlsl_group_memory_barrier_with_group_sync: {
22442244
if (SemaRef.checkArgCountAtMost(TheCall, 0))
22452245
return true;
22462246
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)