reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
; RUN: llc -march=hexagon -enable-pipeliner -fp-contract=fast < %s
; REQUIRES: asserts

; Test that the code which reuses existing Phis works when the Phis are used
; in multiple stages. In this case, one can be reused, but the other must be
; generated.

; Function Attrs: nounwind
define void @f0(i32 %a0) #0 {
b0:
  %v0 = icmp sgt i32 %a0, 0
  br i1 %v0, label %b1, label %b2

b1:                                               ; preds = %b1, %b0
  %v1 = phi i32 [ %v11, %b1 ], [ 0, %b0 ]
  %v2 = phi float [ %v4, %b1 ], [ undef, %b0 ]
  %v3 = phi float [ %v2, %b1 ], [ undef, %b0 ]
  %v4 = load float, float* undef, align 4
  %v5 = fmul float %v4, 0x3FEFAA0000000000
  %v6 = fadd float undef, %v5
  %v7 = fmul float %v2, 0xBFFFAA0000000000
  %v8 = fadd float %v7, %v6
  %v9 = fmul float %v3, 0x3FEFAA0000000000
  %v10 = fadd float %v9, %v8
  store float %v10, float* undef, align 4
  %v11 = add nsw i32 %v1, 1
  %v12 = icmp eq i32 %v11, %a0
  br i1 %v12, label %b2, label %b1

b2:                                               ; preds = %b1, %b0
  ret void
}

attributes #0 = { nounwind "target-cpu"="hexagonv55" }