[llvm-branch-commits] SROA: Recognize llvm.protected.field.ptr intrinsics. (PR #151650)

Florian Mayer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 4 15:23:56 PST 2025


================
@@ -5875,6 +5895,32 @@ SROA::runOnAlloca(AllocaInst &AI) {
     return {Changed, CFGChanged};
   }
 
+  for (auto &P : AS.partitions()) {
+    std::optional<Value *> ProtectedFieldDisc;
+    // For now, we can't split if a field is accessed both via protected
+    // field and not.
+    for (Slice &S : P) {
+      if (auto *II = dyn_cast<IntrinsicInst>(S.getUse()->getUser()))
+        if (II->getIntrinsicID() == Intrinsic::lifetime_start ||
----------------
fmayer wrote:

optional: do you think it would be better to share this logic between the two loops in a lambda?

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


More information about the llvm-branch-commits mailing list