[llvm] Verify threadlocal_address constraints (PR #87841)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 5 17:06:22 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Matthias Braun (MatzeB)
<details>
<summary>Changes</summary>
Check invariants for `llvm.threadlocal.address` intrinsic in IR Verifier.
---
Full diff: https://github.com/llvm/llvm-project/pull/87841.diff
1 Files Affected:
- (modified) llvm/lib/IR/Verifier.cpp (+8)
``````````diff
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 64c59914cf2fc2..ac3d13f3d2b057 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -6223,6 +6223,14 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
&Call);
break;
}
+ case Intrinsic::threadlocal_address: {
+ const Value &Arg0 = *Call.getArgOperand(0);
+ Check(isa<GlobalVariable>(Arg0),
+ "llvm.threadlocal.address first argument must be a GlobalVariable");
+ Check(cast<GlobalVariable>(Arg0).isThreadLocal(),
+ "llvm.threadlocal.address operand isThreadLocal() must no be false");
+ break;
+ }
};
// Verify that there aren't any unmediated control transfers between funclets.
``````````
</details>
https://github.com/llvm/llvm-project/pull/87841
More information about the llvm-commits
mailing list