• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -simplifycfg < %s | FileCheck %s
2
3%ST = type { i8, i8 }
4
5define i8* @test1(%ST* %x, i8* %y) nounwind {
6entry:
7  %cmp = icmp eq %ST* %x, null
8  br i1 %cmp, label %if.then, label %if.end
9
10if.then:
11  %incdec.ptr = getelementptr %ST, %ST* %x, i32 0, i32 1
12  br label %if.end
13
14if.end:
15  %x.addr = phi i8* [ %incdec.ptr, %if.then ], [ %y, %entry ]
16  ret i8* %x.addr
17
18; CHECK-LABEL: @test1(
19; CHECK: %incdec.ptr.y = select i1 %cmp, i8* %incdec.ptr, i8* %y
20; CHECK: ret i8* %incdec.ptr.y
21}
22