Intrinsic with sideeffect is optimized out

I agree that not all side effects are memory related. I literally bring this up a lot. That said, a boolean “has side effect” attribute is not sufficient (IMHO). As for memory, we should acknowledge the different kinds of side effects and group them together in an extensible way. This doesn’t have to be an attribute like memory but could just be the APIs we expose internally. Existing side effects we have right now that are not memory include termination and cross-lane register accesses. Thus, we already have two and probably will encounter more kinds as we go. (I do not include the “thread id” stuff as it should be a memory category (e.g., TLS).) Once memory landed we can revisit this discussion but I hope we end up with a similar side-effect([category]+) attribute that we can use to fix some pesky bugs and enable more optimizations in the process.