1; RUN: opt %loadPolly -polly-codegen -polly-invariant-load-hoisting=true -S < %s | FileCheck %s
2
3; CHECK: polly.start
4
5;    void f(int *A) {
6;      if (*A > 42)
7;        *A = *A + 1;
8;      else
9;        *A = *A - 1;
10;    }
11;
12target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13
14define void @f(i32* %A) {
15entry:
16  br label %entry.split
17
18entry.split:
19  %tmp = load i32, i32* %A, align 4
20  %cmp = icmp sgt i32 %tmp, 42
21  br i1 %cmp, label %if.then, label %if.else
22
23if.then:                                          ; preds = %entry
24  %tmp1 = load i32, i32* %A, align 4
25  %add = add nsw i32 %tmp1, 1
26  br label %if.end
27
28if.else:                                          ; preds = %entry
29  %tmp2 = load i32, i32* %A, align 4
30  %sub = add nsw i32 %tmp2, -1
31  br label %if.end
32
33if.end:                                           ; preds = %if.else, %if.then
34  %storemerge = phi i32 [ %sub, %if.else ], [ %add, %if.then ]
35  store i32 %storemerge, i32* %A, align 4
36  ret void
37}
38