Am I using invariant.start/invariant.end wrong here?
The linked godbolt contains LLVM IR that:
invariant.starton 4 invariant pointers.
loads from 2 of them.
stores into a 5th pointer.
loads from the remaining 2 pointers.
stores into the same addresses of the 5th pointer.
invariant.endon the 4 pointers.
I would expect LLVM to be able to eliminate “3.”.
Is LLVM not able to follow through the bitcasts and addrspace casts? I could try and come up with a cleaner example.
Also, is there a better place to ask questions like this?