Skip to content

Commit b52dc1c

Browse files
committed
IRVerifier: Allow GlobalValue as llvm.threadlocal.address operand
1 parent c258f57 commit b52dc1c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

llvm/docs/LangRef.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28130,7 +28130,8 @@ Syntax:
2813028130
Arguments:
2813128131
""""""""""
2813228132

28133-
The first argument is a thread local :ref:`global variable <globalvars>`.
28133+
The `llvm.threadlocal.address` intrinsic requires a global value argument (a
28134+
:ref:`global variable <globalvars>` or alias) that is thread local.
2813428135

2813528136
Semantics:
2813628137
""""""""""

llvm/lib/IR/Verifier.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6226,10 +6226,10 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
62266226
}
62276227
case Intrinsic::threadlocal_address: {
62286228
const Value &Arg0 = *Call.getArgOperand(0);
6229-
Check(isa<GlobalVariable>(Arg0),
6230-
"llvm.threadlocal.address first argument must be a GlobalVariable");
6231-
Check(cast<GlobalVariable>(Arg0).isThreadLocal(),
6232-
"llvm.threadlocal.address operand isThreadLocal() must no be false");
6229+
Check(isa<GlobalValue>(Arg0),
6230+
"llvm.threadlocal.address first argument must be a GlobalValue");
6231+
Check(cast<GlobalValue>(Arg0).isThreadLocal(),
6232+
"llvm.threadlocal.address operand isThreadLocal() must be true");
62336233
break;
62346234
}
62356235
};

0 commit comments

Comments
 (0)