2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-- -mcpu=core-avx2 < %s | FileCheck %s
|
2014-04-03 06:59:58 +08:00
|
|
|
;
|
|
|
|
; Test multiple peephole-time folds in a single basic block.
|
|
|
|
; <rdar://problem/16478629>
|
|
|
|
|
|
|
|
define <8 x float> @test_peephole_multi_fold(<8 x float>* %p1, <8 x float>* %p2) {
|
|
|
|
entry:
|
|
|
|
br label %loopbody
|
|
|
|
|
|
|
|
loopbody:
|
2014-04-03 08:14:18 +08:00
|
|
|
; CHECK: test_peephole_multi_fold:
|
2014-04-04 04:07:51 +08:00
|
|
|
; CHECK: vfmadd231ps ({{%rdi|%rcx}}),
|
|
|
|
; CHECK: vfmadd231ps ({{%rsi|%rdx}}),
|
2014-04-03 06:59:58 +08:00
|
|
|
%vsum1 = phi <8 x float> [ %vsum1.next, %loopbody ], [ zeroinitializer, %entry ]
|
|
|
|
%vsum2 = phi <8 x float> [ %vsum2.next, %loopbody ], [ zeroinitializer, %entry ]
|
2015-02-28 05:17:42 +08:00
|
|
|
%m1 = load <8 x float>, <8 x float>* %p1, align 1
|
|
|
|
%m2 = load <8 x float>, <8 x float>* %p2, align 1
|
2014-04-03 06:59:58 +08:00
|
|
|
%vsum1.next = tail call <8 x float> @llvm.x86.fma.vfmadd.ps.256(<8 x float> %m1, <8 x float> zeroinitializer, <8 x float> %vsum1)
|
|
|
|
%vsum2.next = tail call <8 x float> @llvm.x86.fma.vfmadd.ps.256(<8 x float> %m2, <8 x float> zeroinitializer, <8 x float> %vsum2)
|
|
|
|
%vsum1.next.1 = extractelement <8 x float> %vsum1.next, i32 0
|
|
|
|
%c = fcmp oeq float %vsum1.next.1, 0.0
|
|
|
|
br i1 %c, label %loopbody, label %loopexit
|
|
|
|
|
|
|
|
loopexit:
|
|
|
|
%r = fadd <8 x float> %vsum1.next, %vsum2.next
|
|
|
|
ret <8 x float> %r
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <8 x float> @llvm.x86.fma.vfmadd.ps.256(<8 x float>, <8 x float>, <8 x float>)
|