llvm-project/llvm/lib
David Bolvansky dbcdad51ff [InstCombine] (1 << (C - x)) -> ((1 << C) >> x) if C is bitwidth - 1
Summary:
```
%a = sub i32 31, %x
%r = shl i32 1, %a
  =>
%d = shl i32 1, 31
%r = lshr i32 %d, %x

Done: 1
Optimization is correct!
```

https://rise4fun.com/Alive/btZm

Reviewers: spatel, lebedev.ri, nikic

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 364073
2019-06-21 16:25:32 +00:00
..
Analysis Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFC 2019-06-21 05:40:31 +00:00
AsmParser [SVE][IR] Scalable Vector IR Type with pr42210 fix 2019-06-18 10:11:56 +00:00
BinaryFormat hwasan: Add a tag_offset DWARF attribute to instrumented stack variables. 2019-06-17 23:39:41 +00:00
Bitcode [SVE][IR] Scalable Vector IR Type with pr42210 fix 2019-06-18 10:11:56 +00:00
CodeGen [DAGCombine] narrowInsertExtractVectorBinOp - reuse "extract from insert" detection code. 2019-06-21 14:46:21 +00:00
DebugInfo [Symbolize] Avoid lifetime extension and simplify std::map find/insert. NFC 2019-06-21 11:05:26 +00:00
Demangle llvm-undname: Correctly demangle vararg parameters 2019-06-04 19:10:08 +00:00
ExecutionEngine [JITLink] Move JITLinkMemoryManager into its own header. 2019-06-14 19:41:21 +00:00
FuzzMutate [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
Fuzzer
IR Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFC 2019-06-21 05:40:31 +00:00
IRReader [IRReader] Expose getLazyIRModule 2019-02-11 22:01:13 +00:00
LTO [Remarks] Extend -fsave-optimization-record to specify the format 2019-06-17 16:06:00 +00:00
LineEditor Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Linker Reapply: IR: add optional type to 'byval' function parameters 2019-05-30 18:48:23 +00:00
MC Fix a crash with assembler source and -g. 2019-06-21 13:10:19 +00:00
MCA [MCA] Ignore invalid processor resource writes of zero cycles. NFCI 2019-06-14 13:31:21 +00:00
Object Share /machine: handling code with llvm-cvtres too 2019-06-12 11:32:43 +00:00
ObjectYAML [yaml2obj/obj2yaml] - Make RawContentSection::Info Optional<> 2019-06-19 08:57:38 +00:00
Option Option spell checking: Penalize delimiter flags if input has no argument 2019-05-01 16:45:15 +00:00
Passes [clang][NewPM] Do not eliminate available_externally durng `-O2 -flto` runs 2019-06-20 19:44:51 +00:00
ProfileData Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFC 2019-06-21 05:40:31 +00:00
Remarks [Remarks] Fix usage of enum class 2019-05-30 22:01:56 +00:00
Support Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFC 2019-06-21 05:40:31 +00:00
TableGen TableGen: Handle nontrivial foreach range bounds 2019-05-22 21:28:20 +00:00
Target [X86] isBinOp - move commutative ops to isCommutativeBinOp. NFCI. 2019-06-21 16:23:28 +00:00
Testing [Testing] Move clangd::Annotations to llvm testing support 2019-04-25 10:08:31 +00:00
TextAPI Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFC 2019-06-21 05:40:31 +00:00
ToolDrivers Share /machine: handling code with llvm-cvtres too 2019-06-12 11:32:43 +00:00
Transforms [InstCombine] (1 << (C - x)) -> ((1 << C) >> x) if C is bitwidth - 1 2019-06-21 16:25:32 +00:00
WindowsManifest Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
XRay Recommit [Object] Change object::SectionRef::getContents() to return Expected<StringRef> 2019-05-16 13:24:04 +00:00
CMakeLists.txt [OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks 2019-03-05 20:45:17 +00:00
LLVMBuild.txt [OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks 2019-03-05 20:45:17 +00:00