[llvm] GlobalOpt: Handle threadlocal.address intrinsic (PR #88454)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 14:04:58 PDT 2024


================
@@ -172,9 +172,20 @@ static bool analyzeGlobalAux(const Value *V, GlobalStatus &GS,
           return true;
         GS.StoredType = GlobalStatus::Stored;
       } else if (const auto *CB = dyn_cast<CallBase>(I)) {
-        if (!CB->isCallee(&U))
-          return true;
-        GS.IsLoaded = true;
+        bool KnownIntrinsic = false;
+        if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(I)) {
+          if (II->getIntrinsicID() == Intrinsic::threadlocal_address &&
+              II->getArgOperand(0) == V) {
----------------
MatzeB wrote:

I was contemplating whether there could be operand bundles. But that probably isn't really a thing for this intrinsic, removing the check.

https://github.com/llvm/llvm-project/pull/88454


More information about the llvm-commits mailing list