[PATCH] D29011: [IR] Add Freeze instruction

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 04:25:37 PDT 2019


aqjune added a comment.

> should there be a constantexpr freeze

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

> 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()


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

https://reviews.llvm.org/D29011





More information about the llvm-commits mailing list