brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · b818442 Raw
39 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=licm < %s | FileCheck %s3 4define i16 @test(ptr %in) {5; CHECK-LABEL: @test(6; CHECK-NEXT:  entry:7; CHECK-NEXT:    br label [[LOOP:%.*]]8; CHECK:       loop:9; CHECK-NEXT:    [[I:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[I_NEXT:%.*]], [[LOOP]] ]10; CHECK-NEXT:    [[I_NEXT]] = add i32 [[I]], 111; CHECK-NEXT:    [[CMP:%.*]] = icmp ult i32 [[I_NEXT]], 1012; CHECK-NEXT:    br i1 [[CMP]], label [[LOOP]], label [[EXIT:%.*]]13; CHECK:       exit:14; CHECK-NEXT:    [[I_LCSSA:%.*]] = phi i32 [ [[I]], [[LOOP]] ]15; CHECK-NEXT:    [[GEP_LE:%.*]] = getelementptr <4 x i16>, ptr [[IN:%.*]], i32 [[I_LCSSA]]16; CHECK-NEXT:    [[LOAD_LE:%.*]] = call <4 x i16> @llvm.masked.load.v4i16.p0(ptr align 2 [[GEP_LE]], <4 x i1> <i1 true, i1 false, i1 true, i1 false>, <4 x i16> <i16 0, i16 poison, i16 0, i16 poison>), !alias.scope [[META0:![0-9]+]], !noalias [[META0]]17; CHECK-NEXT:    [[REDUCE_LE:%.*]] = call i16 @llvm.vector.reduce.add.v4i16(<4 x i16> [[LOAD_LE]])18; CHECK-NEXT:    ret i16 [[REDUCE_LE]]19;20entry:21  br label %loop22 23loop:                              ; preds = %loop, %entry24  %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]25  %gep = getelementptr <4 x i16>, ptr %in, i32 %i26  %load = call <4 x i16> @llvm.masked.load.v4i16.p0(ptr %gep, i32 2, <4 x i1> <i1 true, i1 false, i1 true, i1 false>, <4 x i16> <i16 0, i16 poison, i16 0, i16 poison>), !alias.scope !2, !noalias !227  %reduce = call i16 @llvm.vector.reduce.add.v4i16(<4 x i16> %load)28  %i.next = add i32 %i, 129  %cmp = icmp ult i32 %i.next, 1030  br i1 %cmp, label %loop, label %exit31 32exit:                               ; preds = %loop33  ret i16 %reduce34}35 36!0 = !{!0}37!1 = !{!1, !0}38!2 = !{!1}39