Many cases check post_loop_opts(), when they should actually be checking allow_macro_nodes(), introduced in https://github.com/openjdk/jdk/pull/18824. Usually, allow_macro_nodes -> post_loop_opts, but this breaks in Shenandoah optimizations https://github.com/openjdk/jdk/blob/040c93565c0dff6270911eb9e58d78aa01bbb925/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp#L52. https://bugs.openjdk.org/browse/JDK-8329797 reveals a case.
We should go through the checks of post_loop_opts(), and see if they should instead be allow_macro_nodes(). This would help readability and would prevent introducing bugs.
A non-exhaustive list of examples that should probably be changed:
* https://github.com/openjdk/jdk/blob/040c93565c0dff6270911eb9e58d78aa01bbb925/src/hotspot/share/opto/cfgnode.cpp#L1571
* https://github.com/openjdk/jdk/blob/040c93565c0dff6270911eb9e58d78aa01bbb925/src/hotspot/share/opto/graphKit.cpp#L2904
* https://github.com/openjdk/jdk/blob/040c93565c0dff6270911eb9e58d78aa01bbb925/src/hotspot/share/opto/movenode.cpp#L277