reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
; RUN: opt -indvars -S %s | FileCheck %s
;
; PR18384: ValueHandleBase::ValueIsDeleted.
;
; Ensure that LoopSimplify calls ScalarEvolution::forgetLoop before
; deleting a block, regardless of whether any values were hoisted out
; of the block.

target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"

%struct.Params = type { [2 x [4 x [16 x i16]]] }

; Verify that the loop tail is deleted, and we don't crash!
;
; CHECK-LABEL: @t
; CHECK-LABEL: for.cond127.preheader:
; CHECK-NOT: for.cond127:
; CHECK-LABEL: for.body129:
define void @t() {
entry:
  br label %for.body102

for.body102:
  br i1 undef, label %for.cond127.preheader, label %for.inc203

for.cond127.preheader:
  br label %for.body129

for.cond127:
  %cmp128 = icmp slt i32 %inc191, 2
  br i1 %cmp128, label %for.body129, label %for.end192

for.body129:
  %uv.013 = phi i32 [ 0, %for.cond127.preheader ], [ %inc191, %for.cond127 ]
  %idxprom130 = sext i32 %uv.013 to i64
  br i1 undef, label %for.cond135.preheader.lr.ph, label %for.end185

for.cond135.preheader.lr.ph:
  br i1 undef, label %for.cond135.preheader.lr.ph.split.us, label %for.cond135.preheader.lr.ph.split_crit_edge

for.cond135.preheader.lr.ph.split_crit_edge:
  br label %for.cond135.preheader.lr.ph.split

for.cond135.preheader.lr.ph.split.us:
  br label %for.cond135.preheader.us

for.cond135.preheader.us:
  %block_y.09.us = phi i32 [ 0, %for.cond135.preheader.lr.ph.split.us ], [ %add184.us, %for.cond132.us ]
  br i1 true, label %for.cond138.preheader.lr.ph.us, label %for.end178.us

for.end178.us:
  %add184.us = add nsw i32 %block_y.09.us, 4
  br i1 undef, label %for.end185split.us-lcssa.us, label %for.cond132.us

for.end174.us:
  br i1 undef, label %for.cond138.preheader.us, label %for.cond135.for.end178_crit_edge.us

for.inc172.us:
  br i1 undef, label %for.cond142.preheader.us, label %for.end174.us

for.body145.us:
  %arrayidx163.us = getelementptr inbounds %struct.Params, %struct.Params* undef, i64 0, i32 0, i64 %idxprom130, i64 %idxprom146.us
  br i1 undef, label %for.body145.us, label %for.inc172.us

for.cond142.preheader.us:
  %j.04.us = phi i32 [ %block_y.09.us, %for.cond138.preheader.us ], [ undef, %for.inc172.us ]
  %idxprom146.us = sext i32 %j.04.us to i64
  br label %for.body145.us

for.cond138.preheader.us:
  br label %for.cond142.preheader.us

for.cond132.us:
  br i1 undef, label %for.cond135.preheader.us, label %for.cond132.for.end185_crit_edge.us-lcssa.us

for.cond138.preheader.lr.ph.us:
  br label %for.cond138.preheader.us

for.cond135.for.end178_crit_edge.us:
  br label %for.end178.us

for.end185split.us-lcssa.us:
  br label %for.end185split

for.cond132.for.end185_crit_edge.us-lcssa.us:
  br label %for.cond132.for.end185_crit_edge

for.cond135.preheader.lr.ph.split:
  br label %for.end185split

for.end185split:
  br label %for.end185

for.cond132.for.end185_crit_edge:
  br label %for.end185

for.end185:
  %inc191 = add nsw i32 %uv.013, 1
  br i1 false, label %for.end192, label %for.cond127

for.end192:
  br label %for.inc203

for.inc203:
  br label %for.end205

for.end205:
  ret void
}