1 ; RUN: opt -gvn-hoist -S < %s | FileCheck %s
2 target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 ; Check that all "sub" expressions are hoisted.
10 define i64 @fun(i8* %out, i8* %end) {
11 %1 = icmp ult i8* %out, %end
12 br i1 %1, label %2, label %6
14 ; <label>:2 ; preds = %0
15 %3 = ptrtoint i8* %end to i64
16 %4 = ptrtoint i8* %out to i64
20 ; <label>:6 ; preds = %0
21 %7 = ptrtoint i8* %out to i64
22 %8 = ptrtoint i8* %end to i64
26 ; <label>:10 ; preds = %6, %2
27 %.in = phi i64 [ %5, %2 ], [ %9, %6 ]
28 %11 = add i64 %.in, 257