1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/Transforms/LoopStrengthReduce
Roman Lebedev a142d0e600 SCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction
Summary:
An alternative to D48597.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=37936 | PR37936 ]].

The problem is as follows:
1. `indvars` marks `%dec` as `NUW`.
2. `loop-instsimplify` runs `instsimplify`, which constant-folds `%dec` to -1 (D47908)
3. `loop-reduce` tries to do some further modification, but crashes
    with an type assertion in cast, because `%dec` is no longer an `Instruction`,

If the runline is split into two, i.e. you first run `-indvars -loop-instsimplify`,
store that into a file, and then run `-loop-reduce`, there is no crash.

So it looks like the problem is due to `-loop-instsimplify` not discarding SCEV.
But in this case we can just not crash if it's not an `Instruction`.
This is just a local fix, unlike D48597, so there may very well be other problems.

Reviewers: mkazantsev, uabelho, sanjoy, silviu.baranga, wmi

Reviewed By: mkazantsev

Subscribers: evstupac, javed.absar, spatel, llvm-commits

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

llvm-svn: 335950
2018-06-29 07:44:20 +00:00
..
AArch64
AMDGPU reapply r334209 with fixes for harfbuzz in Chromium 2018-06-08 16:22:52 +00:00
ARM Generalize MergeBlockIntoPredecessor. Replace uses of MergeBasicBlockIntoOnlyPred. 2018-06-20 22:01:04 +00:00
NVPTX
X86 Generalize MergeBlockIntoPredecessor. Replace uses of MergeBasicBlockIntoOnlyPred. 2018-06-20 22:01:04 +00:00
2005-08-15-AddRecIV.ll
2005-08-17-OutOfLoopVariant.ll
2005-09-12-UsesOutOutsideOfLoop.ll
2007-04-23-UseIterator.ll
2008-08-13-CmpStride.ll
2008-09-09-Overflow.ll
2009-01-13-nonconstant-stride-outside-loop.ll
2009-04-28-no-reduce-mul.ll
2011-07-19-CritEdgeBreakCrash.ll
2011-10-03-CritEdgeMerge.ll
2011-10-06-ReusePhi.ll
2011-10-13-SCEVChain.ll
2011-10-14-IntPtr.ll
2011-12-19-PostincQuadratic.ll
2012-01-02-nopreheader.ll
2012-01-16-nopreheader.ll
2012-03-15-nopreheader.ll
2012-03-26-constexpr.ll
2012-07-13-ExpandUDiv.ll
2012-07-18-LimitReassociate.ll
2013-01-05-IndBr.ll
2013-01-14-ReuseCast.ll
addrec-gep-address-space.ll
addrec-gep.ll
address-space-loop.ll
count-to-zero.ll
dead-phi.ll
different-type-ivs.ll
dominate-assert.ll
dont_insert_redundant_ops.ll
dont_reduce_bytes.ll
dont_reverse.ll
dont-hoist-simple-loop-constants.ll
ephemeral.ll
exit_compare_live_range.ll
funclet.ll
hoist-parent-preheader.ll
illegal-addr-modes.ll
invariant_value_first_arg.ll
invariant_value_first.ll
ivchain.ll
lsr-comp-time.ll Fix LSR compile time hang. 2018-05-16 02:48:50 +00:00
negative-scale.ll
nested-reduce.ll
nonintegral.ll
nonlinear-postinc.ll
ops_after_indvar.ll
phi_node_update_multiple_preds.ll
post-inc-icmpzero.ll
post-inc-optsize.ll
pr2537.ll
pr2570.ll
pr3086.ll
pr3399.ll
pr3571.ll
pr12018.ll
pr12048.ll
pr12691.ll
pr18165.ll
pr25541.ll
pr27056.ll
pr31627.ll
preserve-gep-loop-variant.ll
related_indvars.ll
remove_indvar.ll
scaling_factor_cost_crash.ll
scev-after-loopinstsimplify.ll SCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction 2018-06-29 07:44:20 +00:00
scev-insertpt-bug.ll
sext-ind-var.ll
share_code_in_preheader.ll
share_ivs.ll
shl.ll
uglygep-address-space.ll
uglygep.ll
use_postinc_value_outside_loop.ll
var_stride_used_by_compare.ll
variable_stride.ll