[PATCH] D58633: [InstCombine] remove one-use restriction for icmp+add constant fold

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 13 06:45:55 PDT 2019


nikic added a comment.

There's a similar one use check for the non-equality case in https://github.com/llvm-mirror/llvm/blob/fb1e04ff3c51a617c4944b2e05e8aa1b8c543e22/lib/Transforms/InstCombine/InstCombineCompares.cpp#L2389. This prevents the trivially true condition in https://rust.godbolt.org/z/qg0RjC from folding. That check was added (or rather moved) in rL341831 <https://reviews.llvm.org/rL341831>.

Just wanted to add this as a datapoint for a case where dropping the restriction would be nice.


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

https://reviews.llvm.org/D58633





More information about the llvm-commits mailing list