brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · a85ddeb Raw
45 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt %s -S -mtriple=riscv64 -passes=loop-unroll | FileCheck %s3 4; Demonstrate handling of invalid costs in LoopUnroll.  This test uses5; scalable vectors on RISCV w/o +V to create a situation where a construct6; can not be lowered, and is thus invalid regardless of what the target7; does or does not implement in terms of a cost model.8 9target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"10target triple = "riscv64-unknown-unknown"11 12define void @invalid(ptr %p) nounwind ssp {13; CHECK-LABEL: @invalid(14; CHECK-NEXT:  entry:15; CHECK-NEXT:    br label [[FOR_BODY:%.*]]16; CHECK:       for.body:17; CHECK-NEXT:    [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY]] ]18; CHECK-NEXT:    [[A:%.*]] = load <vscale x 1 x i8>, ptr [[P:%.*]], align 119; CHECK-NEXT:    [[B:%.*]] = add <vscale x 1 x i8> [[A]], [[A]]20; CHECK-NEXT:    store <vscale x 1 x i8> [[B]], ptr [[P]], align 121; CHECK-NEXT:    [[INC]] = add nsw i32 [[I_0]], 122; CHECK-NEXT:    [[CMP:%.*]] = icmp slt i32 [[I_0]], 1023; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]24; CHECK:       for.end:25; CHECK-NEXT:    ret void26;27entry:28  br label %for.body29 30for.body:                                         ; preds = %for.body, %entry31  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]32  %a = load <vscale x 1 x i8>, ptr %p33  %b = add <vscale x 1 x i8> %a, %a34  store <vscale x 1 x i8> %b, ptr %p35  %inc = add nsw i32 %i.0, 136  %cmp = icmp slt i32 %i.0, 1037  br i1 %cmp, label %for.body, label %for.end38 39for.end:                                          ; preds = %for.body40  ret void41}42 43 44declare void @f()45