hanchenye-llvm-project/llvm/lib/Transforms/InstCombine
Sanjay Patel 9530f18864 [InstCombine] (X << Y) / X -> 1 << Y
...when the shift is known to not overflow with the matching
signed-ness of the division.

This closes an optimization gap caused by canonicalizing mul
by power-of-2 to shl as shown in PR35709:
https://bugs.llvm.org/show_bug.cgi?id=35709

Patch by Anton Bikineev!

Differential Revision: https://reviews.llvm.org/D42032

llvm-svn: 323068
2018-01-21 16:14:51 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
InstCombineAddSub.cpp [InstCombine] canonicalize constant-minus-boolean to select-of-constants 2017-12-06 21:22:57 +00:00
InstCombineAndOrXor.cpp [InstCombine] canonicalize shifty abs(): ashr+add+xor --> cmp+neg+sel 2017-12-16 16:41:17 +00:00
InstCombineCalls.cpp Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
InstCombineCasts.cpp [InstCombine] include 'sub' in the list of narrow-able binops 2017-11-16 14:40:51 +00:00
InstCombineCompares.cpp [InstCombine] weaken assertions for icmp folds (PR35846) 2018-01-09 18:56:03 +00:00
InstCombineInternal.h Create instruction classes for identifying any atomicity of memory intrinsic. (NFC) 2017-10-30 19:51:48 +00:00
InstCombineLoadStoreAlloca.cpp Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
InstCombineMulDivRem.cpp [InstCombine] (X << Y) / X -> 1 << Y 2018-01-21 16:14:51 +00:00
InstCombinePHI.cpp Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
InstCombineSelect.cpp [InstCombine] Make foldSelectOpOp able to handle two-operand getelementptr 2018-01-19 10:05:15 +00:00
InstCombineShifts.cpp [InstCombine] Check for out of range ashr values using APInt before calling getZExtValue 2018-01-09 14:23:46 +00:00
InstCombineSimplifyDemanded.cpp [InstCombine] fix demanded-bits propagation for zext/trunc 2018-01-17 14:39:28 +00:00
InstCombineVectorOps.cpp [InstCombine] Gracefully handle out of range extractelement indices 2017-12-27 12:00:18 +00:00
InstructionCombining.cpp [PM][InstCombine] fixing omission of AliasAnalysis in new-pass-manager's version of InstCombine 2017-12-14 10:36:31 +00:00
LLVMBuild.txt