1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/Transforms/IndVarSimplify/pr24804.ll
Sanjoy Das ec1f59a19a [SCEVExpander] Have hoistIVInc preserve LCSSA
Summary:
(Note: the problematic invocation of hoistIVInc that caused PR24804 came
from IndVarSimplify, not from SCEVExpander itself)

Fixes PR24804.  Test case by David Majnemer.

Reviewers: hfinkel, majnemer, atrick, mzolotukhin

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15058

llvm-svn: 254976
2015-12-08 00:13:17 +00:00

26 lines
805 B
LLVM

; RUN: opt -indvars -loop-idiom -loop-deletion -S < %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Checking for a crash
define void @f(i32* %a) {
; CHECK-LABEL: @f(
entry:
br label %for.cond
for.cond: ; preds = %for.inc, %for.cond, %entry
%iv = phi i32 [ 0, %entry ], [ %add, %for.inc ], [ %iv, %for.cond ]
%add = add nsw i32 %iv, 1
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom
br i1 undef, label %for.cond, label %for.inc
for.inc: ; preds = %for.cond
br i1 undef, label %for.cond, label %for.end
for.end: ; preds = %for.inc
ret void
}