[PATCH] D107822: [InstCombine] Fold Int2Ptr/PtrToInt if the ptr is dereferenceable
Nuno Lopes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 20 08:17:51 PDT 2021
nlopes added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:348
+ }
+ // Vector to find out all target users of roundtrip (int2ptr/ptr2int) cast
+ // which are dominated by load/store instruction of same address as of
----------------
aqjune wrote:
> Then, what do you think about adding a nofree check at this point? @nlopes
>
> Let's check whether CI's function has a nofree attribute. The checking will be fairly simple.
> ```
> define void @test(i8* %X, i8* %Y, i8* %Z) *nofree* {
> ...
> }
> ```
Well, nofree is still not very common. Which would render this optimization useless. Plus it would be unnecessary (and restrictive) to check once `isDereferenceableAndAlignedPointer` is fixed.
Maybe what we need is a bug report for `isDereferenceableAndAlignedPointer` as it seems Philip abandoned the work on nofree.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107822/new/
https://reviews.llvm.org/D107822
More information about the llvm-commits
mailing list