Because I remove all invariant.group.barrier's in CodeGenPrepare, I also want to remove invariant.group metadata. After removing all invariant.barriers it would be invalid to optimize based on invariant.group metadata, so I don't want to leave trap for future programmer.
Ok, that helps, but *why* are you removing all the
invariant.group.barriers? Is that just an implementation detail? Or is
it something fundamental? In either case, the code in CGP should
include comments which clarify this.
Because that what CodeGenPrepare is for right?
Because invariant.group.barrier is just intrinsic for optimizations purposes (like most of them if not all) we don't want to have calls to intrinsics functions in binaries,
so we remove all intrinsics in CodeGenPrepare.