llvm-project/llvm/lib/Transforms/Utils
Clement Courbet 8e16d73346 [SelectionDAG] Allow the user to specify a memeq function.
Summary:
Right now, when we encounter a string equality check,
e.g. `if (memcmp(a, b, s) == 0)`, we try to expand to a comparison if `s` is a
small compile-time constant, and fall back on calling `memcmp()` else.

This is sub-optimal because memcmp has to compute much more than
equality.

This patch replaces `memcmp(a, b, s) == 0` by `bcmp(a, b, s) == 0` on platforms
that support `bcmp`.

`bcmp` can be made much more efficient than `memcmp` because equality
compare is trivially parallel while lexicographic ordering has a chain
dependency.

Subscribers: fedor.sergeev, jyknight, ckennelly, gchatelet, llvm-commits

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

llvm-svn: 355672
2019-03-08 09:07:45 +00:00
..
ASanStackFrameLayout.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AddDiscriminators.cpp [llvm] Clarify responsiblity of some of DILocation discriminator APIs 2019-01-24 00:10:25 +00:00
BasicBlockUtils.cpp Make MergeBlockIntoPredecessor conformant to the precondition of calling DTU.applyUpdates 2019-02-28 16:47:18 +00:00
BreakCriticalEdges.cpp BreakCriticalEdges: Update PostDominatorTree 2019-02-22 15:01:41 +00:00
BuildLibCalls.cpp [SelectionDAG] Allow the user to specify a memeq function. 2019-03-08 09:07:45 +00:00
BypassSlowDivision.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [ThinLTO] Handle chains of aliases 2019-01-04 19:04:54 +00:00
CallPromotionUtils.cpp [opaque pointer types] Pass function type for CallBase::setCalledFunction. 2019-02-01 20:44:54 +00:00
CanonicalizeAliases.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CloneFunction.cpp Move DomTreeUpdater from IR to Analysis 2019-02-06 02:52:52 +00:00
CloneModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeExtractor.cpp [CodeExtractor] Do not lift lifetime.end markers for region inputs 2019-02-15 18:46:58 +00:00
CtorUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DemoteRegToStack.cpp [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
EntryExitInstrumenter.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
EscapeEnumerator.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
Evaluator.cpp [CallSite removal] Migrate ConstantFolding APIs and implementation to 2019-02-11 07:51:44 +00:00
FlattenCFG.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionComparator.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionImportUtils.cpp Recommit "[ThinLTO] Rename COMDATs for COFF when promoting/renaming COMDAT leader" 2019-01-31 17:18:11 +00:00
GlobalStatus.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GuardUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImportedFunctionsInliningStatistics.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InlineFunction.cpp Implementation of asm-goto support in LLVM 2019-02-08 20:48:56 +00:00
InstructionNamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntegerDivision.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LCSSA.cpp [LCSSA] Handle case with single new PHI faster. 2019-02-02 15:26:05 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LibCallsShrinkWrap.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Local.cpp [DTU] Refine the interface and logic of applyUpdates 2019-02-22 13:48:38 +00:00
LoopRotationUtils.cpp [LoopRotate] fix crash encountered with callbr 2019-03-06 23:04:40 +00:00
LoopSimplify.cpp [MemorySSA & LoopPassManager] Update MemorySSA in formDedicatedExitBlocks. 2019-02-21 21:13:34 +00:00
LoopUnroll.cpp [llvm] Clarify responsiblity of some of DILocation discriminator APIs 2019-01-24 00:10:25 +00:00
LoopUnrollAndJam.cpp [llvm] Clarify responsiblity of some of DILocation discriminator APIs 2019-01-24 00:10:25 +00:00
LoopUnrollPeel.cpp [LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV. 2019-02-14 13:59:39 +00:00
LoopUnrollRuntime.cpp [MemorySSA & LoopPassManager] Update MemorySSA in formDedicatedExitBlocks. 2019-02-21 21:13:34 +00:00
LoopUtils.cpp [DTU] Deprecate insertEdge*/deleteEdge* 2019-02-22 05:41:43 +00:00
LoopVersioning.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LowerInvoke.cpp [opaque pointer types] Pass function types to CallInst creation. 2019-02-01 20:43:25 +00:00
LowerMemIntrinsics.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
LowerSwitch.cpp [LowerSwitch][AMDGPU] Do not handle impossible values 2019-02-22 14:33:46 +00:00
Mem2Reg.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MetaRenamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ModuleUtils.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
NameAnonGlobals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PredicateInfo.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
PromoteMemoryToRegister.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SSAUpdater.cpp [LICM/MSSA] Add promotion to scalars by building an AliasSetTracker with MemorySSA. 2019-02-06 20:25:17 +00:00
SSAUpdaterBulk.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SanitizerStats.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
SimplifyCFG.cpp [NFC] Rename DontDeleteUselessPHIs --> KeepOneInputPHIs 2019-02-12 07:09:29 +00:00
SimplifyIndVar.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SimplifyLibCalls.cpp [SelectionDAG] Allow the user to specify a memeq function. 2019-03-08 09:07:45 +00:00
SplitModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripGCRelocates.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripNonLineTableDebugInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SymbolRewriter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
UnifyFunctionExitNodes.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Utils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
VNCoercion.cpp [GVN] Small tweaks to comments, style, and missed vector handling 2019-02-20 00:31:28 +00:00
ValueMapper.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00