llvm-project/llvm/lib/Transforms/Utils
Alina Sbirlea 5545e6963f [SimplifyCFG] Cleanup redundant conditions [NFC].
Summary:
Since the for loop iterates over BB's predecessors, the branch conditions found must have BB as one of the successors.
For an unconditional branch the successor must be BB, added `assert`.
For a conditional branch, one of the two successors must be BB, simplify `else if` to `else` and `assert`.
Sink common instructions outside the if/else block.

Reviewers: sanjoy.google

Subscribers: jlebar, llvm-commits

Tags: #llvm

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

llvm-svn: 367699
2019-08-02 18:06:54 +00:00
..
ASanStackFrameLayout.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
AddDiscriminators.cpp [llvm] Clarify responsiblity of some of DILocation discriminator APIs 2019-01-24 00:10:25 +00:00
BasicBlockUtils.cpp [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion 2019-06-19 10:50:47 +00:00
BreakCriticalEdges.cpp [SanitizerCoverage] Avoid splitting critical edges when destination is a basic block containing unreachable 2019-03-12 18:20:25 +00:00
BuildLibCalls.cpp Add, and infer, a nofree function attribute 2019-07-08 15:57:56 +00:00
BypassSlowDivision.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
CallPromotionUtils.cpp [PGO] Update ICP pass for recent byval type changes 2019-07-01 22:43:39 +00:00
CanonicalizeAliases.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CloneFunction.cpp Keep the order of the basic blocks in the cloned loop as the original 2019-07-08 18:30:35 +00:00
CloneModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeExtractor.cpp ARM MTE stack sanitizer. 2019-07-15 20:02:23 +00:00
CtorUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DemoteRegToStack.cpp [opaque pointer types] Pass value type to LoadInst creation. 2019-02-01 20:44:24 +00:00
EntryExitInstrumenter.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
EscapeEnumerator.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
Evaluator.cpp [Evaluator] Walk initial elements when handling load through bitcast 2019-04-25 17:00:01 +00:00
FlattenCFG.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionComparator.cpp IR: compare type attributes deeply when looking into functions. 2019-06-27 11:44:45 +00:00
FunctionImportUtils.cpp [ThinLTO] Attempt to recommit r365188 after alignment fix 2019-07-05 15:25:05 +00:00
GlobalStatus.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GuardUtils.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImportedFunctionsInliningStatistics.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InlineFunction.cpp Delete dead stores 2019-07-12 14:58:15 +00:00
InstructionNamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntegerDivision.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LCSSA.cpp [MemorySSA] LCSSA preserves MemorySSA. 2019-04-23 20:59:44 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LibCallsShrinkWrap.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Local.cpp [Utils] remove duplicated documentation comments; NFC 2019-07-25 13:11:21 +00:00
LoopRotationUtils.cpp [LoopRotate + MemorySSA] Keep an <instruction-cloned instruction> map. 2019-07-10 17:36:56 +00:00
LoopSimplify.cpp [MemorySSA] Set LoopSimplify to preserve MemorySSA in the NPM, if analysis exists. 2019-08-01 18:28:28 +00:00
LoopUnroll.cpp [Loop Peeling] Enable peeling for loops with multiple exits 2019-07-15 08:26:45 +00:00
LoopUnrollAndJam.cpp [Utils] Clean another duplicated util method. 2019-06-04 18:45:15 +00:00
LoopUnrollPeel.cpp [Loop Peeling] Do not close further unroll/peel if profile based peeling was not used. 2019-08-02 04:29:23 +00:00
LoopUnrollRuntime.cpp [LoopInfo] Introduce getUniqueNonLatchExitBlocks utility function 2019-07-15 05:51:10 +00:00
LoopUtils.cpp [Loop Utils] Extend the scope of addStringMetadataToLoop. 2019-07-26 07:04:34 +00:00
LoopVersioning.cpp LoopVersioning: Respect convergent 2019-06-12 14:05:58 +00:00
LowerInvoke.cpp [opaque pointer types] Pass function types to CallInst creation. 2019-02-01 20:43:25 +00:00
LowerMemIntrinsics.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
LowerSwitch.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
Mem2Reg.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MetaRenamer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ModuleUtils.cpp [IR] Disallow llvm.global_ctors and llvm.global_dtors of the 2-field form in textual format 2019-05-15 02:35:32 +00:00
NameAnonGlobals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PredicateInfo.cpp [PredicateInfo] Replace pointer comparisons with deterministic compares. 2019-07-25 20:48:13 +00:00
PromoteMemoryToRegister.cpp [Mem2Reg] Delete unused PointerAllocaValues 2019-04-14 07:28:29 +00:00
SSAUpdater.cpp [LICM/MSSA] Add promotion to scalars by building an AliasSetTracker with MemorySSA. 2019-02-06 20:25:17 +00:00
SSAUpdaterBulk.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SanitizerStats.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
SimplifyCFG.cpp [SimplifyCFG] Cleanup redundant conditions [NFC]. 2019-08-02 18:06:54 +00:00
SimplifyIndVar.cpp [SimplifyIndVar] Simplify non-overflowing saturating add/sub 2019-06-15 08:48:52 +00:00
SimplifyLibCalls.cpp [InstCombine] Swap order of checks to improve compile time (NFC) 2019-07-24 23:31:04 +00:00
SizeOpts.cpp [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
SplitModule.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripGCRelocates.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripNonLineTableDebugInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SymbolRewriter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
UnifyFunctionExitNodes.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Utils.cpp [LLVM-C] Expose the "Add Discriminators" Pass To LLVM-C 2019-03-15 16:57:23 +00:00
VNCoercion.cpp [GVN] non-functional code movement 2019-06-07 23:08:38 +00:00
ValueMapper.cpp Reapply: IR: add optional type to 'byval' function parameters 2019-05-30 18:48:23 +00:00