llvm-project/llvm/test/Transforms/SimplifyCFG
Serguei Katkov 66182d6c38 [SimplifyCFG] Re-apply Relax restriction for folding unconditional branches
The commit rL308422 introduces a restriction for folding unconditional
branches. Specifically if empty block with unconditional branch leads to
header of the loop then elimination of this basic block is prohibited.
However it seems this condition is redundantly strict.
If elimination of this basic block does not introduce more back edges
then we can eliminate this block.

The patch implements this relax of restriction.

The test profile/Linux/counter_promo_nest.c in compiler-rt project
is updated to meet this change.

Reviewers: efriedma, mcrosier, pacxx, hsung, davidxl	
Reviewed By: pacxx
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42691

llvm-svn: 324572
2018-02-08 07:16:29 +00:00
..
AArch64 [SimplifyCFG] Rewrite SinkThenElseCodeToEnd 2016-08-22 19:07:15 +00:00
AMDGPU AMDGPU: Remove -mcpu=SI 2017-08-07 18:30:35 +00:00
ARM [SimplifyCFG] use pass options and remove the latesimplifycfg pass 2017-10-28 18:43:07 +00:00
Hexagon [Hexagon] Remove trailing spaces, NFC 2017-11-22 20:43:00 +00:00
Mips
PowerPC Fix some misc. -enable-var-scope violations 2017-11-13 01:47:52 +00:00
SPARC
X86 Revert r321377, it causes regression to https://reviews.llvm.org/P8055. 2017-12-28 17:02:34 +00:00
2002-05-21-PHIElimination.ll
2002-09-24-PHIAssertion.ll
2003-03-07-DominateProblem.ll
2003-08-05-InvokeCrash.ll
2003-08-17-BranchFold.ll
2003-08-17-BranchFoldOrdering.ll
2003-08-17-FoldSwitch-dbg.ll
2003-08-17-FoldSwitch.ll regenerate checks 2016-03-28 22:12:21 +00:00
2004-12-10-SimplifyCFGCrash.ll
2005-06-16-PHICrash.ll
2005-08-01-PHIUpdateFail.ll
2005-10-02-InvokeSimplify.ll
2005-12-03-IncorrectPHIFold.ll
2006-02-17-InfiniteUnroll.ll
2006-06-12-InfLoop.ll
2006-08-03-Crash.ll
2006-10-19-UncondDiv.ll
2006-12-08-Ptr-ICmp-Branch.ll
2007-11-22-InvokeNoUnwind.ll
2007-12-21-Crash.ll
2008-01-02-hoist-fp-add.ll
2008-05-16-PHIBlockMerge.ll [SimlifyCFG] Prevent passes from destroying canonical loop structure, especially for nested loops 2016-03-29 04:08:57 +00:00
2008-07-13-InfLoopMiscompile.ll remove the metadata added with r267827 2016-04-30 00:02:36 +00:00
2008-09-08-MultiplePred.ll
2008-09-17-SpeculativeHoist.ll
2008-10-03-SpeculativelyExecuteBeforePHI.ll
2008-12-06-SingleEntryPhi.ll
2008-12-16-DCECond.ll
2009-01-18-PHIPropCrash.ll
2009-05-12-externweak.ll
2010-03-30-InvokeCrash.ll
2011-03-08-UnreachableUse.ll
2011-09-05-TrivialLPad.ll
BrUnwind.ll
ConditionalTrappingConstantExpr.ll [Constant] remove fdiv and frem from canTrap() 2016-08-29 15:27:17 +00:00
CoveredLookupTable.ll [SimplifyCFG] use pass options and remove the latesimplifycfg pass 2017-10-28 18:43:07 +00:00
DeadSetCC.ll
EmptyBlockMerge.ll
EqualPHIEdgeBlockMerge.ll [SimlifyCFG] Prevent passes from destroying canonical loop structure, especially for nested loops 2016-03-29 04:08:57 +00:00
ForwardSwitchConditionToPHI.ll [SimplifyCFG] use pass options and remove the latesimplifycfg pass 2017-10-28 18:43:07 +00:00
HoistCode.ll
InfLoop.ll [SimplifyCFG] Fix for "endless" loop after dead code removal (Alternative to 2016-02-03 23:54:25 +00:00
MagicPointer.ll
PHINode.ll
PR9946.ll
PR16069.ll regenerate checks 2016-03-28 22:12:21 +00:00
PR17073.ll
PR25267.ll
PR27615-simplify-cond-br.ll Canonicalize the representation of empty an expression in DIGlobalVariableExpression 2017-08-30 18:06:51 +00:00
PR29163.ll [SimplifyCFG] Hoisting invalidates metadata 2016-08-29 17:14:08 +00:00
PR30210.ll Add a test for r280191 2016-09-16 02:43:36 +00:00
PhiBlockMerge.ll regenerate checks 2016-03-28 22:12:21 +00:00
PhiBlockMerge2.ll
PhiEliminate.ll
PhiEliminate2.ll propagate 'unpredictable' metadata on select instructions 2016-03-17 15:30:52 +00:00
PhiEliminate3.ll
PhiNoEliminate.ll
SpeculativeExec.ll [SimplifyCFG] Regenerate some test cases using update_test_checks.py to prepare for an upcoming commit. NFC 2017-10-31 19:03:49 +00:00
UncondBranchToHeader.ll [SimplifyCFG] Re-apply Relax restriction for folding unconditional branches 2018-02-08 07:16:29 +00:00
UncondBranchToReturn.ll
UnreachableEliminate.ll [SimplifyCFG] Replace calls to null/undef with unreachable 2016-06-25 07:37:27 +00:00
assume.ll
attr-convergent.ll [SimplifyCFG] Don't fold conditional branches that contain calls to convergent functions. 2016-02-12 21:01:36 +00:00
attr-noduplicate.ll
basictest.ll [Verifier] Add verification for TBAA metadata 2016-12-11 20:07:15 +00:00
branch-cond-merge.ll
branch-cond-prop.ll
branch-fold-dbg.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
branch-fold-test.ll
branch-fold-threshold.ll
branch-fold.ll
branch-phi-thread.ll
bug-25299.ll [SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad. 2016-01-10 05:48:01 +00:00
clamp.ll
combine-parallel-mem-md.ll [SimplifyCFG] Preserve !llvm.mem.parallel_loop_access when merging 2016-04-26 02:06:06 +00:00
common-dest-folding.ll
critedge-assume.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
dbginfo.ll
dce-cond-after-folding-terminator.ll
div-rem-pairs.ll [SimplifyCFG] update test comments; NFC 2017-09-12 23:28:11 +00:00
duplicate-landingpad.ll
duplicate-phis.ll
empty-catchpad.ll [WinEH] Simplify unreachable catchpads 2016-01-05 02:37:41 +00:00
empty-cleanuppad.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
extract-cost.ll
gepcost.ll [TTI] Fix getGEPCost() for geps with a single operand. 2017-09-01 19:54:08 +00:00
guards.ll [SimplifyCFG] Regenerate some test cases using update_test_checks.py to prepare for an upcoming commit. NFC 2017-10-31 19:03:49 +00:00
hoist-common-code.ll
hoist-dbgvalue.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
hoist-with-range.ll
implied-and-or.ll [ValueTracking] Support icmps fed by 'and' and 'or'. 2017-07-06 20:00:25 +00:00
implied-cond-matching-false-dest.ll [ValueTracking] Improve isImpliedCondition when the dominating cond is false. 2016-04-25 17:23:36 +00:00
implied-cond-matching-imm.ll [ValueTracking] Improve isImpliedCondition for matching LHS and Imm RHSs. 2016-05-05 15:39:18 +00:00
implied-cond-matching.ll Fix typo from r267432. 2016-04-25 18:20:27 +00:00
implied-cond.ll
indirectbr.ll
inline-asm-sink.ll Fix some misc. -enable-var-scope violations 2017-11-13 01:47:52 +00:00
invoke.ll Revert "[SimplifyCFG] Stop inserting calls to llvm.trap for UB" 2016-06-25 08:19:55 +00:00
invoke_unwind.ll [SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad. 2016-01-10 05:48:01 +00:00
iterative-simplify.ll
lifetime.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
merge-cleanuppads.ll [SimplifyCFG] Merge together cleanuppads 2016-02-20 01:07:45 +00:00
merge-cond-stores-2.ll [SimplifyCFG] When merging conditional stores, don't count the store we're merging against the PHINodeFoldingThreshold 2017-11-03 21:08:13 +00:00
merge-cond-stores.ll [SimplifyCFG] Fix the determination of PostBB in conditional store merging to handle the targets on the second branch being commuted 2017-04-21 15:53:42 +00:00
multiple-phis.ll [SimplifyCFG] Regenerate some test cases using update_test_checks.py to prepare for an upcoming commit. NFC 2017-10-31 19:03:49 +00:00
no-md-sink.ll [SimplifyCFG] don't sink common insts too soon (PR34603) 2017-12-14 22:05:20 +00:00
no_speculative_loads_with_asan.ll Hardware-assisted AddressSanitizer (llvm part). 2017-12-09 00:21:41 +00:00
no_speculative_loads_with_tsan.ll
noreturn-call.ll
phi-undef-loadstore.ll
pr33605.ll [SimplifyCFG] Defer folding unconditional branches to LateSimplifyCFG if it can destroy canonical loop structure. 2017-07-19 08:53:34 +00:00
pr34131.ll [SimplifyCFG] remove checks for crasher test from r310481 2017-08-09 18:56:26 +00:00
pr35774.ll [SimplifyCFG] Stop hoisting musttail calls incorrectly. 2017-12-31 16:47:16 +00:00
preserve-branchweights-partial.ll
preserve-branchweights-switch-create.ll
preserve-branchweights.ll Follow-up patch of http://reviews.llvm.org/D19948 to handle missing profiles when simplifying CFG. 2016-05-18 22:41:03 +00:00
preserve-llvm-loop-metadata.ll [SimplifyCFG] use pass options and remove the latesimplifycfg pass 2017-10-28 18:43:07 +00:00
preserve-load-metadata-2.ll
preserve-load-metadata-3.ll
preserve-load-metadata.ll
preserve-make-implicit-on-switch-to-br.ll
preserve-store-alignment.ll [SimplifyCFG] Fix for PR34219: Preserve alignment after merging conditional stores. 2017-08-29 20:06:24 +00:00
rangereduce.ll [SimplifyCFG] use pass options and remove the latesimplifycfg pass 2017-10-28 18:43:07 +00:00
remove-debug-2.ll [InstCombine] Merge DebugLoc when speculatively hoisting store instruction 2017-01-28 07:05:43 +00:00
remove-debug.ll Update getMergedLocation to check the instruction type and merge properly. 2017-10-02 18:13:14 +00:00
return-merge.ll
seh-nounwind.ll
select-gep.ll [SimplifyCFG] Regenerate some test cases using update_test_checks.py to prepare for an upcoming commit. NFC 2017-10-31 19:03:49 +00:00
sink-common-code.ll [SimplifyCFG] don't sink common insts too soon (PR34603) 2017-12-14 22:05:20 +00:00
speculate-call.ll [ValueTracking] Teach isSafeToSpeculativelyExecute() about the speculatable attribute 2017-04-28 21:13:09 +00:00
speculate-dbgvalue.ll [SimplifyCFG] Discard speculated dbg intrinsics 2017-11-02 11:55:14 +00:00
speculate-math.ll Revert "Revert "[SimplifyCFG] allow speculation of exactly one expensive instruction (PR24818)"" 2016-01-27 02:59:41 +00:00
speculate-store.ll [SimplifyCFG] propagate branch metadata when creating select (PR26636) 2016-03-26 23:30:50 +00:00
speculate-vector-ops.ll
speculate-with-offset.ll
statepoint-invoke-unwind.ll [gc.statepoint] Change gc.statepoint intrinsic's return type to token type instead of i32 type 2015-12-26 07:54:32 +00:00
suppress-zero-branch-weights.ll [SimplifyCFG] Fix a test case. 2017-11-09 23:17:52 +00:00
switch-dead-default.ll Revert @llvm.assume with operator bundles (r289755-r289757) 2016-12-19 08:22:17 +00:00
switch-masked-bits.ll [SimplifyCFG] eliminate switch cases based on known range of switch condition 2016-05-20 14:53:09 +00:00
switch-on-const-select.ll Fix some misc. -enable-var-scope violations 2017-11-13 01:47:52 +00:00
switch-range-to-icmp.ll
switch-simplify-crash.ll
switch-to-br.ll
switch-to-icmp.ll
switch-to-select-multiple-edge-per-block-phi.ll [SimplifyCFG] auto-generate better checks; NFC 2016-11-25 21:12:39 +00:00
switch-to-select-two-case.ll [SimplifyCFG] auto-generate better checks; NFC 2016-11-25 21:12:39 +00:00
switch_create.ll opt: Rename -default-data-layout flag to -data-layout and make it always override the layout. 2017-02-17 17:36:52 +00:00
switch_switch_fold.ll use FileCheck for tighter checking 2016-03-16 23:39:37 +00:00
switch_thread.ll reduce check strings; no need to check IR comments 2016-03-16 23:22:01 +00:00
switch_undef.ll Bail out of a SimplifyCFG switch table opt at undef values. 2017-12-05 14:14:00 +00:00
trap-debugloc.ll Revert "[SimplifyCFG] Stop inserting calls to llvm.trap for UB" 2016-06-25 08:19:55 +00:00
trapping-load-unreachable.ll Revert "[SimplifyCFG] Stop inserting calls to llvm.trap for UB" 2016-06-25 08:19:55 +00:00
two-entry-phi-return.ll [SimplifyCFG] propagate branch metadata when creating select (PR27344) 2016-04-15 15:32:12 +00:00
unreachable-blocks.ll
unreachable-cleanuppad.ll [SimplifyCFG] Do not blindly remove unreachable blocks 2016-02-24 10:02:16 +00:00
volatile-phioper.ll
wineh-unreachable.ll [SimplifyCFG] Further improve our ability to remove redundant catchpads 2016-01-05 07:42:17 +00:00