[PATCH] D12703: [InstCombine] Optimize icmp slt signum(x), 1 --> icmp sle x, 0.
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 16 10:41:28 PDT 2015
majnemer added a comment.
Test cases seem a little bigger than they need to be. Why not just have the functions return the `i1` result.
================
Comment at: include/llvm/IR/PatternMatch.h:1289-1293
@@ +1288,7 @@
+ //
+ // signum(x) == (x >> 63) | (-x >>> 63)
+ //
+ // An i1 value is its own signum, so it's correct to match
+ //
+ // signum(x) == (x >> 0) | (-x >>> 0)
+ //
----------------
We don't use the terminology `>>>` in LLVM. I think it is more common to see `>>u`.
http://reviews.llvm.org/D12703
More information about the llvm-commits
mailing list