llvm-project/llvm/lib/Transforms/Scalar
Stelios Ioannou 1124ad2f5d [LoopFlatten] Simplify loops so that the pass can operate on unsimplified loops.
The loop flattening pass requires loops to be in simplified form. If the
loops are not in simplified form, the pass cannot operate. This patch
simplifies all loops before flattening. As a result, all loops will be
simplified regardless of whether anything ends up being flattened.

This change was inspired by observing a certain loop that was not flatten
because the loops were not in simplified form. This loop is added as a
test to verify that it is now flattened.

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

Change-Id: I45bcabe70fb99b0d89f0effafc82eb9e0585ec30
2021-05-12 19:22:01 +01:00
..
ADCE.cpp Reapply "[DebugInfo] Handle multiple variable location operands in IR" 2021-03-17 16:45:25 +00:00
AlignmentFromAssumptions.cpp [AssumeBundles] offset should be added to correctly calculate align 2021-04-02 12:32:05 +09:00
AnnotationRemarks.cpp [AnnotationRemarks] Use subprogram location for summary remarks. 2021-03-23 12:05:41 +00:00
BDCE.cpp
CMakeLists.txt [ScalarizeMaskedMemIntrinsic] Move from CodeGen into Transforms 2020-12-08 12:25:58 -05:00
CallSiteSplitting.cpp [Support] Introduce a new InstructionCost class 2020-12-11 08:12:54 +00:00
ConstantHoisting.cpp [TTI] NFC: Change getIntImmCost[Inst|Intrin] to return InstructionCost 2021-04-23 16:06:36 +01:00
ConstraintElimination.cpp [ConstraintElimination] Only strip casts preserving the representation. 2021-03-26 20:07:41 +00:00
CorrelatedValuePropagation.cpp [CVP] processCallSite returns wrong status 2021-04-19 12:13:22 +07:00
DCE.cpp [Scalar] Use range-based for loops (NFC) 2021-02-25 19:54:38 -08:00
DeadStoreElimination.cpp [DSE] Eliminate zero memset after calloc 2021-04-28 03:30:52 +02:00
DivRemPairs.cpp [ValueTracking] Use assume's noundef operand bundle 2020-10-14 20:16:33 +09:00
EarlyCSE.cpp Use AssumeInst in a few more places [nfc] 2021-04-06 13:18:53 -07:00
FlattenCFGPass.cpp [NFC] Reduce include files dependency and AA header cleanup (part 2). 2020-12-17 14:04:48 +03:00
Float2Int.cpp [NFC] Reduce include files dependency and AA header cleanup (part 2). 2020-12-17 14:04:48 +03:00
GVN.cpp Revert "[GVN] Clobber partially aliased loads." 2021-05-11 16:08:53 -07:00
GVNHoist.cpp Require chained analyses in BasicAA and AAResults to be transitive 2021-01-11 11:50:07 +01:00
GVNSink.cpp [Transforms] Use llvm::append_range (NFC) 2021-01-20 21:35:54 -08:00
GuardWidening.cpp [llvm] Use llvm::all_of (NFC) 2021-01-19 20:19:17 -08:00
IVUsersPrinter.cpp
IndVarSimplify.cpp [IndVarSimplify][NFC] Removed mayThrow from if-condition in predicateLoopExits of IndVarSimplify 2021-05-03 18:25:07 -07:00
InductiveRangeCheckElimination.cpp [NFC][NewPM] Remove some AnalysisManager invalidate methods 2021-04-15 16:51:26 -07:00
InferAddressSpaces.cpp [NewPM] Port infer-address-spaces 2020-12-28 19:58:12 -08:00
InstSimplifyPass.cpp
JumpThreading.cpp [JumpThreading] merge debug info when merging select+br 2021-04-12 17:51:21 -07:00
LICM.cpp Revert "[LICM] Hoist loads with invariant.group metadata" 2021-05-08 15:44:49 +03:00
LoopAccessAnalysisPrinter.cpp
LoopDataPrefetch.cpp
LoopDeletion.cpp [LoopDeletion] Handle inner loops w/untaken backedges 2021-01-22 16:31:29 -08:00
LoopDistribute.cpp [NFC] Reduce include files dependency and AA header cleanup (part 2). 2020-12-17 14:04:48 +03:00
LoopFlatten.cpp [LoopFlatten] Simplify loops so that the pass can operate on unsimplified loops. 2021-05-12 19:22:01 +01:00
LoopFuse.cpp [ADT] Remove StatisticBase and make NoopStatistic empty 2021-04-26 16:47:32 -07:00
LoopIdiomRecognize.cpp [loop-idiom] Hoist loop memcpys to loop preheader 2021-05-04 17:05:04 -07:00
LoopInstSimplify.cpp
LoopInterchange.cpp [LoopInterchange] Handle lcssa PHIs with multiple predecessors 2021-05-11 21:30:54 -04:00
LoopLoadElimination.cpp [LoopLoadElim] Pass ScalarEvolution in old pass manager. PR49141 2021-02-15 18:08:23 +07:00
LoopPassManager.cpp [NewPM] Hide pass manager debug logging behind -debug-pass-manager-verbose 2021-05-07 21:51:47 -07:00
LoopPredication.cpp [BPI] Improve static heuristics for "cold" paths. 2020-12-23 22:47:36 +07:00
LoopRerollPass.cpp [LoopReroll] Fix rerolling loop with extra instructions 2021-04-23 15:14:46 +09:00
LoopRotation.cpp [LoopRotate] Don't split loop pass manager 2021-04-08 22:05:18 +02:00
LoopSimplifyCFG.cpp [DominatorTree] Add support for mixed pre/post CFG views. 2021-01-06 14:53:09 -08:00
LoopSink.cpp [llvm] Use set_is_subset (NFC) 2021-02-28 10:59:20 -08:00
LoopStrengthReduce.cpp [LSR][DebugInfo] Don't unnecessarily drop DebugLocs 2021-04-26 13:14:42 +01:00
LoopUnrollAndJamPass.cpp
LoopUnrollPass.cpp NFC: Migrate LoopUnrollPass to work on InstructionCost 2021-02-04 14:05:40 +00:00
LoopUnswitch.cpp Add a subclass of IntrinsicInst for llvm.assume [nfc] 2021-04-06 11:16:22 -07:00
LoopVersioningLICM.cpp [SCEV] Use isa<> pattern for testing for CouldNotCompute [NFC] 2020-11-24 18:47:49 -08:00
LowerAtomic.cpp [NVPTX] Enable lowering of atomics on local memory 2021-04-26 20:12:12 -04:00
LowerConstantIntrinsics.cpp [LowerConstantIntrinsics] Preserve Dominator Tree, if avaliable 2021-01-30 01:14:50 +03:00
LowerExpectIntrinsic.cpp [TargetTransformInfo] move branch probability query from TargetLoweringInfo 2021-03-22 15:55:34 -04:00
LowerGuardIntrinsic.cpp
LowerMatrixIntrinsics.cpp [NFC][AA] Prepare to convert AliasResult to class with PartialAlias offset. 2021-04-09 12:54:22 +03:00
LowerWidenableCondition.cpp
MakeGuardsExplicit.cpp
MemCpyOptimizer.cpp [CSSPGO] Unblock optimizations with pseudo probe instrumentation part 2. 2021-04-26 16:52:33 -07:00
MergeICmps.cpp [llvm][NFC] Fix assert indentation 2021-04-23 14:44:05 +02:00
MergedLoadStoreMotion.cpp
NaryReassociate.cpp [NARY] Don't optimize min/max if there are side uses (part2) 2021-04-30 19:02:02 +07:00
NewGVN.cpp [NewGVN] Properly transfer PredDep in move constructor. 2021-04-25 11:22:59 +01:00
PartiallyInlineLibCalls.cpp [PartiallyInlineLibCalls] Preserve Dominator Tree, if avaliable 2021-01-29 01:11:36 +03:00
PlaceSafepoints.cpp [Transforms] Use llvm::append_range (NFC) 2020-12-27 09:57:29 -08:00
Reassociate.cpp [Reassociate] allow or->add with shl operands 2021-02-07 09:45:19 -05:00
Reg2Mem.cpp [Reg2Mem] add support for the new pass manager 2020-11-08 11:14:05 +00:00
RewriteStatepointsForGC.cpp [rs4gc] Fix a latent bug around attribute stripping for intrinsics 2021-04-19 13:14:07 -07:00
SCCP.cpp [SCCP] Follow up of rGbbab9f986c6d. NFC. 2021-04-14 17:14:46 +01:00
SROA.cpp [SROA] Allow SROA on pointers with invariant group intrinsic uses 2021-04-05 19:53:40 -07:00
Scalar.cpp [ScalarizeMaskedMemIntrin] Add new PM support 2020-12-08 17:15:22 -05:00
ScalarizeMaskedMemIntrin.cpp Expand masked mem intrinsics correctly wrt big-endian 2021-02-11 08:59:52 +00:00
Scalarizer.cpp [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
SeparateConstOffsetFromGEP.cpp SeparateConstOffsetFromGEP::lowerToSingleIndexGEPs - don't use dyn_cast_or_null. NFCI. 2020-12-15 17:27:25 +00:00
SimpleLoopUnswitch.cpp [SimpleLoopUnswitch] Port partially invariant unswitch from LoopUnswitch to SimpleLoopUnswitch 2021-04-30 15:55:56 +01:00
SimplifyCFGPass.cpp [NFCI][SimplifyCFG] mergeEmptyReturnBlocks(): improve Dominator Tree updating 2021-04-11 23:56:23 +03:00
Sink.cpp [CSSPGO] Unblock optimizations with pseudo probe instrumentation part 2. 2021-04-26 16:52:33 -07:00
SpeculateAroundPHIs.cpp NFC: Migrate SpeculateAroundPHIs to work on InstructionCost 2021-02-02 13:32:45 +00:00
SpeculativeExecution.cpp Reapply "[DebugInfo] Handle multiple variable location operands in IR" 2021-03-17 16:45:25 +00:00
StraightLineStrengthReduce.cpp [Transforms/Scalar] Use range-based for loops (NFC) 2021-02-04 21:18:05 -08:00
StructurizeCFG.cpp [Scalar] Use range-based for loops (NFC) 2021-02-25 19:54:38 -08:00
TailRecursionElimination.cpp Normalize interaction with boolean attributes 2021-04-17 08:17:33 +02:00
WarnMissedTransforms.cpp [SVE] Add support for scalable vectors with vectorize.scalable.enable loop attribute 2020-12-02 13:23:43 +00:00