topperc wrote: I'm a bit surprised this code works. Shouldn't the new node have tried to CSE with the original node? I thought that would intersect the flags causing the new flags to be dropped. https://github.com/llvm/llvm-project/pull/91239