[PATCH] D85533: [InstCombine] Optimize select(freeze(icmp eq/ne x, y), x, y)
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 7 13:30:28 PDT 2020
nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2540
+ // The freeze should be only used by this select. Otherwise, remaining uses of
+ // the freeze can observe a contradictory value.
+ // c = freeze(x == y) ; Let's assume that y = poison & x = 42; c is 0 or 1
----------------
I agree the one-use check is necessary, but weirdly alive doesn't seem to require it: https://alive2.llvm.org/ce/z/hzwzM_
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85533/new/
https://reviews.llvm.org/D85533
More information about the llvm-commits
mailing list