<div dir="ltr"><div>Hi,</div><div><br></div><div>Am I using invariant.start/invariant.end wrong here?</div><div><a href="https://godbolt.org/z/Ed1T3bf5Y">https://godbolt.org/z/Ed1T3bf5Y</a></div><div><br></div><div>The linked godbolt contains LLVM IR that:</div><div>1. calls `invariant.start` on 4 invariant pointers.<br></div><div>2. loads from 2 of them.</div><div>3. stores into a 5th pointer.</div><div>4. loads from the remaining 2 pointers.</div><div>5. stores into the same addresses of the 5th pointer.</div><div>6. calls `invariant.end` on the 4 pointers.<br></div><div><br></div><div>I would expect LLVM to be able to eliminate "3.".</div><div>Is LLVM not able to follow through the bitcasts and addrspace casts? I could try and come up with a cleaner example.<br></div><div><br></div><div>Also, is there a better place to ask questions like this?<br></div><div><br></div><div>Thanks,</div><div>Chris<br></div></div>