[PATCH] D29014: [SelDag][MIR] Add FREEZE

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 21:39:31 PST 2019


aqjune marked an inline comment as done.
aqjune added inline comments.


================
Comment at: llvm/include/llvm/Target/Target.td:1067
+  let hasNoSchedulingInfo = 1;
+  let isNotDuplicable = 1;
+}
----------------
arsenm wrote:
> Why isNotDuplicable? I don't think this is the best maintained instruction property
It is because different freeze defs can yield different values. For example, consider following transformation:
```
%undef = IMPLICIT_DEF
%x = FREEZE %undef
use(%x)
use(%x) // these two uses should see the same freezed value
->
%undef = IMPLICIT_DEF
%x = FREEZE %undef
use(%x)
%x' = FREEZE %undef
use(%x') // It is possible that %x and %x' are assigned differently freezed values.
```
This transformation is incorrect, because use()s after the transformation can see different values.
To prevent this class of optimizations, isNotDuplicable is set to 1.


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

https://reviews.llvm.org/D29014





More information about the llvm-commits mailing list