brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 39fe92a Raw
46 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=aarch64 -mattr=+sve < %s | FileCheck %s3 4;5; Ensure that the %ptrue from the preheader is sunk into the loop such that the ptest is removed.6;7 8define void @test_sink_ptrue_into_ptest(i32 %n) {9; CHECK-LABEL: test_sink_ptrue_into_ptest:10; CHECK:       // %bb.0: // %entry11; CHECK-NEXT:    whilelt p0.s, wzr, w012; CHECK-NEXT:    b.pl .LBB0_313; CHECK-NEXT:  // %bb.1: // %for.body.preheader14; CHECK-NEXT:    mov w9, wzr15; CHECK-NEXT:    cntw x816; CHECK-NEXT:  .LBB0_2: // %for.body17; CHECK-NEXT:    // =>This Inner Loop Header: Depth=118; CHECK-NEXT:    whilelt p0.s, w9, w019; CHECK-NEXT:    add w9, w9, w820; CHECK-NEXT:    b.mi .LBB0_221; CHECK-NEXT:  .LBB0_3: // %exit22; CHECK-NEXT:    ret23entry:24  %vscale = tail call i32 @llvm.vscale.i32()25  %step = shl nuw nsw i32 %vscale, 226  %ptrue.ph = tail call <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 31)27  %while.ph = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilelt.nxv4i1.i32(i32 0, i32 %n)28  %ptest.ph = tail call i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1> %ptrue.ph, <vscale x 4 x i1> %while.ph)29  br i1 %ptest.ph, label %for.body, label %exit30 31for.body:32  %i = phi i32 [ 0, %entry ], [ %i.next, %for.body ]33  %i.next = add i32 %i, %step34  %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilelt.nxv4i1.i32(i32 %i, i32 %n)35  %ptest = call i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1> %ptrue.ph, <vscale x 4 x i1> %while)36  br i1 %ptest, label %for.body, label %exit37 38exit:39  ret void40}41 42declare i32 @llvm.vscale.i32()43declare <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 immarg)44declare <vscale x 4 x i1> @llvm.aarch64.sve.whilelt.nxv4i1.i32(i32, i32)45declare i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)46