diff options
| author | Jinsong Ji <jji@us.ibm.com> | 2020-01-03 20:56:06 +0000 |
|---|---|---|
| committer | Jinsong Ji <jji@us.ibm.com> | 2020-01-03 21:39:29 +0000 |
| commit | 1d7990228f0708bf48beef6a14d450c2e6d13557 (patch) | |
| tree | 10a5296a70dfa0d45f87101e49a21cb40ee76b6a /llvm/test/Transforms/LoopVectorize | |
| parent | 1dbc48645776ee86fed329c10e8fb00c0c79dee6 (diff) | |
| download | bcm5719-llvm-1d7990228f0708bf48beef6a14d450c2e6d13557.tar.gz bcm5719-llvm-1d7990228f0708bf48beef6a14d450c2e6d13557.zip | |
[PowerPC][LoopVectorize] Add tests for fp128 and fp16
Add two tests to reg-usage.ll
Diffstat (limited to 'llvm/test/Transforms/LoopVectorize')
| -rw-r--r-- | llvm/test/Transforms/LoopVectorize/PowerPC/reg-usage.ll | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/PowerPC/reg-usage.ll b/llvm/test/Transforms/LoopVectorize/PowerPC/reg-usage.ll index a08d111c4d4..5e0d0920a08 100644 --- a/llvm/test/Transforms/LoopVectorize/PowerPC/reg-usage.ll +++ b/llvm/test/Transforms/LoopVectorize/PowerPC/reg-usage.ll @@ -218,3 +218,61 @@ define void @double_(double* nocapture %A, i32 %n) nounwind uwtable ssp { ; <label>:26 ; preds = %2 ret void } + +define ppc_fp128 @fp128_(ppc_fp128* nocapture %n, ppc_fp128 %d) nounwind readonly { +;CHECK-LABEL: fp128_ +;CHECK: LV(REG): VF = 1 +;CHECK: LV(REG): Found max usage: 1 item +;CHECK: LV(REG): RegisterClass: PPC::GPRRC, 3 registers +entry: + br label %for.body + +for.body: ; preds = %for.body, %entry + %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ] + %x.05 = phi ppc_fp128 [ %d, %entry ], [ %sub, %for.body ] + %arrayidx = getelementptr inbounds ppc_fp128, ppc_fp128* %n, i32 %i.06 + %0 = load ppc_fp128, ppc_fp128* %arrayidx, align 8 + %sub = fsub ppc_fp128 %x.05, %0 + %inc = add nsw i32 %i.06, 1 + %exitcond = icmp eq i32 %inc, 2048 + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body + ret ppc_fp128 %sub +} + + +define void @fp16_(half* nocapture readonly %pIn, half* nocapture %pOut, i32 %numRows, i32 %numCols, i32 %scale.coerce) #0 { +;CHECK-LABEL: fp16_ +;CHECK: LV(REG): VF = 1 +;CHECK: LV(REG): Found max usage: 1 item +;CHECK: LV(REG): RegisterClass: PPC::GPRRC, 5 registers +entry: + %tmp.0.extract.trunc = trunc i32 %scale.coerce to i16 + %0 = bitcast i16 %tmp.0.extract.trunc to half + %mul = mul i32 %numCols, %numRows + %shr = lshr i32 %mul, 2 + %cmp26 = icmp eq i32 %shr, 0 + br i1 %cmp26, label %while.end, label %while.body + +while.body: ; preds = %entry, %while.body + %pIn.addr.029 = phi half* [ %add.ptr, %while.body ], [ %pIn, %entry ] + %pOut.addr.028 = phi half* [ %add.ptr7, %while.body ], [ %pOut, %entry ] + %blkCnt.027 = phi i32 [ %dec, %while.body ], [ %shr, %entry ] + %1 = load half, half* %pIn.addr.029, align 2 + %arrayidx2 = getelementptr inbounds half, half* %pIn.addr.029, i32 1 + %2 = load half, half* %arrayidx2, align 2 + %mul3 = fmul half %1, %0 + %mul4 = fmul half %2, %0 + store half %mul3, half* %pOut.addr.028, align 2 + %arrayidx6 = getelementptr inbounds half, half* %pOut.addr.028, i32 1 + store half %mul4, half* %arrayidx6, align 2 + %add.ptr = getelementptr inbounds half, half* %pIn.addr.029, i32 2 + %add.ptr7 = getelementptr inbounds half, half* %pOut.addr.028, i32 2 + %dec = add nsw i32 %blkCnt.027, -1 + %cmp = icmp eq i32 %dec, 0 + br i1 %cmp, label %while.end, label %while.body + +while.end: ; preds = %while.body, %entry + ret void +} |

