diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-03-12 14:01:28 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-03-12 14:01:28 +0000 |
commit | 046090db5330dd87e54a7b46ec34384dd3b43c31 (patch) | |
tree | 502084412f49f650e9c86e075a1e14f3ad4711be /llvm/test/CodeGen/Hexagon/swp-reuse-phi.ll | |
parent | 947e0acb6fa0fedac05530df98f589e928456278 (diff) | |
download | bcm5719-llvm-046090db5330dd87e54a7b46ec34384dd3b43c31.tar.gz bcm5719-llvm-046090db5330dd87e54a7b46ec34384dd3b43c31.zip |
[Hexagon] Add more lit tests
llvm-svn: 327271
Diffstat (limited to 'llvm/test/CodeGen/Hexagon/swp-reuse-phi.ll')
-rw-r--r-- | llvm/test/CodeGen/Hexagon/swp-reuse-phi.ll | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Hexagon/swp-reuse-phi.ll b/llvm/test/CodeGen/Hexagon/swp-reuse-phi.ll new file mode 100644 index 00000000000..a3221e56b34 --- /dev/null +++ b/llvm/test/CodeGen/Hexagon/swp-reuse-phi.ll @@ -0,0 +1,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" } |