On 12/12/2021 3:49 AM, Jan Hubicka via Gcc-patches wrote:
Hi,
As discussed in the PR, we miss some optimization becuase
gimple-ssa-isolate-paths turns NULL memory accesses to volatile and adds
__builtin_trap after them.  This is seen as a side-effect by IPA analysis
and additionally the (fully unreachable) builtin_trap is believed to load
all global memory.

I think we should think of less intrusive gimple representation of this, but
it is also easy enough to special case that in IPA analysers as done in
this patch.  This is a win even if we improve the representation since
gimple-ssa-isolate-paths is run late and this way we improve optimization
early.
So what's important about the IR representation is that we keep some kind of memory access around (so that it will fault), that the memory access reference a minimal amount of other stuff (we don't want the address computation to keep anything live for example) and that we have a subsequent trap so that the CFG routines know it traps.

Otherwise we're free to do whatever we want.

jeff

Reply via email to