[llvm-dev] [InstCombine] Addrspacecast and GEP assumed commutative

Thomas Faingnaert via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 24 05:50:22 PDT 2020

It appears that this behaviour of InstCombine is at least somewhat intended, as there are several tests that fail after the change mentioned before: cast.ll, gep-addrspace.ll and getelementptr.ll in test/Transforms/InstCombine.
I feel a little uncomfortable applying the patch after knowing this, and removing those tests doesn't seem like a great solution.
What are your thoughts?

For now, I think I can work around my original issue since the CUDA driver seems to optimise away the additional ADD in most cases.

Van: Matt Arsenault <whatmannerofburgeristhis at gmail.com> namens Matt Arsenault <arsenm2 at gmail.com>
Verzonden: maandag 23 maart 2020 19:05
Aan: Thomas Faingnaert <thomas.faingnaert at hotmail.com>
CC: Johannes Doerfert <johannesdoerfert at gmail.com>; llvm-dev at lists.llvm.org <llvm-dev at lists.llvm.org>
Onderwerp: Re: [llvm-dev] [InstCombine] Addrspacecast and GEP assumed commutative

On Mar 23, 2020, at 10:52, Thomas Faingnaert via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:

Would replacing this by stripPointerCastsSameRepresentation be an acceptable solution, or do other parts of LLVM rely on this reordering?
If not, I can send a patch in Phabricator to address this issue.

This is probably the right solution. Nothing should be relying on this anyway

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

More information about the llvm-dev mailing list