[PATCH] D71312: [InstCombine] Fold X / abs(X) to X < 0 ? -1 : 1

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 16:46:12 PST 2019


craig.topper added a comment.

Isn't it sufficient to just check that the true/false values of the select are x and -x. The condition itself doesn't matter.   x / (select c, x, -x) ->  select c ? 1 : -1


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71312





More information about the llvm-commits mailing list