[llvm] [Remarks] Emit SROA and mem2reg missed remarks (PR #221094)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 9 14:59:55 PDT 2026
================
@@ -6159,6 +6179,24 @@ bool SROA::propagateStoredValuesToLoads(AllocaInst &AI, AllocaSlices &AS) {
return true;
}
+/// Report an aggregate allocation that slice analysis could not take apart.
+/// Only aggregates are reported: an escaping scalar alloca is not a missed
+/// splitting opportunity. The remark is anchored at the blocking use rather
+/// than the alloca, because that use is what the user can act on.
+static void reportAllocaNotSplit(const AllocaInst &AI, const AllocaSlices &AS,
+ OptimizationRemarkEmitter *ORE) {
+ if (!ORE || !AI.getAllocatedType()->isAggregateType())
----------------
efriedma-quic wrote:
This doesn't match how SROA actually works... whether we can split is mostly independent of the result of getAllocatedType().
https://github.com/llvm/llvm-project/pull/221094
More information about the llvm-commits
mailing list