llvm/lib
Craig Topper 3461e9c2e4 Teach SimplifyDemandedUseBits that adding or subtractings 0s from every bit below the highest demanded bit can be simplified
If we are adding/subtractings 0s below the highest demanded bit we can just use the other operand and remove the operation.

My primary motivation is observing that we can call ShrinkDemandedConstant for the add/sub and create a 0 constant, rather than removing the add completely. In the case I saw, we modified the constant on an add instruction to a 0, but the add is not put into the worklist. So we didn't revisit it until the next InstCombine iteration. This caused an IR modification to remove add and a subsequent iteration to be ran.

With this change we get bypass the add in the first iteration and prevent the second iteration from changing anything.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300075 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 16:49:59 +00:00
..
Analysis [LoopVectorizer, TTI] New method supportsEfficientVectorElementLoadStore() 2017-04-12 12:41:37 +00:00
AsmParser [IR] Add AttributeSet to hide AttributeSetNode* again, NFC 2017-04-12 00:38:00 +00:00
Bitcode [IR] Redesign the case iterator in SwitchInst to actually be an iterator 2017-04-12 07:27:28 +00:00
CodeGen Remove redundant type casts 2017-04-12 14:13:00 +00:00
DebugInfo [DWARF] Fix compiler warnings in DWARFContext.cpp, NFCi 2017-04-12 11:33:26 +00:00
Demangle
ExecutionEngine [IR] Redesign the case iterator in SwitchInst to actually be an iterator 2017-04-12 07:27:28 +00:00
Fuzzer [libFuzzer] fix type in signal name. 2017-04-11 18:20:05 +00:00
IR [IR] Redesign the case iterator in SwitchInst to actually be an iterator 2017-04-12 07:27:28 +00:00
IRReader
LibDriver
LineEditor
Linker
LTO
MC MC: Remove unused virtual function MCObjectWriter::isWeak. NFC. 2017-04-08 23:35:49 +00:00
Object Remove unused functions. Remove static qualifier from functions in header files. NFC. 2017-04-11 14:55:32 +00:00
ObjectYAML
Option
Passes MemorySSA: Move to Analysis, from Transforms/Utils. It's used as 2017-04-11 20:06:36 +00:00
ProfileData [PGO] Memory intrinsic calls optimization based on profiled size 2017-04-04 16:42:20 +00:00
Support Fix detection of backtrace() availability on FreeBSD 2017-04-12 13:51:00 +00:00
TableGen
Target [AMDGPU][MC] Corrected parsing of v_cmp_class* and v_cmpx_class* 2017-04-12 16:31:18 +00:00
Transforms Teach SimplifyDemandedUseBits that adding or subtractings 0s from every bit below the highest demanded bit can be simplified 2017-04-12 16:49:59 +00:00
XRay [XRay] - Fix spelling error to test commit access. 2017-04-06 03:32:01 +00:00
CMakeLists.txt
LLVMBuild.txt