[llvm-dev] LLVM doesn't appear to use invariant.start/invariant.end to remove dead stores

Chris Elrod via llvm-dev llvm-dev at lists.llvm.org
Fri May 14 01:37:02 PDT 2021


Am I using invariant.start/invariant.end wrong here?

The linked godbolt contains LLVM IR that:
1. calls `invariant.start` on 4 invariant pointers.
2. loads from 2 of them.
3. stores into a 5th pointer.
4. loads from the remaining 2 pointers.
5. stores into the same addresses of the 5th pointer.
6. 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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210514/25438200/attachment.html>

More information about the llvm-dev mailing list