• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;RUN: opt -verify-dom-info -loop-simplify -postdomtree -licm -adce -verify-loop-info -S -o - %s | FileCheck %s
2;RUN: opt -verify-dom-info -passes='loop-simplify,require<postdomtree>,require<opt-remark-emit>,loop(licm),function(adce)' -S -o - %s | FileCheck %s
3
4target triple = "x86_64-unknown-linux-gnu"
5
6@c = external global i16, align 1
7
8;Make sure this test do not crash while accessing PostDomTree which is not
9;preserved in LICM.
10;
11;CHECK-LABEL: fn1()
12;CHECK-LABEL: for.cond.loopexit.split.loop.exit
13;CHECK-LABEL: for.cond.loopexit.split.loop.exit1
14define void @fn1() {
15entry:
16  br label %for.cond
17
18for.cond:                                         ; preds = %if.end, %for.cond1, %entry
19  %0 = phi i16 [ undef, %entry ], [ ptrtoint (i16* @c to i16), %if.end ], [ %.mux, %for.cond1 ]
20  br i1 undef, label %for.cond1, label %for.end8
21
22for.cond1:                                        ; preds = %if.end, %for.cond
23  %.mux = select i1 undef, i16 undef, i16 ptrtoint (i16* @c to i16)
24  br i1 undef, label %for.cond, label %if.end
25
26if.end:                                           ; preds = %for.cond1
27  br i1 undef, label %for.cond, label %for.cond1
28
29for.end8:                                         ; preds = %for.cond
30  ret void
31}
32