diff options
author | Huihui Zhang <huihuiz@quicinc.com> | 2019-09-24 00:30:09 +0000 |
---|---|---|
committer | Huihui Zhang <huihuiz@quicinc.com> | 2019-09-24 00:30:09 +0000 |
commit | a4dd98f2e90b2916fd347020c70ba804c5557db1 (patch) | |
tree | 501f6dc5ff9bf1eeff5aabde2ddc97c83bee5b8f /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | c41dba992957b89c77ff2ccb7909ff1254fa3f65 (diff) | |
download | bcm5719-llvm-a4dd98f2e90b2916fd347020c70ba804c5557db1.tar.gz bcm5719-llvm-a4dd98f2e90b2916fd347020c70ba804c5557db1.zip |
[InstCombine] Fold a shifty implementation of clamp-to-allones.
Summary:
Fold
or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X)
into
X s> Y ? -1 : X
https://rise4fun.com/Alive/d8Ab
clamp255 is a common operator in image processing, can be implemented
in a shifty way "(255 - X) >> 31 | X & 255". Fold shift into select
enables more optimization, e.g., vmin generation for ARM target.
Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon
Reviewed By: lebedev.ri
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67800
llvm-svn: 372678
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions