Skip to content

Commit c6f3b88

Browse files
committed
implement feedback
1 parent dda8be4 commit c6f3b88

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6370,15 +6370,8 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
63706370
break;
63716371
}
63726372
case Intrinsic::amdgcn_init_exec_from_input: {
6373-
const Value *InputVal = Call.getOperand(0);
6374-
bool InRegArgFound = false;
6375-
for (const Argument &Arg : Call.getCaller()->args()) {
6376-
if (Arg.hasInRegAttr() && &Arg == InputVal) {
6377-
InRegArgFound = true;
6378-
break;
6379-
}
6380-
}
6381-
Check(InRegArgFound,
6373+
const Argument *Arg = dyn_cast<Argument>(Call.getOperand(0));
6374+
Check(Arg && Arg->hasInRegAttr(),
63826375
"only inreg arguments to the parent function are valid as inputs to "
63836376
"this intrinsic",
63846377
&Call);

llvm/test/Verifier/AMDGPU/intrinsic-amdgpu-init-exec-from-input.ll

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
; RUN: sed -e '/^; MARK$/,$d' %s | not llc -mtriple=amdgcn -mcpu=gfx942 2>&1 | FileCheck %s
2-
; RUN: sed -e '1,/^; MARK$/d' %s | llc -mtriple=amdgcn -mcpu=gfx942 -filetype=null
1+
; RUN: not llvm-as -o /dev/null 2>&1 %s | FileCheck %s
32

43
; Function Attrs: convergent nocallback nofree nounwind willreturn
54
declare void @llvm.amdgcn.init.exec.from.input(i32, i32 immarg) #0
@@ -18,10 +17,3 @@ define amdgpu_ps void @init_exec_from_input_fail_not_inreg(i32 inreg %a, i32 %b)
1817
call void @llvm.amdgcn.init.exec.from.input(i32 %b, i32 0)
1918
ret void
2019
}
21-
22-
; MARK
23-
24-
define amdgpu_ps void @init_exec_from_input_success(i32 inreg %a, i32 %b) {
25-
call void @llvm.amdgcn.init.exec.from.input(i32 %a, i32 0)
26-
ret void
27-
}

0 commit comments

Comments
 (0)