llvm-project/llvm/lib/Transforms
Huihui Zhang a4dd98f2e9 [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
2019-09-24 00:30:09 +00:00
..
AggressiveInstCombine Change TargetLibraryInfo analysis passes to always require Function 2019-09-07 03:09:36 +00:00
Coroutines [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Hello Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IPO HotColdSplitting: invalidate the AssumptionCache on split 2019-09-23 22:23:01 +00:00
InstCombine [InstCombine] Fold a shifty implementation of clamp-to-allones. 2019-09-24 00:30:09 +00:00
Instrumentation [AddressSanitizer] Don't dereference dyn_cast<ConstantInt> results. NFCI. 2019-09-20 20:52:21 +00:00
ObjCARC [ObjC][ARC] Skip debug instructions when computing the insert point of 2019-09-19 20:58:51 +00:00
Scalar [LSR] Silence static analyzer null dereference warnings with assertions. NFCI. 2019-09-22 17:59:24 +00:00
Utils [SLC] Convert some strndup calls to strdup calls 2019-09-23 18:20:01 +00:00
Vectorize [SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!") 2019-09-23 16:25:03 +00:00
CMakeLists.txt Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00