llvm-6502/lib/Transforms/InstCombine
Benjamin Kramer 66821d9020 InstCombine: Turn (zext A) == (B & (1<<X)-1) into A == (trunc B), narrowing the compare.
This saves a cast, and zext is more expensive on platforms with subreg support
than trunc is. This occurs in the BSD implementation of memchr(3), see PR12750.
On the synthetic benchmark from that bug stupid_memchr and bsd_memchr have the
same performance now when not inlining either function.

stupid_memchr: 323.0us
bsd_memchr: 321.0us
memchr: 479.0us

where memchr is the llvm-gcc compiled bsd_memchr from osx lion's libc. When
inlining is enabled bsd_memchr still regresses down to llvm-gcc memchr time,
I haven't fully understood the issue yet, something is grossly mangling the
loop after inlining.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158297 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-10 20:35:00 +00:00
..
CMakeLists.txt build/CMake: Finish removal of add_llvm_library_dependencies. 2011-11-29 19:25:30 +00:00
InstCombine.h add a new pass to instrument loads and stores for run-time bounds checking 2012-05-22 17:19:09 +00:00
InstCombineAddSub.cpp canonicalize: 2012-06-08 22:30:05 +00:00
InstCombineAndOrXor.cpp Fix combine of uno && ord -> false so that the ordering of the fcmps doesn't 2012-06-06 17:22:40 +00:00
InstCombineCalls.cpp switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients. 2012-05-28 01:47:44 +00:00
InstCombineCasts.cpp Small fix in InstCombineCasts.cpp. Restored "alloca + bitcast" reducing for case when alloca's size is calculated within the "add/sub/... nsw". 2012-05-05 07:09:40 +00:00
InstCombineCompares.cpp InstCombine: Turn (zext A) == (B & (1<<X)-1) into A == (trunc B), narrowing the compare. 2012-06-10 20:35:00 +00:00
InstCombineLoadStoreAlloca.cpp Teach InstCombine to nuke a common alloca pattern -- an alloca which has 2012-04-08 14:36:56 +00:00
InstCombineMulDivRem.cpp Remove some dead code and tidy things up now that vectors use ConstantDataVector 2012-02-06 21:56:39 +00:00
InstCombinePHI.cpp Update instcombine for atomic load/store. 2011-08-15 22:09:40 +00:00
InstCombineSelect.cpp Fix a bug in FoldSelectOpOp. Bitcast ops may change the number of vector elements, which may disagree with the select condition type. 2012-06-07 20:28:57 +00:00
InstCombineShifts.cpp PR12967: Don't crash when trying to fold a shift that's larger than the type's size. 2012-05-27 22:03:32 +00:00
InstCombineSimplifyDemanded.cpp Always compute all the bits in ComputeMaskedBits. 2012-04-04 12:51:34 +00:00
InstCombineVectorOps.cpp continue making the world safe for ConstantDataVector. At this point, 2012-01-27 03:08:05 +00:00
InstCombineWorklist.h Use an iterator instead of calling .size() on the worklist every time, which is wasteful. 2012-03-15 11:19:41 +00:00
InstructionCombining.cpp add a new pass to instrument loads and stores for run-time bounds checking 2012-05-22 17:19:09 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00