Skip to content

Commit 92b344f

Browse files
committed
Add address space verifier check
1 parent 778502b commit 92b344f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6527,6 +6527,14 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
65276527
&Call);
65286528
break;
65296529
}
6530+
case Intrinsic::thread_pointer: {
6531+
Check(Call.getType()->getPointerAddressSpace() ==
6532+
DL.getDefaultGlobalsAddressSpace(),
6533+
"llvm.thread.pointer intrinsic return type must be for the globals "
6534+
"address space",
6535+
&Call);
6536+
break;
6537+
}
65306538
case Intrinsic::threadlocal_address: {
65316539
const Value &Arg0 = *Call.getArgOperand(0);
65326540
Check(isa<GlobalValue>(Arg0),

0 commit comments

Comments
 (0)