brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 5b2aeb0 Raw
70 lines · plain
1; RUN: llc < %s | FileCheck %s2 3target triple = "aarch64"4 5 6define void @dont_rematerialize_cntd(i32 %N) #0 {7; CHECK-LABEL: dont_rematerialize_cntd:8; CHECK:        cntd9; CHECK:        smstop sm10; CHECK-NOT:    cntd11; CHECK:        bl      foo12; CHECK:        smstart  sm13entry:14  %cmp2 = icmp sgt i32 %N, 015  br i1 %cmp2, label %for.body, label %for.cond.cleanup16 17for.body:                                         ; preds = %entry, %for.body18  %index.03 = phi i32 [ %inc, %for.body ], [ 0, %entry ]19  call void asm sideeffect "", "~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27}"() nounwind20  %.tr = call i32 @llvm.vscale.i32()21  %conv = shl nuw nsw i32 %.tr, 422  call void @foo(i32 %conv)23  %inc = add nuw nsw i32 %index.03, 124  %exitcond.not = icmp eq i32 %inc, %N25  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body26 27for.cond.cleanup:                                 ; preds = %for.body, %entry28  ret void29}30 31; This test doesn't strictly make sense, because it passes a scalable predicate32; to a function, which makes little sense if the VL is not the same in/out of33; streaming-SVE mode. If the VL is known to be the same, then we could just as34; well rematerialize the `ptrue` inside the call sequence. However, the purpose35; of this test is more to ensure that the logic works, which may also trigger36; when the value is not being passed as argument (e.g. when it is hoisted from37; a loop and placed inside the call sequence).38;39; FIXME: This test also exposes another bug, where the 'mul vl' addressing mode40; is used before/after the smstop. This will be fixed in a future patch.41define void @dont_rematerialize_ptrue(i32 %N) #0 {42; CHECK-LABEL: dont_rematerialize_ptrue:43; CHECK:        ptrue [[PTRUE:p[0-9]+]].b44; CHECK:        str [[PTRUE]], [[[SPILL_ADDR:.*]]]45; CHECK:        smstop sm46; CHECK:        ldr p0, [[[SPILL_ADDR]]]47; CHECK-NOT:    ptrue48; CHECK:        bl      bar49; CHECK:        smstart  sm50entry:51  %cmp2 = icmp sgt i32 %N, 052  br i1 %cmp2, label %for.body, label %for.cond.cleanup53 54for.body:                                         ; preds = %entry, %for.body55  %index.03 = phi i32 [ %inc, %for.body ], [ 0, %entry ]56  call void asm sideeffect "", "~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27}"() nounwind57  call void @bar(<vscale x 16 x i1> splat(i1 true))58  %inc = add nuw nsw i32 %index.03, 159  %exitcond.not = icmp eq i32 %inc, %N60  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body61 62for.cond.cleanup:                                 ; preds = %for.body, %entry63  ret void64}65declare void @foo(i32)66declare void @bar(<vscale x 16 x i1>)67declare i32 @llvm.vscale.i32()68 69attributes #0 = { "aarch64_pstate_sm_enabled" "frame-pointer"="non-leaf" "target-features"="+sme,+sve" }70