1 ; RUN: opt -S < %s -gvn-hoist | FileCheck %s
3 declare void @llvm.sideeffect()
5 ; GVN hoisting across a @llvm.sideeffect.
7 ; CHECK-LABEL: scalarsHoisting
11 define float @scalarsHoisting(float %d, float %m, float %a, i1 %cmp) {
13 br i1 %cmp, label %if.then, label %if.else
16 call void @llvm.sideeffect()
17 %sub0 = fsub float %m, %a
18 %mul = fmul float %sub0, %d
22 %sub1 = fsub float %m, %a
23 %div = fdiv float %sub1, %d
27 %phi = phi float [ %mul, %if.then ], [ %div, %if.else ]