88 lines · plain
1; RUN: opt -passes=loop-vectorize < %s -S -o - | FileCheck %s --check-prefix=CHECK2; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize -disable-output < %s 2>&1 | FileCheck %s --check-prefix=CHECK-COST3; REQUIRES: asserts4 5target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"6target triple = "thumbv8.1m.main-none-none-eabi"7 8; CHECK-LABEL: test9; CHECK-COST: LV: Found an estimated cost of 0 for VF 1 For instruction: %and515 = shl i32 %l41, 310; CHECK-COST: LV: Found an estimated cost of 1 for VF 1 For instruction: %l45 = and i32 %and515, 13107211; CHECK-COST: Cost of 2 for VF 4: WIDEN ir<%and515> = shl ir<%l41>, ir<3>12; CHECK-COST: Cost of 2 for VF 4: WIDEN ir<%l45> = and ir<%and515>, ir<131072>13; CHECK-NOT: vector.body14 15define void @test(ptr %src, i32 %N) #0 {16entry:17 br label %for.body38618 19for.body386: ; preds = %entry, %l7720 %add387 = phi i32 [ %inc532, %l77 ], [ 0, %entry ]21 %arrayidx388 = getelementptr inbounds [101 x i32], ptr %src, i32 0, i32 %add38722 %l41 = load i32, ptr %arrayidx388, align 423 %l42 = and i32 %l41, 6553524 %l43 = icmp eq i32 %l42, 025 br i1 %l43, label %l77, label %l4426 27l44: ; preds = %for.body38628 %and515 = shl i32 %l41, 329 %l45 = and i32 %and515, 13107230 %and506 = shl i32 %l41, 531 %l46 = and i32 %and506, 26214432 %and497 = shl i32 %l41, 733 %l47 = and i32 %and497, 52428834 %and488 = shl i32 %l41, 935 %l48 = and i32 %and488, 104857636 %and479 = shl i32 %l41, 1137 %l49 = and i32 %and479, 209715238 %and470 = shl i32 %l41, 1339 %l50 = and i32 %and470, 419430440 %and461 = shl i32 %l41, 1541 %l51 = and i32 %and461, 838860842 %and452 = shl i32 %l41, 1743 %l52 = and i32 %and452, 1677721644 %and443 = shl i32 %l41, 1945 %l53 = and i32 %and443, 3355443246 %and434 = shl i32 %l41, 2147 %l54 = and i32 %and434, 6710886448 %and425 = shl i32 %l41, 2349 %l55 = and i32 %and425, 13421772850 %and416 = shl i32 %l41, 2551 %l56 = and i32 %and416, 26843545652 %and407 = shl i32 %l41, 2753 %l57 = and i32 %and407, 53687091254 %and398 = shl i32 %l41, 2955 %l58 = and i32 %and398, 107374182456 %l59 = shl i32 %l41, 3157 %l60 = or i32 %l59, %l4158 %l61 = or i32 %l58, %l6059 %l62 = or i32 %l57, %l6160 %l63 = or i32 %l56, %l6261 %l64 = or i32 %l55, %l6362 %l65 = or i32 %l54, %l6463 %l66 = or i32 %l53, %l6564 %l67 = or i32 %l52, %l6665 %l68 = or i32 %l51, %l6766 %l69 = or i32 %l50, %l6867 %l70 = or i32 %l49, %l6968 %l71 = or i32 %l48, %l7069 %l72 = or i32 %l47, %l7170 %l73 = or i32 %l46, %l7271 %l74 = or i32 %l45, %l7372 %and524 = shl i32 %l41, 173 %l75 = and i32 %and524, 6553674 %l76 = or i32 %l75, %l7475 store i32 %l76, ptr %arrayidx388, align 476 br label %l7777 78l77: ; preds = %for.body386, %l4479 %inc532 = add nuw nsw i32 %add387, 180 %exitcond649 = icmp eq i32 %inc532, %N81 br i1 %exitcond649, label %exit, label %for.body38682 83exit:84 ret void85}86 87attributes #0 = { nounwind "min-legal-vector-width"="0" "target-cpu"="generic" "target-features"="+armv8.1-m.main,+fp-armv8d16sp,+fp16,+fullfp16,+hwdiv,+lob,+mve.fp,+ras,+strict-align,+thumb-mode,+vfp2sp,+vfp3d16sp,+vfp4d16sp" "use-soft-float"="false" }88