1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/lib/Transforms/Utils
Atmn Patel 51ad1efef5 [LoopDeletion] Allows deletion of possibly infinite side-effect free loops
From C11 and C++11 onwards, a forward-progress requirement has been
introduced for both languages. In the case of C, loops with non-constant
conditionals that do not have any observable side-effects (as defined by
6.8.5p6) can be assumed by the implementation to terminate, and in the
case of C++, this assumption extends to all functions. The clang
frontend will emit the `mustprogress` function attribute for C++
functions (D86233, D85393, D86841) and emit the loop metadata
`llvm.loop.mustprogress` for every loop in C11 or later that has a
non-constant conditional.

This patch modifies LoopDeletion so that only loops with
the `llvm.loop.mustprogress` metadata or loops contained in functions
that are required to make progress (`mustprogress` or `willreturn`) are
checked for observable side-effects. If these loops do not have an
observable side-effect, then we delete them.

Loops without observable side-effects that do not satisfy the above
conditions will not be deleted.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D86844
2020-11-06 22:06:58 -05:00
..
AddDiscriminators.cpp
AMDGPUEmitPrintf.cpp
ASanStackFrameLayout.cpp
AssumeBundleBuilder.cpp [ValueTracking] Use assume's noundef operand bundle 2020-10-14 20:16:33 +09:00
BasicBlockUtils.cpp [Utils] Skip RemoveRedundantDbgInstrs in MergeBlockIntoPredecessor (PR47746) 2020-10-27 10:12:59 -07:00
BreakCriticalEdges.cpp
BuildLibCalls.cpp [InferAttrs] Add nocapture/writeonly to string/mem libcalls 2020-10-29 20:06:43 +01:00
BypassSlowDivision.cpp
CallGraphUpdater.cpp [NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass 2020-09-23 15:22:18 -07:00
CallPromotionUtils.cpp [Utils] isLegalToPromote - Fix missing null check before writing to FailureReason. 2020-09-15 14:49:04 +01:00
CanonicalizeAliases.cpp
CanonicalizeFreezeInLoops.cpp [ValueTracking] Use assume's noundef operand bundle 2020-10-14 20:16:33 +09:00
CloneFunction.cpp [Cloning] Fix to cloning DISubprograms. 2020-08-21 11:54:56 -07:00
CloneModule.cpp
CMakeLists.txt
CodeExtractor.cpp [CodeExtractor] Replace uses of extracted bitcasts in out-of-region lifetime markers 2020-11-05 17:01:08 -08:00
CodeMoverUtils.cpp
CtorUtils.cpp
Debugify.cpp [Debugify] Port -debugify-each to NewPM 2020-11-02 08:16:43 -08:00
DemoteRegToStack.cpp
EntryExitInstrumenter.cpp [musttail] Unify musttail call preceding return checking 2020-11-03 11:39:27 -08:00
EscapeEnumerator.cpp [musttail] Unify musttail call preceding return checking 2020-11-03 11:39:27 -08:00
Evaluator.cpp
FixIrreducible.cpp [FixIrreducible][NewPM] Port -fix-irreducible to NPM 2020-10-09 09:22:09 -07:00
FlattenCFG.cpp
FunctionComparator.cpp [SVE] Make ElementCount members private 2020-08-28 14:43:53 +01:00
FunctionImportUtils.cpp
GlobalStatus.cpp [globalopt] Teach to look through addrspacecast. 2020-10-16 08:43:09 -04:00
GuardUtils.cpp
ImportedFunctionsInliningStatistics.cpp
InjectTLIMappings.cpp
InlineFunction.cpp [Inliner] Consistently apply callsite noalias metadata 2020-10-31 10:54:45 +01:00
InstructionNamer.cpp Port -instnamer to NPM 2020-10-22 12:08:36 -07:00
IntegerDivision.cpp
LCSSA.cpp [LCSSA] Doc for special treatment of PHIs 2020-10-29 22:50:07 +02:00
LibCallsShrinkWrap.cpp
LLVMBuild.txt
Local.cpp Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
LoopPeel.cpp [NFC][SCEV] Refactor monotonic predicate checks to return enums instead of bools 2020-10-29 16:01:25 +07:00
LoopRotationUtils.cpp [Utils] Skip RemoveRedundantDbgInstrs in MergeBlockIntoPredecessor (PR47746) 2020-10-27 10:12:59 -07:00
LoopSimplify.cpp [NFC][LoopSimplify] modernize for loops over LoopInfo 2020-10-30 16:50:07 +00:00
LoopUnroll.cpp
LoopUnrollAndJam.cpp [NFC][LoopUnrollAndJam] Use BasicBlock::replacePhiUsesWith instead of 2020-08-11 15:35:14 +00:00
LoopUnrollRuntime.cpp
LoopUtils.cpp [LoopDeletion] Allows deletion of possibly infinite side-effect free loops 2020-11-06 22:06:58 -05:00
LoopVersioning.cpp [LoopVersioning] Form dedicated exits for versioned loop to preserve simplify form 2020-10-24 21:40:46 +08:00
LowerInvoke.cpp
LowerMemIntrinsics.cpp
LowerSwitch.cpp [LVI] Require context instruction in external API (NFCI) 2020-09-27 18:07:24 +02:00
MatrixUtils.cpp
Mem2Reg.cpp
MetaRenamer.cpp [MetaRenamer][NewPM] Port metarenamer to NPM 2020-10-02 15:42:25 -07:00
MisExpect.cpp Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
ModuleUtils.cpp
NameAnonGlobals.cpp
PredicateInfo.cpp
PromoteMemoryToRegister.cpp [mem2reg] Remove dbg.values describing contents of dead allocas 2020-10-23 04:46:56 +00:00
SanitizerStats.cpp
ScalarEvolutionExpander.cpp Reland "[TTI] Add VecPred argument to getCmpSelInstrCost." 2020-11-02 15:39:29 +00:00
SimplifyCFG.cpp Reland "[TTI] Add VecPred argument to getCmpSelInstrCost." 2020-11-02 15:39:29 +00:00
SimplifyIndVar.cpp [IndVarSimplify][SimplifyIndVar] Move WidenIV to Utils/SimplifyIndVar. NFCI. 2020-11-05 16:52:47 +00:00
SimplifyLibCalls.cpp [SimplifyLibCalls] Optimize mempcpy_chk to mempcpy 2020-10-06 17:08:46 +02:00
SizeOpts.cpp
SplitModule.cpp
SSAUpdater.cpp
SSAUpdaterBulk.cpp
StripGCRelocates.cpp Port StripGCRelocates pass to NPM 2020-10-07 14:41:29 -07:00
StripNonLineTableDebugInfo.cpp [NPM] Port strip nonlinetable debuginfo pass to the new pass manager 2020-10-07 14:35:36 -07:00
SymbolRewriter.cpp
UnifyFunctionExitNodes.cpp [NPM] Port -mergereturn to NPM 2020-10-20 10:33:58 -07:00
UnifyLoopExits.cpp Remove unnecessary header include which violates layering 2020-10-20 20:14:03 -07:00
UniqueInternalLinkageNames.cpp Prepend "__uniq" to symbol names hash with -funique-internal-linkage-names. 2020-10-26 14:24:28 -07:00
Utils.cpp [NPM] port -unify-loop-exits to NPM 2020-10-20 10:46:57 -07:00
ValueMapper.cpp Reapply "OpaquePtr: Add type to sret attribute" 2020-10-16 11:05:02 -04:00
VNCoercion.cpp [GVN] small improvements to comments 2020-11-03 13:21:48 -05:00