Hi,
Am I using invariant.start/invariant.end wrong here?
https://godbolt.org/z/Ed1T3bf5Y
The linked godbolt contains LLVM IR that:
-
calls
invariant.start
on 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.
-
calls
invariant.end
on 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?
Thanks,
Chris