[SimplifyCFG] Swap to using TargetTransformInfo for cost
[oota-llvm.git] / test / Transforms / SimplifyCFG / select-gep.ll
1 ; RUN: opt -S -simplifycfg < %s | FileCheck %s
2
3 %ST = type { i8, i8 }
4
5 define i8* @test1(%ST* %x, i8* %y) nounwind {
6 entry:
7   %cmp = icmp eq %ST* %x, null
8   br i1 %cmp, label %if.then, label %if.end
9
10 if.then:
11   %incdec.ptr = getelementptr %ST* %x, i32 0, i32 1
12   br label %if.end
13
14 if.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 }