Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions llvm/lib/IR/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6370,15 +6370,8 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
break;
}
case Intrinsic::amdgcn_init_exec_from_input: {
const Value *InputVal = Call.getOperand(0);
bool InRegArgFound = false;
for (const Argument &Arg : Call.getCaller()->args()) {
if (Arg.hasInRegAttr() && &Arg == InputVal) {
InRegArgFound = true;
break;
}
}
Check(InRegArgFound,
const Argument *Arg = dyn_cast<Argument>(Call.getOperand(0));
Check(Arg && Arg->hasInRegAttr(),
"only inreg arguments to the parent function are valid as inputs to "
"this intrinsic",
&Call);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; RUN: sed -e '/^; MARK$/,$d' %s | not llc -mtriple=amdgcn -mcpu=gfx942 2>&1 | FileCheck %s
; RUN: sed -e '1,/^; MARK$/d' %s | llc -mtriple=amdgcn -mcpu=gfx942 -filetype=null
; RUN: not llvm-as -o /dev/null 2>&1 %s | FileCheck %s

; Function Attrs: convergent nocallback nofree nounwind willreturn
declare void @llvm.amdgcn.init.exec.from.input(i32, i32 immarg) #0
Expand All @@ -18,10 +17,3 @@ define amdgpu_ps void @init_exec_from_input_fail_not_inreg(i32 inreg %a, i32 %b)
call void @llvm.amdgcn.init.exec.from.input(i32 %b, i32 0)
ret void
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also test a case where it's not an argument (try one with a constant and one with an instruction)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I added another check for the case that the operand is an instruction!
Isn't the constant case covered by the first function?


; MARK

define amdgpu_ps void @init_exec_from_input_success(i32 inreg %a, i32 %b) {
call void @llvm.amdgcn.init.exec.from.input(i32 %a, i32 0)
ret void
}
Loading