llvm-project/llvm/lib
Roman Lebedev 75404fb9f8 [InstCombine] Inefficient pattern for high-bits checking (PR38708)
Summary:
It is sometimes important to check that some newly-computed value
is non-negative and only `n` bits wide (where `n` is a variable.)
There are **many** ways to check that:
https://godbolt.org/z/o4RB8D
The last variant seems best?
(I'm sure there are some other variations i haven't thought of..)

Let's handle the second variant first, since it is much simpler.
https://rise4fun.com/Alive/LYjY

https://bugs.llvm.org/show_bug.cgi?id=38708

Reviewers: spatel, craig.topper, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 342067
2018-09-12 18:19:43 +00:00
..
Analysis [LV] Move InterleaveGroup and InterleavedAccessInfo to VectorUtils.h (NFC) 2018-09-12 08:01:57 +00:00
AsmParser [AArch64] Add parsing of aarch64_vector_pcs attribute. 2018-09-12 08:54:06 +00:00
BinaryFormat [WebAssembly] clang-format (NFC) 2018-09-05 01:27:38 +00:00
Bitcode [x86/SLH] Add a real Clang flag and LLVM IR attribute for Speculative 2018-09-04 12:38:00 +00:00
CodeGen [CGP] Ensure splitgep gives deterministic output 2018-09-12 10:19:10 +00:00
DebugInfo Reverting r342048, which caused UBSan failures in dsymutil. 2018-09-12 14:40:04 +00:00
Demangle Remove some debugging code that was accidentally left in. 2018-08-30 21:00:57 +00:00
ExecutionEngine [MIPS] ORC JIT support 2018-09-11 13:10:04 +00:00
FuzzMutate [IR] Replace `isa<TerminatorInst>` with `isTerminator()`. 2018-08-26 09:51:22 +00:00
Fuzzer
IR [AArch64] Add parsing of aarch64_vector_pcs attribute. 2018-09-12 08:54:06 +00:00
IRReader
LTO [ThinLTO] Fix memory corruption in ThinLTOCodeGenerator when CodeGenOnly was specified 2018-09-04 22:54:17 +00:00
LineEditor
Linker [NFC] Remove an empty line. 2018-07-27 06:50:45 +00:00
MC Fix typos. NFC 2018-09-08 02:04:20 +00:00
Object [object] Improve the performance of getSymbols used by ArchiveWriter 2018-09-11 22:00:47 +00:00
ObjectYAML [PDB] Write FPO Data to the PDB. 2018-09-11 22:35:01 +00:00
Option Revert r341329 due to MSAN error 2018-09-03 18:13:46 +00:00
Passes Revert "[GVNHoist] Re-enable GVNHoist by default" 2018-09-11 22:10:57 +00:00
ProfileData [SampleFDO] Make sample profile loader unaware of compact format change. 2018-09-06 22:03:37 +00:00
Support Revert "AMDGPU: Move isa version and EF_AMDGPU_MACH_* determination into TargetParser." 2018-09-12 07:05:30 +00:00
TableGen Remove trailing space 2018-07-30 19:41:25 +00:00
Target [WebAssembly] SIMD comparisons 2018-09-12 17:56:00 +00:00
Testing Fix error with SmallString implicit conversion. 2018-09-06 22:47:32 +00:00
ToolDrivers Give llvm-lib rudimentary help output. 2018-07-14 02:29:44 +00:00
Transforms [InstCombine] Inefficient pattern for high-bits checking (PR38708) 2018-09-12 18:19:43 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay] Ensure lambda outlives llvm::function_ref 2018-09-11 08:03:30 +00:00
CMakeLists.txt
LLVMBuild.txt