brintos

brintos / llvm-project-archived public Read only

0
0
Text · 571 B · f191fbf Raw
24 lines · plain
1; RUN: opt < %s -passes=licm -S | FileCheck %s2; Promote value if at least one use is safe3 4 5define i32 @f2(ptr %p, ptr %q) {6entry:7        br label %loop.head8 9loop.head:              ; preds = %cond.true, %entry10        store i32 20, ptr %p11        %tmp3.i = icmp eq ptr null, %q            ; <i1> [#uses=1]12        br i1 %tmp3.i, label %exit, label %cond.true13 14cond.true:              ; preds = %loop.head15        store i32 40, ptr %p16        br label %loop.head17 18; CHECK: exit:19; CHECK: store i32 20, ptr %p20exit:           ; preds = %loop.head21        ret i32 022}23 24