aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-09-16 20:41:29 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-09-16 20:41:29 +0000
commite5f4889ba9468dea349ea36417ceab28444fb52a (patch)
treeaa08aafec669671cf67679275bf97c34fcc80b43 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent3e9d733e687828a79027403b9ad3da97e8074c44 (diff)
downloadllvm-e5f4889ba9468dea349ea36417ceab28444fb52a.zip
llvm-e5f4889ba9468dea349ea36417ceab28444fb52a.tar.gz
llvm-e5f4889ba9468dea349ea36417ceab28444fb52a.tar.bz2
[InstCombine] Optimize icmp slt signum(x), 1 --> icmp slt x, 1
Summary: `signum(x)` is sometimes implemented as `(x >> 63) | (-x >>> 63)` (for an `i64` `x`). This change adds a matcher for that pattern, and an instcombine rule to optimize `signum(x) s< 1`. Later, we can also consider optimizing: icmp slt signum(x), 0 --> icmp slt x, 0 icmp sle signum(x), 1 --> true etc. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12703 llvm-svn: 247846
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions