[PATCH] D29011: [IR] Add Freeze instruction

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 04:43:53 PDT 2019


lebedev.ri added a comment.

In D29011#1697170 <https://reviews.llvm.org/D29011#1697170>, @aqjune wrote:

> > should there be a constantexpr freeze
>
> Yep, constantexpr freeze makes sense, as freeze is a scalar operation (like fneg). :)


See inline comments then :)

>> and should freeze be fully type-agnostic, like it is stated in D29121 <https://reviews.llvm.org/D29121>?
> 
> I think this is a hard question, especially due to the existence of the undef pointer.
>  A pointer value tracks which memory block it is pointing to. If `freeze i8* undef` is defined to yield a random pointer to any pre-defined memory block, this will limit free moving of freeze, e.g:
> 
>   p = malloc() // p is created
>   ptr0 = freeze i8* undef // ptr0 can point to block p
>   =>
>   ptr0 = freeze i8* undef // ptr0 can't point to block p, because p is not allocated yet
>   p = malloc()

I guess D29121 <https://reviews.llvm.org/D29121> needs to explicitly single-out the pointers then.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D29011/new/

https://reviews.llvm.org/D29011





More information about the llvm-commits mailing list