brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.3 KiB · 478c1be Raw
89 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -o -| FileCheck %s3 4target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"5target triple = "aarch64-unknown-linux-gnu"6 7; This test covers a case where an AArch64 DUP instruction is generated with an8; invalid encoding, resulting in a crash. We don't care about the specific output9; here, only that this case no longer causes said crash.10define dso_local i32 @dupext_crashtest(i32 %e) local_unnamed_addr {11; CHECK-LABEL: dupext_crashtest:12; CHECK:       // %bb.0: // %entry13; CHECK-NEXT:    dup v0.2s, w014; CHECK-NEXT:  .LBB0_1: // %vector.body15; CHECK-NEXT:    // =>This Inner Loop Header: Depth=116; CHECK-NEXT:    ldr d1, [x8]17; CHECK-NEXT:    smull v1.2d, v0.2s, v1.2s18; CHECK-NEXT:    xtn v1.2s, v1.2d19; CHECK-NEXT:    str d1, [x8]20; CHECK-NEXT:    b .LBB0_121entry:22  %conv314 = zext i32 %e to i6423  br label %vector.memcheck24 25vector.memcheck:                                  ; preds = %for.body.lr.ph26  br label %vector.ph27 28vector.ph:                                        ; preds = %vector.memcheck29  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %conv314, i32 030  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer31  br label %vector.body32 33vector.body:                                      ; preds = %vector.body, %vector.ph34  %wide.load = load <2 x i32>, ptr undef, align 435  %0 = zext <2 x i32> %wide.load to <2 x i64>36  %1 = mul nuw <2 x i64> %broadcast.splat, %037  %2 = trunc <2 x i64> %1 to <2 x i32>38  %3 = select <2 x i1> undef, <2 x i32> undef, <2 x i32> %239  %4 = bitcast ptr undef to ptr40  store <2 x i32> %3, ptr %4, align 441  br label %vector.body42}43 44; This test got stuck in a loop hoisting the and to the load, and sinking it back to the mull45define i32 @dup_and_load(ptr %p, i1 %c) {46; CHECK-LABEL: dup_and_load:47; CHECK:       // %bb.0: // %entry48; CHECK-NEXT:    mov x8, x049; CHECK-NEXT:    ldrb w0, [x0]50; CHECK-NEXT:    tbz w1, #0, .LBB1_351; CHECK-NEXT:  // %bb.1: // %ph52; CHECK-NEXT:    dup v0.8h, w053; CHECK-NEXT:    mov w9, wzr54; CHECK-NEXT:  .LBB1_2: // %vector.body55; CHECK-NEXT:    // =>This Inner Loop Header: Depth=156; CHECK-NEXT:    ldr d1, [x8]57; CHECK-NEXT:    add w9, w9, #158; CHECK-NEXT:    cmp w9, #10059; CHECK-NEXT:    ushll v1.8h, v1.8b, #060; CHECK-NEXT:    umull2 v2.4s, v0.8h, v1.8h61; CHECK-NEXT:    umull v1.4s, v0.4h, v1.4h62; CHECK-NEXT:    stp q1, q2, [x8]63; CHECK-NEXT:    b.lt .LBB1_264; CHECK-NEXT:  .LBB1_3: // %end65; CHECK-NEXT:    ret66entry:67  %l = load i32, ptr %p68  %and255 = and i32 %l, 25569  br i1 %c, label %ph, label %end70 71ph:72  %broadcast.splatinsert = insertelement <8 x i32> poison, i32 %and255, i32 073  %broadcast.splat = shufflevector <8 x i32> %broadcast.splatinsert, <8 x i32> poison, <8 x i32> zeroinitializer74  br label %vector.body75 76vector.body:                                      ; preds = %vector.body, %vector.ph77  %iv = phi i32 [ 0, %ph ], [ %iv.next, %vector.body ]78  %wide.load = load <8 x i8>, ptr %p, align 479  %0 = zext <8 x i8> %wide.load to <8 x i32>80  %1 = mul <8 x i32> %broadcast.splat, %081  store <8 x i32> %1, ptr %p, align 482  %iv.next = add i32 %iv, 183  %e = icmp slt i32 %iv.next, 10084  br i1 %e, label %vector.body, label %end85 86end:87  ret i32 %and25588}89