1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/Transforms
Sanjay Patel 494e59d7bc [LibCallSimplifier] try harder to fold memcmp with constant arguments
Try to fold:
memcmp(X, C, ConstantLength) == 0 --> load X == *C

Without this change, we're unnecessarily checking the alignment of the constant data, 
so we miss the transform in the first 2 tests in the patch.

I noted this shortcoming of LibCallSimpifier in one of the recent CGP memcmp expansion 
patches. This doesn't help the example in:
https://bugs.llvm.org/show_bug.cgi?id=34032#c13
...directly, but it's worth short-circuiting more of these simple cases since we're 
already trying to do that.

The benefit of transforming to load+cmp is that existing IR analysis/transforms may
further simplify that code. For example, if the load of the variable is common to 
multiple memcmp calls, CSE can remove the duplicate instructions.

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

llvm-svn: 311333
2017-08-21 13:55:49 +00:00
..
ADCE Reapply: [ADCE][Dominators] Teach ADCE to preserve dominators 2017-08-17 01:41:49 +00:00
AddDiscriminators
AlignmentFromAssumptions
ArgumentPromotion [ArgPromotion] Preserve alignment of byval argument in new alloca 2017-08-04 17:09:11 +00:00
AtomicExpand
BDCE [BDCE] Don't check demanded bits on unsized types 2017-08-16 16:09:22 +00:00
BranchFolding
CodeExtractor
CodeGenPrepare [CGP] Fix the rematerialization of gc.relocates 2017-08-17 05:48:30 +00:00
ConstantHoisting
ConstantMerge
ConstProp
Coroutines Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
CorrelatedValuePropagation [LVI] Constant-propagate a zero extension of the switch condition value through case edges 2017-08-03 21:11:30 +00:00
CountingFunctionInserter
CrossDSOCFI
DCE Add strictfp attribute to prevent unwanted optimizations of libm calls 2017-08-14 21:15:13 +00:00
DeadArgElim Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
DeadStoreElimination Revert r310055, it caused PR34074. 2017-08-04 20:40:38 +00:00
EarlyCSE
EliminateAvailableExternally
Float2Int
ForcedFunctionAttrs
FunctionAttrs
FunctionImport Fix bot failures by requiring x86 target 2017-08-19 19:15:04 +00:00
GCOVProfiling [llvm] Get rid of "%T" expansions 2017-08-15 20:29:24 +00:00
GlobalDCE
GlobalMerge [DI] Every DIGlobalVariable should have a type. 2017-08-16 13:39:07 +00:00
GlobalOpt Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
GlobalSplit
GuardWidening
GVN Keep Optimization Remark Yaml in NewPM 2017-08-20 01:30:45 +00:00
GVNHoist
GVNSink
IndVarSimplify [SCEV/IndVars] Always compute loop exiting values if the backedge count is 0 2017-08-01 22:37:58 +00:00
InferAddressSpaces
InferFunctionAttrs
Inline Revert "Emit only A Single Opt Remark When Inlining" 2017-08-20 06:55:10 +00:00
InstCombine [LibCallSimplifier] try harder to fold memcmp with constant arguments 2017-08-21 13:55:49 +00:00
InstMerge
InstNamer
InstSimplify [InstSimplify] Teach decomposeBitTestICmp to handle non-canonical compares 2017-08-14 22:11:43 +00:00
InterleavedAccess [InterLeaved] Adding lit test for future work interleaved load strid 3 2017-08-21 08:56:39 +00:00
Internalize
IPConstantProp
IRCE [IRCE] Fix buggy behavior in Clamp 2017-08-18 22:50:29 +00:00
JumpThreading [Profile] backward propagate profile info in JumpThreading 2017-08-18 23:00:05 +00:00
LCSSA
LICM Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
LoadStoreVectorizer
LoopDataPrefetch
LoopDeletion [Dominators] Teach LoopDeletion to use the new incremental API 2017-08-02 18:17:52 +00:00
LoopDistribute
LoopIdiom Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
LoopInterchange [LoopInterchange] Do not interchange loops with function calls. 2017-07-31 09:00:52 +00:00
LoopLoadElim
LoopPredication
LoopReroll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
LoopRotate Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
LoopSimplify Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
LoopSimplifyCFG
LoopStrengthReduce Reapply fix PR23384 (part 3 of 3) r304824 (was reverted in r305720). 2017-08-07 19:56:34 +00:00
LoopUnroll Changed basic cost of store operation on X86 2017-08-20 12:34:29 +00:00
LoopUnswitch Add "REQUIRES: asserts" for test unswitch-equality-undef.ll. 2017-07-26 01:34:46 +00:00
LoopVectorize Revert r311077: [LV] Using VPlan ... 2017-08-20 23:17:11 +00:00
LoopVersioning
LoopVersioningLICM
LowerAtomic
LowerExpectIntrinsic
LowerGuardIntrinsic
LowerInvoke
LowerSwitch
LowerTypeTests Update phi nodes in LowerTypeTests control flow simplification 2017-07-31 20:43:07 +00:00
Mem2Reg Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
MemCpyOpt
MergeFunc Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
MetaRenamer [MetaRenamer] Leave @main alone. 2017-08-01 05:14:45 +00:00
NameAnonGlobals
NaryReassociate
NewGVN Keep Optimization Remark Yaml in NewPM 2017-08-20 01:30:45 +00:00
ObjCARC Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
PartiallyInlineLibCalls
PGOProfile Keep Optimization Remark Yaml in NewPM 2017-08-20 01:30:45 +00:00
PhaseOrdering
PlaceSafepoints All libcalls should be considered to be GC-leaf functions. 2017-07-27 16:49:39 +00:00
PreISelIntrinsicLowering
PruneEH
Reassociate
Reg2Mem
RewriteStatepointsForGC All libcalls should be considered to be GC-leaf functions. 2017-07-27 16:49:39 +00:00
SafeStack Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
SampleProfile Keep Optimization Remark Yaml in NewPM 2017-08-20 01:30:45 +00:00
Scalarizer Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
SCCP [IPSCCP] Guard a user of getInitializer with hasDefinitiveInitializer 2017-07-31 17:47:07 +00:00
SeparateConstOffsetFromGEP
SimpleLoopUnswitch
SimplifyCFG [SimplifyCFG] Add a test for preserve store alignment, NFC. 2017-08-17 17:26:52 +00:00
Sink
SLPVectorizer Keep Optimization Remark Yaml in NewPM 2017-08-20 01:30:45 +00:00
SpeculativeExecution
SROA Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
StructurizeCFG [Dominators] Include infinite loops in PostDominatorTree 2017-08-15 18:14:57 +00:00
TailCallElim [TRE] Add another test for OptRemark. 2017-07-19 21:39:51 +00:00
ThinLTOBitcodeWriter ThinLTO Minimized Bitcode File Size Reduction 2017-07-21 17:25:20 +00:00
Util Keep Optimization Remark Yaml in NewPM 2017-08-20 01:30:45 +00:00
WholeProgramDevirt