During store promotion, we check whether the pointer was captured to exclude potential reads from other threads. However, we're only interested in captures before or inside the loop. Check this using PointerMayBeCapturedBefore against the loop header.
I'm not seeing any compile-time impact on CTMark for this change.
I'd suggest inlining this helper into it's sole caller and simply updating the existing block comment. (Optional.)