llvm-project/llvm/test/Transforms
Sidharth Baveja 38a8217931 [Loop Fusion] Integrate Loop Peeling into Loop Fusion (re-land after fixing ASAN build failures)
This patch adds the ability to peel off iterations of the first loop in loop
fusion. This can allow for both loops to have the same trip count, making it
legal for them to be fused together.

Here is a simple scenario peeling can be used in loop fusion:

for (i = 0; i < 10; ++i)
  a[i] = a[i] + 3;
for (j = 1; j < 10; ++j)
  b[j] = b[j] + 5;

Here is we can make use of peeling, and then fuse the two loops together. We
can peel off the 0th iteration of the loop i, and then combine loop i and j for
i = 1 to 10.

a[0] = a[0] +3;
for (i = 1; i < 10; ++i) {
  a[i] = a[i] + 3;
  b[i] = b[i] + 5;
}

Currently peeling with loop fusion is only supported for loops with constant
trip counts and a single exit point. Both unguarded and guarded loops are
supported.

Reviewed By: bmahjour (Bardia Mahjour), MaskRay (Fangrui Song)

Differential Revision: https://reviews.llvm.org/D82927
2020-07-23 21:02:04 +00:00
..
ADCE [ADCE] Fix incorrect reporting of CFG changes 2020-04-14 20:26:13 +07:00
AddDiscriminators
AggressiveInstCombine [AggressiveInstCombine] Add test with baseline CHECKs for aggressive inst combine for ICmp instruction. 2020-02-12 15:09:38 +02:00
AlignmentFromAssumptions Temporarily Revert "[AssumeBundles] Use operand bundles to encode alignment assumptions" 2020-07-16 11:54:04 -07:00
ArgumentPromotion [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
AtomicExpand Handle part-word LL/SC in atomic expansion pass 2020-04-28 10:07:39 -05:00
Attributor [Attributor][NFC] applying update_test_checks with --check-attributes 2020-07-20 08:17:34 +02:00
BDCE [BDCE] SExt -> ZExt when no sign bits is used and instruction has multiple uses 2020-07-10 08:34:53 +01:00
BlockExtractor Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
BranchFolding
CallSiteSplitting Re-enable "[InstCombine] Simplify boolean Phis with const inputs using CFG" 2020-07-16 16:09:08 +07:00
CalledValuePropagation
CanonicalizeAliases
CanonicalizeFreezeInLoops [TargetPassConfig] Add CanonicalizeFreezeInLoops before LSR 2020-05-28 05:21:12 +09:00
CodeExtractor [CodeExtractor] Fix extraction of a value used only by intrinsics outside of region 2020-04-25 11:44:47 +03:00
CodeGenPrepare CodeGenPrep: remove AssertingVH references before deleting dead instructions. 2020-07-15 15:19:21 +01:00
ConstProp [ConstProp] Add test for bitcast to gep fold; NFC 2020-03-04 18:27:20 +01:00
ConstantHoisting
ConstantMerge
Coroutines [Coroutines] Refactor sinkLifetimeStartMarkers 2020-07-09 18:23:28 +08:00
CorrelatedValuePropagation [CVP] Soften SDiv into a UDiv as long as we know domains of both of the operands. 2020-07-18 17:59:56 +03:00
CrossDSOCFI
DCE Infer alignment of unmarked loads in IR/bitcode parsing. 2020-05-14 13:03:50 -07:00
DeadArgElim IR: Define byref parameter attribute 2020-07-20 10:23:09 -04:00
DeadStoreElimination [DSE,MSSA] Recognise init_trampoline in getLocForWriteEx 2020-07-15 12:18:58 +01:00
DivRemPairs [ValueTracking] Let isGuaranteedNotToBeUndefOrPoison use canCreateUndefOrPoison 2020-07-20 09:21:39 +09:00
EarlyCSE [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
EliminateAvailableExternally
EntryExitInstrumenter [llvm] Fix missing FileCheck directive colons 2020-04-06 09:59:08 -06:00
ExpandMemCmp [ExpandMemCmp] Allow overlaping loads in the zero-relational case. 2020-04-02 11:20:47 +02:00
FixIrreducible [fix-irreducible] Skip unreachable predecessors. 2020-07-11 10:08:44 -04:00
Float2Int
ForcedFunctionAttrs
FunctionAttrs [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
FunctionImport Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
GCOVProfiling [gcov][test] Add mkdir -p %t && cd %t 2020-06-09 11:09:50 -07:00
GVN [GVN] teach ConstantFolding correct handling of non-integral addrspace casts 2020-07-13 21:44:17 -04:00
GVNHoist
GVNSink [NFCI][SimplifyCFG] Guard common code hoisting with a (default-on) flag 2020-07-20 10:29:57 +03:00
GlobalDCE
GlobalMerge
GlobalOpt [GVN] add early exit to ConstantFoldLoadThroughBitcast [NFC] 2020-07-13 21:44:17 -04:00
GlobalSplit
GuardWidening [llvm] Fix missing FileCheck directive colons 2020-04-06 09:59:08 -06:00
HardwareLoops [HardwareLoops] Add sibling loop test. 2020-07-15 16:36:17 +01:00
HotColdSplit [HotColdSplit] Mark entire function cold when entry block is cold 2020-02-17 15:57:50 -08:00
IPConstantProp [SCCP] Move tests using only ipsccp from IPConstantProp to SCCP (NFC). 2020-07-09 17:16:15 +01:00
IRCE [NPM] Bail out when -foo and --passes=foo are both specified 2020-06-22 08:27:13 -07:00
IndVarSimplify [SCEV][IndVarSimplify] insert point should not be block front. 2020-07-17 22:25:10 -04:00
IndirectBrExpand
InferAddressSpaces Revert "[InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X transforms" and subsequent patches 2020-07-15 22:02:33 -07:00
InferFunctionAttrs [llvm] Fix missing FileCheck directive colons 2020-04-06 09:59:08 -06:00
Inline [llvm] Development-mode InlineAdvisor 2020-07-20 11:01:56 -07:00
InstCombine [InstCombine] Move target-specific inst combining 2020-07-22 15:59:49 +02:00
InstMerge [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
InstNamer [InstNamer] use 'i' for Instructions, not 'tmp' 2020-06-01 11:11:14 -04:00
InstSimplify [ValueTracking] Fix incorrect handling of canCreateUndefOrPoison 2020-07-22 09:31:16 +09:00
InterleavedAccess [Alignment] Fix misaligned interleaved loads 2020-05-27 12:12:22 +00:00
Internalize
JumpThreading [JumpThreading] Make test more robust (NFC) 2020-06-20 13:05:42 +02:00
LCSSA
LICM AArch64+ARM: make LLVM consider system registers volatile. 2020-07-15 09:47:36 +01:00
LoadStoreVectorizer [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopDataPrefetch
LoopDeletion [NPM][IVUsers] Rename ivusers -> iv-users 2020-07-15 09:38:21 -07:00
LoopDistribute [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopFusion [Loop Fusion] Integrate Loop Peeling into Loop Fusion (re-land after fixing ASAN build failures) 2020-07-23 21:02:04 +00:00
LoopIdiom [LoopIdiom] Add additional test cases. 2020-07-23 13:53:26 +01:00
LoopInstSimplify
LoopInterchange [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopLoadElim [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopPredication [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopReroll [IR] Simplify Use::swap. NFCI. 2020-07-21 12:15:12 +01:00
LoopRotate [LoopRotate] Cleanup test checks to fix issue reported on D77354 2020-04-03 17:21:37 +01:00
LoopSimplify [Loop Simplify] Resolve an issue where metadata is not applied to a loop latch. 2020-07-17 14:02:14 +00:00
LoopSimplifyCFG
LoopStrengthReduce [LSR] Re-generate check lines for test. 2020-07-23 13:53:53 +01:00
LoopTransformWarning
LoopUnroll [LoopUnroll] Update branch weight for remainder loop 2020-07-15 12:33:29 -07:00
LoopUnrollAndJam [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopUnswitch [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopVectorize [PGO][PGSO] Add profile guided size optimization to loop vectorization legality. 2020-07-21 11:16:36 -07:00
LoopVersioning [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
LoopVersioningLICM
LowerAtomic
LowerConstantIntrinsics IR: Define byref parameter attribute 2020-07-20 10:23:09 -04:00
LowerExpectIntrinsic Add support of __builtin_expect_with_probability 2020-06-22 10:21:28 -07:00
LowerGuardIntrinsic
LowerInvoke
LowerMatrixIntrinsics [Matrix] Use TileInfo to create tiled loop nest for matrix multiply. 2020-07-20 21:11:53 +01:00
LowerSwitch
LowerTypeTests
LowerWidenableCondition
MakeGuardsExplicit
Mem2Reg
MemCpyOpt [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
MergeFunc Infer alignment of unmarked loads in IR/bitcode parsing. 2020-05-14 13:03:50 -07:00
MergeICmps
MetaRenamer
NameAnonGlobals
NaryReassociate
NewGVN [PredicateInfo] Place predicate info after assume 2020-07-13 21:10:11 +02:00
ObjCARC [BasicAA] Rename -disable-basicaa to -disable-basic-aa to be consistent with the canonical name "basic-aa" 2020-06-26 20:55:44 -07:00
OpenMP [OpenMPOpt] Regression test for hiding latency of H2D mem transfers 2020-07-22 20:02:54 -05:00
PGOProfile Revert D81682 "[PGO] Extend the value profile buckets for mem op sizes." 2020-07-22 16:08:25 -07:00
PartiallyInlineLibCalls
PhaseOrdering [NFC][PhaseOrdering] Add a test demonstrating pitfails of common code hoisting on loop rotation 2020-07-16 23:53:26 +03:00
PlaceSafepoints
PreISelIntrinsicLowering Remove Passes dependency on CodeGen 2020-06-24 14:52:46 -07:00
PruneEH
Reassociate [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
Reg2Mem
RewriteStatepointsForGC [NPM] Bail out when -foo and --passes=foo are both specified 2020-06-22 08:27:13 -07:00
SCCP [SCCP] Add another switch+phi test (NFC) 2020-07-23 21:51:09 +02:00
SLPVectorizer [SLP][Test] Precommit tests for D83779. NFC. 2020-07-22 18:25:45 +03:00
SROA [SROA] convertValue(): we can have <N x iK*> to <M x iQ> cast 2020-06-25 00:58:54 +03:00
SafeStack [Instruction] Set metadata uses to undef on deletion 2020-05-21 15:58:12 -07:00
SampleProfile Revert "[InlineAdvisor] New inliner advisor to replay inlining from optimization remarks" 2020-07-19 08:49:04 -07:00
ScalarizeMaskedMemIntrin [SVE] Scalarize fixed length masked loads and stores. 2020-07-09 10:47:04 +00:00
Scalarizer [Scalarizer] When gathering scattered scalar, don't replace it with itself 2020-07-07 17:03:53 +03:00
SeparateConstOffsetFromGEP Infer alignment of unmarked loads in IR/bitcode parsing. 2020-05-14 13:03:50 -07:00
SimpleLoopUnswitch [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
SimplifyCFG [SimplifyCFG] Do not create unneeded PR Phi in block with convergent calls 2020-07-22 13:53:50 +07:00
Sink [BasicAA] Rename deprecated -basicaa to -basic-aa 2020-06-26 20:41:37 -07:00
SpeculateAroundPHIs [NFC] Update tests 2020-05-05 15:28:40 +01:00
SpeculativeExecution SpeculativeExecution: Fix for logic change introduced in D81730. 2020-07-09 15:45:23 +03:00
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols
StructurizeCFG [StructurizeCFG] Fix region nodes ordering 2020-06-01 12:50:35 +03:00
SyntheticCountsPropagation
TailCallElim Revert "[TRE] allow TRE for non-capturing calls." 2020-07-13 00:39:48 +03:00
ThinLTOBitcodeWriter ThinLTOBitcodeWriter: drop dso_local when a GlobalVariable is converted to a declaration 2020-03-05 18:09:33 -08:00
TypePromotion/ARM
UnifyLoopExits Introduce unify-loop-exits pass. 2020-03-30 13:23:56 -04:00
UniqueInternalLinkageNames New pass to make internal linkage symbol names unique. 2020-04-20 15:05:22 -07:00
Util Fix tests after 16f777f421 2020-07-14 22:52:26 +02:00
VectorCombine/X86 [VectorCombine] add tests for load vectorization; NFC 2020-07-23 11:24:04 -04:00
WholeProgramDevirt Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP" 2020-07-14 12:16:57 -07:00