• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -licm -S | FileCheck %s
2; Promote value if at least one use is safe
3
4
5define i32 @f2(i32* %p, i8* %q) {
6entry:
7        br label %loop.head
8
9loop.head:              ; preds = %cond.true, %entry
10        store i32 20, i32* %p
11        %tmp3.i = icmp eq i8* null, %q            ; <i1> [#uses=1]
12        br i1 %tmp3.i, label %exit, label %cond.true
13
14cond.true:              ; preds = %loop.head
15        store i32 40, i32* %p
16        br label %loop.head
17
18; CHECK: exit:
19; CHECK: store i32 20, i32* %p
20exit:           ; preds = %loop.head
21        ret i32 0
22}
23
24