================
@@ -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 ||
+ II->getIntrinsicID() == Intrinsic::lifetime_end)
+ continue;
+ if (!ProtectedFieldDisc)
+ ProtectedFieldDisc = S.ProtectedFieldDisc;
+ if (*ProtectedFieldDisc != S.ProtectedFieldDisc)
----------------
pcc wrote:
Yes, the `mixed` function in
`llvm/test/Transforms/SROA/protected-field-pointer.ll` has a case where
`ProtectedFieldDisc` is `nullptr` and `%protptrptr1.2`.
https://github.com/llvm/llvm-project/pull/151650
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits