1 ; RUN: llc < %s -march=nvptx64 -O2 -mcpu=sm_52 -mattr=+ptx62 | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_52 -mattr=+ptx62 | %ptxas-verify %}
4 declare i32 @llvm.nvvm.activemask()
6 ; CHECK-LABEL: activemask(
8 ; CHECK: activemask.b32 %[[REG:.+]];
9 ; CHECK-NEXT: st.param.b32 [func_retval0+0], %[[REG]];
11 define dso_local i32 @activemask() {
13 %mask = call i32 @llvm.nvvm.activemask()
17 ; CHECK-LABEL: convergent(
19 ; CHECK: activemask.b32 %[[REG:.+]];
20 ; CHECK: activemask.b32 %[[REG]];
21 ; CHECK: .param.b32 [func_retval0+0], %[[REG]];
23 define dso_local i32 @convergent(i1 %cond) {
25 br i1 %cond, label %if.else, label %if.then
28 %0 = call i32 @llvm.nvvm.activemask()
32 %1 = call i32 @llvm.nvvm.activemask()
36 %mask = phi i32 [ %0, %if.then ], [ %1, %if.else ]