Index: include/clang/Basic/BuiltinsAMDGPU.def =================================================================== --- include/clang/Basic/BuiltinsAMDGPU.def +++ include/clang/Basic/BuiltinsAMDGPU.def @@ -36,6 +36,7 @@ // Instruction builtins. //===----------------------------------------------------------------------===// BUILTIN(__builtin_amdgcn_s_barrier, "v", "n") +BUILTIN(__builtin_amdgcn_s_wave_barrier, "v", "n") BUILTIN(__builtin_amdgcn_div_scale, "dddbb*", "n") BUILTIN(__builtin_amdgcn_div_scalef, "fffbb*", "n") BUILTIN(__builtin_amdgcn_div_fmas, "ddddb", "nc") Index: test/CodeGenOpenCL/builtins-amdgcn.cl =================================================================== --- test/CodeGenOpenCL/builtins-amdgcn.cl +++ test/CodeGenOpenCL/builtins-amdgcn.cl @@ -270,6 +270,13 @@ __builtin_amdgcn_s_barrier(); } +// CHECK-LABEL: @test_s_wave_barrier +// CHECK: call void @llvm.amdgcn.s.wave.barrier( +void test_s_wave_barrier() +{ + __builtin_amdgcn_s_wave_barrier(); +} + // CHECK-LABEL: @test_s_memtime // CHECK: call i64 @llvm.amdgcn.s.memtime() void test_s_memtime(global ulong* out)