[PATCH] D98391: [InstSimplify] Propagate AllowRefinement info from SimplifyWithOpReplaced

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 06:17:58 PDT 2021


aqjune added a comment.

Does this direction look okay? @nikic 
One benefit of this approach is that it detects unsafe replacements that have non-poison-creating instructions as well.
For example, this transformation is illegal:

    %v = select (x == 0), 0, (x & y)
  =>
    %v = x & y

If x = 0 and y was poison this makes the result more undefined. However, the current check relying on canCreatePoison cannot detect this.
D98585 <https://reviews.llvm.org/D98585> fixes this by making the relevant transformation respect `Q.AllowRefinement`.

This change is about making the existing check safer than before: if the change causes a problem with generating optimal code I'll look into it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98391



More information about the llvm-commits mailing list