llvm-project/llvm/test/Transforms
Philip Reames ad5a84c883 [LoopPred/WC] Use a dominating widenable condition to remove analyze loop exits
This implements a version of the predicateLoopExits transform from IndVarSimplify extended to exploit widenable conditions - and thus be much wider in scope of legality. The code structure ends up being almost entirely different, so I chose to duplicate this into the LoopPredication pass instead of trying to reuse the code in the IndVars.

The core notions of the transform are as follows:

    If we have a widenable condition which controls entry into the loop, we're allowed to widen it arbitrarily. Given that, it's simply a *profitability* question as to what conditions to fold into the widenable branch.
    To avoid pass ordering issues, we want to avoid widening cases that would otherwise be dischargeable. Or... widen in a form which can still be discharged. Thus, we phrase the transform as selecting one analyzeable exit from the set of analyzeable exits to keep. This avoids creating pass ordering complexities.
    Since none of the above proves that we actually exit through our analyzeable exits - we might exit through something else entirely - we limit ourselves to cases where a) the latch is analyzeable and b) the latch is predicted taken, and c) the exit being removed is statically cold.

Differential Revision: https://reviews.llvm.org/D69830
2019-11-18 11:23:29 -08:00
..
ADCE Add missing test for r366215 2019-07-16 15:28:29 +00:00
AddDiscriminators
AggressiveInstCombine [NFC] run specific pass instead of whole -O3 pipeline for popcount recoginzation testcase. 2019-10-11 05:30:18 +00:00
AlignmentFromAssumptions [AlignmentFromAssumptions] getNewAlignmentDiff(): use getURemExpr() 2019-08-23 02:17:04 +00:00
ArgumentPromotion IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
AtomicExpand AMDGPU: Select global atomicrmw fadd 2019-11-06 16:06:38 -08:00
BDCE
BlockExtractor [BlockExtractor] Avoid assert with wrong line format 2019-08-20 14:46:02 +00:00
BranchFolding
CallSiteSplitting CallSiteSplitting: Respect convergent and noduplicate 2019-05-29 16:59:48 +00:00
CalledValuePropagation
CanonicalizeAliases
CodeExtractor [CodeExtractor] Fix sinking of allocas with multiple bitcast uses (PR42451) 2019-07-10 16:32:20 +00:00
CodeGenPrepare Reapply r374743 with a fix for the ocaml binding 2019-10-14 16:15:14 +00:00
ConstProp [ConstantFold] fix inconsistent handling of extractelement with undef index (PR42689) 2019-10-13 17:34:08 +00:00
ConstantHoisting [RISCV] Fix RISCVTTIImpl::getIntImmCost for immediates where getMinSignedBits() > 64 2019-07-09 10:56:18 +00:00
ConstantMerge
Coroutines [coroutine] Fixes "cannot move instruction since its users are not dominated by CoroBegin" problem. 2019-08-15 00:48:51 +00:00
CorrelatedValuePropagation [ConstantRange][LVI] Use overflow flags from `sub` to constrain the range 2019-11-07 16:18:03 +03:00
CrossDSOCFI
DCE [FPEnv] Strict FP tests should use the requisite function attributes. 2019-10-04 17:03:46 +00:00
DeadArgElim [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
DeadStoreElimination [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
DivRemPairs [DivRemPairs] Don't assert that we won't ever get expanded-form rem pairs in different BB's (PR43500) 2019-09-29 15:25:24 +00:00
EarlyCSE [IR] Fix mayReadFromMemory() for writeonly calls 2019-10-21 06:52:08 +00:00
EliminateAvailableExternally
EntryExitInstrumenter Reland "[ARM] push LR before __gnu_mcount_nc" 2019-08-16 23:30:16 +00:00
ExpandMemCmp [X86] Make memcmp vector lowering handle arbitrary expansions 2019-10-30 09:12:57 +02:00
Float2Int [Float2Int] avoid crashing on unreachable code (PR38502) 2019-09-19 16:31:17 +00:00
ForcedFunctionAttrs
FunctionAttrs [Attributor] Use nofree argument attribute for heap-to-stack conversion 2019-11-17 21:35:04 +01:00
FunctionImport Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
GCOVProfiling
GVN [GVN] Propagate simple equalities from assumes within the tail of the block 2019-09-03 17:31:19 +00:00
GVNHoist
GVNSink [GVNSink] Add unary FNeg support to GVNSink pass 2019-06-28 19:57:31 +00:00
GlobalDCE Reland: Dead Virtual Function Elimination 2019-10-17 09:58:57 +00:00
GlobalMerge
GlobalOpt [GlobalOpt] prevent crashing on large integer types (PR42932) 2019-08-09 12:43:25 +00:00
GlobalSplit
GuardWidening [WC] Fix a subtle bug in our definition of widenable branch 2019-11-06 14:16:34 -08:00
HardwareLoops Recommit "[HardwareLoops] Optimisation remarks" 2019-11-05 09:06:22 +00:00
HotColdSplit Invalidate assumption cache before outlining. 2019-10-04 22:46:42 +00:00
IPConstantProp [AbstractCallSite][FIX] Correct faulty assertion 2019-11-02 01:22:41 -05:00
IRCE [SCEV] Add smin support to getRangeRef 2019-09-12 21:32:27 +00:00
IndVarSimplify [LoopPred] Enable new transformation by default 2019-11-06 15:41:57 -08:00
IndirectBrExpand
InferAddressSpaces AMDGPU: Add intrinsics for address space identification 2019-09-05 02:20:39 +00:00
InferFunctionAttrs [Attributor] Use must-be-executed-context in align deduction 2019-11-12 06:41:19 +00:00
Inline Recommit "[CodeView] Add option to disable inline line tables." 2019-11-04 09:15:26 -08:00
InstCombine [ARM,MVE] Add InstCombine rules for pred_i2v / pred_v2i. 2019-11-18 10:39:30 +00:00
InstMerge [MergedLoadStoreMotion] Sink stores to BB with more than 2 predecessors 2019-09-05 17:00:32 +00:00
InstNamer
InstSimplify Revert 57dd4b0 "[ValueTracking] Allow context-sensitive nullness check for non-pointers" 2019-11-13 12:19:02 +01:00
InterleavedAccess
Internalize Reland: Dead Virtual Function Elimination 2019-10-17 09:58:57 +00:00
JumpThreading Temporarily Revert "Reapply [LVI] Normalize pointer behavior" as it's broken python 3.6. 2019-11-12 15:51:51 -08:00
LCSSA
LICM [TTI] Fix cast cost on vector types. 2019-11-13 13:54:07 -05:00
LoadStoreVectorizer Handle casts changing pointer size in the vectorizer 2019-08-02 04:03:37 +00:00
LoopDataPrefetch
LoopDeletion
LoopDistribute Revert "[IRBuilder] Fold consistently for or/and whether constant is LHS or RHS" 2019-07-07 22:12:01 +00:00
LoopFusion [LoopFusion] Add ability to fuse guarded loops 2019-09-26 21:42:45 +00:00
LoopIdiom Revert BCmp Loop Idiom recognition transform (PR43870) 2019-11-02 12:48:03 +03:00
LoopInstSimplify [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it. 2019-08-21 17:00:57 +00:00
LoopInterchange [LoopInterchange] Only skip PHIs with incoming values from the inner loop. 2019-11-12 10:30:51 +00:00
LoopLoadElim LoopLoadElim: Respect convergent 2019-06-12 13:50:47 +00:00
LoopPredication [LoopPred/WC] Use a dominating widenable condition to remove analyze loop exits 2019-11-18 11:23:29 -08:00
LoopReroll [SCEV] Use NoWrapFlags when expanding a simple mul 2019-06-17 10:05:18 +00:00
LoopRotate [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it. 2019-08-21 17:00:57 +00:00
LoopSimplify [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion 2019-06-19 10:50:47 +00:00
LoopSimplifyCFG
LoopStrengthReduce [NFC][LSR] Avoid undefined grep in pr2570.ll 2019-06-19 16:02:54 +00:00
LoopTransformWarning
LoopUnroll [LoopPred] Enable new transformation by default 2019-11-06 15:41:57 -08:00
LoopUnrollAndJam
LoopUnswitch [LoopUnroll+LoopUnswitch] do not transform loops containing callbr 2019-07-15 21:16:29 +00:00
LoopVectorize [ARM][MVE] tail-predication 2019-11-15 11:01:13 +00:00
LoopVersioning LoopVersioning: Respect convergent 2019-06-12 14:05:58 +00:00
LoopVersioningLICM LoopVersioningLICM: Respect convergent and noduplicate 2019-05-29 20:47:59 +00:00
LowerAtomic Transforms: lower fadd and fsub atomicrmw instructions 2019-05-23 17:03:43 +00:00
LowerConstantIntrinsics Reapply r374743 with a fix for the ocaml binding 2019-10-14 16:15:14 +00:00
LowerExpectIntrinsic Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
LowerGuardIntrinsic
LowerInvoke
LowerSwitch Fix a crash when the default of a switch is removed 2019-06-03 17:54:15 +00:00
LowerTypeTests LowerTypeTests: Rename local functions to avoid collisions with identically named functions in ThinLTO modules. 2019-10-03 23:42:44 +00:00
LowerWidenableCondition
MakeGuardsExplicit
Mem2Reg
MemCpyOpt [MemCpyOpt] Fixing Incorrect Code Motion while Handling Aggregate Type Values 2019-10-21 10:00:34 +00:00
MergeFunc [IR] Redefine Freeze instruction 2019-11-12 10:49:00 +09:00
MergeICmps [MergeICmps] Make the pass compatible with the new pass manager. 2019-05-23 12:35:26 +00:00
MetaRenamer
NameAnonGlobals
NaryReassociate
NewGVN [NewGVN] Check that call has an access. 2019-10-15 17:25:36 +00:00
ObjCARC [ObjC][ARC] Ignore lifetime markers between *ReturnValue calls 2019-11-05 06:39:22 -08:00
PGOProfile [PGO] Don't group COMDAT variables for compiler generated profile variables in ELF 2019-09-30 18:11:22 +00:00
PartiallyInlineLibCalls
PhaseOrdering [NFC][PhaseOrdering] Add end-to-end tests for the 'two shifts by sext' problem 2019-09-27 19:32:43 +00:00
PlaceSafepoints
PreISelIntrinsicLowering [ObjC] Override TailCallKind when lowering objc intrinsics 2019-11-11 08:30:06 -08:00
PruneEH
Reassociate [DBG][OPT] Attempt to salvage or undef debug info when removing trivially deletable instructions in the Reassociate Expression pass. 2019-11-12 15:17:04 +00:00
Reg2Mem
RewriteStatepointsForGC
SCCP [SCCP] Update condition to avoid overflow. 2019-07-31 18:22:22 +00:00
SLPVectorizer Revert "Temporarily Revert:" 2019-11-14 16:38:20 -05:00
SROA Revert [SROA] Reuse existing lifetime markers if possible 2019-10-15 04:32:07 +00:00
SafeStack [SafeStack] Insert the deref before remaining elements 2019-07-24 00:16:23 +00:00
SampleProfile Keep import function list for inlinee profile update 2019-11-06 18:36:00 -08:00
ScalarizeMaskedMemIntrin/X86 [ScalarizeMaskedMemIntrin] Add test case for expanding scatter. 2019-08-07 23:16:29 +00:00
Scalarizer [Scalarizer] Treat values from unreachable blocks as undef 2019-11-15 11:13:37 +01:00
SeparateConstOffsetFromGEP [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
SimpleLoopUnswitch [MemorySSA] Update for partial unswitch. 2019-10-14 23:52:39 +00:00
SimplifyCFG [SimplifyCFG] propagate fast-math-flags (FMF) from phi to select 2019-11-17 11:23:44 -05:00
Sink
SpeculateAroundPHIs Ignore indirect branches from callbr. 2019-08-14 16:44:07 +00:00
SpeculativeExecution Support FNeg in SpeculativeExecution pass 2019-05-14 16:51:18 +00:00
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols
StructurizeCFG StructurizeCFG: Relax uniformity checks. 2019-05-24 08:59:17 +00:00
SyntheticCountsPropagation
TailCallElim
ThinLTOBitcodeWriter cfi-icall: Allow the jump table to be optionally made non-canonical. 2019-08-09 22:31:59 +00:00
Util [SVFS] Inject TLI Mappings in VFABI attribute. 2019-11-15 18:42:56 +00:00
WholeProgramDevirt IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00