llvm-project/polly/test/ScopDetect
Tobias Grosser bbaeda3fe5 Do not allow switch statements in loop latches
In r248701 "Allow switch instructions in SCoPs" support for switch statements
has been introduced, but support for switch statements in loop latches was
incomplete. This change completely disables switch statements in loop latches.

The original commit changed addLoopBoundsToHeaderDomain to support non-branch
terminator instructions, but this change was incorrect: it added a check for
BI != null to the if-branch of a condition, but BI was used in the else branch
es well. As a result, when a non-branch terminator instruction is encounted a
nullptr dereference is triggered. Due to missing test coverage, this bug was
overlooked.

r249273 "[FIX] Approximate non-affine loops correctly" added code to disallow
switch statements for non-affine loops, if they appear in either a loop latch
or a loop exit. We adapt this code to now prohibit switch statements in
loop latches even if the control condition is affine.

We could possibly add support for switch statements in loop latches, but such
support should be evaluated and tested separately.

This fixes llvm.org/PR30952

Reported-by: Eli Friedman <efriedma@codeaurora.org>
llvm-svn: 286426
2016-11-10 05:20:29 +00:00
..
aliasing_parametric_simple_1.ll Remove -polly-code-generator=isl from many test cases 2015-11-21 23:05:48 +00:00
aliasing_parametric_simple_2.ll Remove -polly-code-generator=isl from many test cases 2015-11-21 23:05:48 +00:00
aliasing_simple_1.ll Remove -polly-code-generator=isl from many test cases 2015-11-21 23:05:48 +00:00
aliasing_simple_2.ll Remove -polly-code-generator=isl from many test cases 2015-11-21 23:05:48 +00:00
base_pointer.ll Allow invariant loads in the SCoP description 2015-10-07 20:17:36 +00:00
cross_loop_non_single_exit.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
cross_loop_non_single_exit_2.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
dependency_to_phi_node_outside_of_region.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
dot-scops.ll [ScopDetect] Depend transitively on ScalarEvolution. 2016-10-17 13:29:20 +00:00
error-block-always-executed.ll Remove -polly-code-generator=isl from many test cases 2015-11-21 23:05:48 +00:00
error-block-referenced-from-scop.ll Remove -polly-code-generator=isl from many test cases 2015-11-21 23:05:48 +00:00
expand-region-correctly-2.ll tests: Add test cases for LLVM commit r251267 2015-10-25 22:56:42 +00:00
expand-region-correctly.ll tests: Add test cases for LLVM commit r251267 2015-10-25 22:56:42 +00:00
index_from_unpredictable_loop.ll [SCEVValidator] Fix loop exit values considered affine. 2016-03-03 22:10:52 +00:00
indvars.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
intrinsics_1.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
intrinsics_2.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
intrinsics_3.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
invalid-latch-conditions.ll Introduce -polly-process-unprofitable 2015-10-06 16:10:29 +00:00
invalidate_scalar_evolution.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
keep_going_expansion.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
mod_ref_read_pointer.ll Add option to disallow modref function calls in scops. 2016-03-23 06:40:15 +00:00
more-than-one-loop.ll Remove -polly-code-generator=isl from many test cases 2015-11-21 23:05:48 +00:00
multidim-with-undef-size.ll ScopDetection: Always refuse multi-dimensional memory accesses with 'undef' in 2015-10-25 08:40:38 +00:00
multidim.ll ScopDetection: Do not crash if we find zero array size candidates for delinearization 2015-10-25 08:40:44 +00:00
multidim_indirect_access.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
multidim_two_accesses_different_delinearization.ll Drop explicit -polly-delinearize parameter 2016-03-23 13:21:02 +00:00
nested_loop_single_exit.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
non-affine-conditional.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
non-affine-float-compare.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
non-affine-loop-condition-dependent-access.ll Allow invariant loads in the SCoP description 2015-10-07 20:17:36 +00:00
non-affine-loop-condition-dependent-access_2.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
non-affine-loop-condition-dependent-access_3.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
non-affine-loop.ll Introduce -polly-process-unprofitable 2015-10-06 16:10:29 +00:00
non-beneficial-loops-small-trip-count.ll Introduce -polly-process-unprofitable 2015-10-06 16:10:29 +00:00
non-constant-add-rec-start-expr.ll [ScopDetect] Do not assert in case of AddRecs with non-constant start expression 2016-08-15 20:59:30 +00:00
non-simple-memory-accesses.ll ScopDetect: Bail out for non-simple memory accesses 2015-10-25 13:48:40 +00:00
non_affine_loop_condition.ll Introduce -polly-process-unprofitable 2015-10-06 16:10:29 +00:00
only-one-affine-loop.ll Weaken profitability constraints during ScopDetection 2016-05-10 14:42:30 +00:00
parametric-multiply-in-scev-2.ll Allow invariant loads in the SCoP description 2015-10-07 20:17:36 +00:00
parametric-multiply-in-scev.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
phi_with_multi_exiting_edges.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
profitability-large-basic-blocks.ll Add option to assume single-loop scops with sufficient compute are profitable 2015-12-21 21:00:43 +00:00
remove_all_children.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
report-scop-location.ll Update debug metadata after LLVM commits r266445+r266446 2016-04-15 20:51:27 +00:00
restrict-undef-size-scopdetect.ll Do not detect scops that are delinearized to arrays with "undef" size 2015-07-29 13:52:05 +00:00
run_time_alias_check.ll Remove -polly-code-generator=isl from many test cases 2015-11-21 23:05:48 +00:00
scev_remove_max.ll Fix of a comment. 2015-12-17 20:47:10 +00:00
sequential_loops.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
simple_loop.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
simple_loop_non_single_entry.ll Do not enforce lcssa 2015-11-21 17:00:02 +00:00
simple_loop_non_single_exit.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
simple_loop_non_single_exit_2.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
simple_loop_two_phi_nodes.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
simple_loop_with_param.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
simple_loop_with_param_2.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
simple_non_single_entry.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
skip_function_attribute.ll tests: Drop -polly-detect-unprofitable and -polly-no-early-exit 2015-10-06 15:36:44 +00:00
srem_with_parametric_divisor.ll Add support for srem instruction 2015-06-24 04:13:29 +00:00
switch-in-loop-patch.ll Do not allow switch statements in loop latches 2016-11-10 05:20:29 +00:00