llvm-project/llvm/lib/Transforms/Scalar
Daniel Neilson 6f1eb58e92 [MemCpyOpt] Update to new API for memory intrinsic alignment
Summary:
This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
MemCpyOpt pass to cease using:
1) The old getAlignment() API of MemoryIntrinsic in favour of getting source & dest specific
alignments through the new API.
2) The old IRBuilder CreateMemCpy/CreateMemMove single-alignment APIs in favour of the new
API that allows setting source and destination alignments independently.

We also add a few tests to fill gaps in the testing of this pass.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960, rL325816, rL327398, rL327421 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

llvm-svn: 328097
2018-03-21 14:14:55 +00:00
..
ADCE.cpp [ADCE] Use MapVector for BlockInfo to make iteration order deterministic 2017-11-03 14:15:08 +00:00
AlignmentFromAssumptions.cpp [AlignmentFromAssumptions] Set source and dest alignments of memory intrinsiscs separately 2018-02-22 18:55:59 +00:00
BDCE.cpp [BDCE] Salvage debug info from dying insts 2018-02-21 01:55:33 +00:00
CMakeLists.txt Remove the LoopInstSimplify pass (-loop-instsimplify) 2018-03-12 20:49:42 +00:00
CallSiteSplitting.cpp [CallSiteSplitting] Use !Instruction::use_empty instead of checking for a non-zero return from getNumUses 2018-03-12 18:40:59 +00:00
ConstantHoisting.cpp Fix out-of-order stepping behavior in programs with hoisted constants. 2017-11-09 20:01:31 +00:00
ConstantProp.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
CorrelatedValuePropagation.cpp Re-re-land: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions. 2018-03-21 14:08:21 +00:00
DCE.cpp [DCE] Salvage debug info from dead insts 2018-02-15 22:26:18 +00:00
DeadStoreElimination.cpp [DSE] Don't DSE stores that subsequent memmove calls read from 2018-02-20 23:19:34 +00:00
DivRemPairs.cpp [DivRempairs] add a pass to optimize div/rem pairs (PR31028) 2017-09-09 13:38:18 +00:00
EarlyCSE.cpp [EarlyCSE] Don't hide earler invariant.scopes 2018-03-15 18:12:27 +00:00
FlattenCFGPass.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Float2Int.cpp [Float2Int] Replace a ConstantRange copy with a move. Remove an extra call to MapVector::find. 2017-05-05 17:09:29 +00:00
GVN.cpp [GVN] Partially revert debug info salvage change (r325063) 2018-02-16 01:15:20 +00:00
GVNHoist.cpp Add missed PostDominatorTree analysis dependency to GVN hoist pass. 2018-02-08 11:45:36 +00:00
GVNSink.cpp Use phi ranges to simplify code. No functionality change intended. 2017-12-30 15:27:33 +00:00
GuardWidening.cpp Guard print() functions only used by dump() functions. 2017-07-31 10:07:49 +00:00
IVUsersPrinter.cpp
IndVarSimplify.cpp Use phi ranges to simplify code. No functionality change intended. 2017-12-30 15:27:33 +00:00
InductiveRangeCheckElimination.cpp [New PM][IRCE] port of Inductive Range Check Elimination pass to the new pass manager 2018-03-15 11:01:19 +00:00
InferAddressSpaces.cpp [InferAddressSpaces] Update uses of IRBuilder memory intrinsic creation to new API 2018-02-06 20:33:36 +00:00
JumpThreading.cpp [JumpThreading] Track unreachable BBs to avoid processing 2018-03-16 15:13:47 +00:00
LICM.cpp [LICM] Salvage DI from dying Instructions 2018-03-18 15:59:19 +00:00
LLVMBuild.txt Another try to commit 323321 (aggressive instruction combine). 2018-01-25 12:06:32 +00:00
LoopAccessAnalysisPrinter.cpp
LoopDataPrefetch.cpp [NFC] fix trivial typos in comments 2018-01-19 10:55:29 +00:00
LoopDeletion.cpp Use phi ranges to simplify code. No functionality change intended. 2017-12-30 15:27:33 +00:00
LoopDistribute.cpp [Dominators] Remove verifyDomTree and add some verifying for Post Dom Trees 2018-02-28 11:00:08 +00:00
LoopIdiomRecognize.cpp [LoopIdiom] Be more aggressive when setting alignment in memcpy 2018-02-08 17:33:08 +00:00
LoopInterchange.cpp DA: remove uses of GEP, only ask SCEV 2018-03-06 21:55:59 +00:00
LoopLoadElimination.cpp Add MemorySSA as loop dependency, disabled by default [NFC]. 2017-11-21 15:45:46 +00:00
LoopPassManager.cpp
LoopPredication.cpp Rename and move utility function getLatchPredicateForGuard. NFC. 2018-02-09 07:59:07 +00:00
LoopRerollPass.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-18 21:46:47 +00:00
LoopRotation.cpp [Debug] Add a utility to propagate dbg.value to new PHIs, NFC 2018-01-25 21:37:05 +00:00
LoopSimplifyCFG.cpp Rename WeakVH to WeakTrackingVH; NFC 2017-05-01 17:07:49 +00:00
LoopSink.cpp Add hasProfileData() to check if a function has profile data. NFC. 2017-12-22 01:33:52 +00:00
LoopStrengthReduce.cpp Revert "[LSR] Avoid UB overflow when examining reuse opportunities" 2018-02-12 22:42:13 +00:00
LoopUnrollPass.cpp [LoopUnroll] Peel off iterations if it makes conditions true/false. 2018-03-15 21:34:43 +00:00
LoopUnswitch.cpp Use phi ranges to simplify code. No functionality change intended. 2017-12-30 15:27:33 +00:00
LoopVersioningLICM.cpp This change add's optimization remark in LoopVersioning LICM pass. 2018-01-23 09:47:28 +00:00
LowerAtomic.cpp Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
LowerExpectIntrinsic.cpp Fix builin_expect lowering bug 2017-06-07 18:32:24 +00:00
LowerGuardIntrinsic.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MemCpyOptimizer.cpp [MemCpyOpt] Update to new API for memory intrinsic alignment 2018-03-21 14:14:55 +00:00
MergeICmps.cpp [MergeICmps] Break eargerly out of loop 2018-03-20 12:03:25 +00:00
MergedLoadStoreMotion.cpp Mark MergedLoadStoreMotion as not preserving MemDep results 2018-02-23 10:41:57 +00:00
NaryReassociate.cpp Add early exit on reassociation of 0 expression. 2018-03-07 02:17:08 +00:00
NewGVN.cpp [NewGVN] Update phi-of-ops def block when updating existing ValuePHI. 2018-02-27 09:34:51 +00:00
PartiallyInlineLibCalls.cpp [PartiallyInlineLibCalls][x86] add TTI hook to allow sqrt inlining to depend on arg rather than result 2017-11-27 21:15:43 +00:00
PlaceSafepoints.cpp All libcalls should be considered to be GC-leaf functions. 2017-07-27 16:49:39 +00:00
Reassociate.cpp Reassociate: add global reassociation algorithm 2017-12-12 19:18:02 +00:00
Reg2Mem.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
RewriteStatepointsForGC.cpp [RewriteStatepoints] Fix stale parse points 2018-03-05 22:27:30 +00:00
SCCP.cpp [IPSCCP] Add getCompare which returns either true, false, undef or null. 2018-03-05 17:33:50 +00:00
SROA.cpp [SROA] Take advantage of separate alignments for memcpy source and destination 2018-03-13 14:25:33 +00:00
Scalar.cpp [New PM][IRCE] port of Inductive Range Check Elimination pass to the new pass manager 2018-03-15 11:01:19 +00:00
Scalarizer.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-20 21:47:29 +00:00
SeparateConstOffsetFromGEP.cpp Adding a width of the GEP index to the Data Layout. 2018-02-14 06:58:08 +00:00
SimpleLoopUnswitch.cpp [Dominators] Remove verifyDomTree and add some verifying for Post Dom Trees 2018-02-28 11:00:08 +00:00
SimplifyCFGPass.cpp [SimplifyCFG] don't sink common insts too soon (PR34603) 2017-12-14 22:05:20 +00:00
Sink.cpp [Sink] Really really fix predicate in legality check 2018-01-11 21:28:57 +00:00
SpeculateAroundPHIs.cpp Add a new pass to speculate around PHI nodes with constant (integer) operands when profitable. 2017-11-28 11:32:31 +00:00
SpeculativeExecution.cpp Revert r301950: SpeculativeExecution: Stop using whitelist for costs 2017-05-10 12:30:07 +00:00
StraightLineStrengthReduce.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-27 01:09:08 +00:00
StructurizeCFG.cpp Revert "StructurizeCFG: Test for branch divergence correctly" 2018-02-24 17:29:09 +00:00
TailRecursionElimination.cpp Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00