llvm.org GIT mirror llvm / bbc7752
[LoopVectorize] Pass unfiltered list of arguments to getIntrinsicInstCost. We do not compute the scalarization overhead in getVectorIntrinsicCost and TTI::getIntrinsicInstrCost requires the full arguments list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366049 91177308-0d34-0410-b5e6-96231b3b80d8 Florian Hahn a month ago
2 changed file(s) with 32 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
31483148 if (auto *FPMO = dyn_cast(CI))
31493149 FMF = FPMO->getFastMathFlags();
31503150
3151 // Skip operands that do not require extraction/scalarization and do not incur
3152 // any overhead.
3153 return TTI.getIntrinsicInstrCost(
3154 ID, CI->getType(), filterExtractingOperands(CI->arg_operands(), VF), FMF,
3155 VF);
3151 SmallVector Operands(CI->arg_operands());
3152 return TTI.getIntrinsicInstrCost(ID, CI->getType(), Operands, FMF, VF);
31563153 }
31573154
31583155 static Type *smallestIntegerVectorType(Type *T1, Type *T2) {
0 ; RUN: opt -S -loop-vectorize -force-vector-width=4 %s | FileCheck %s
1
2 ; CHECK-LABEL: @test_fshl
3 ; CHECK-LABEL: vector.body:
4 ; CHECK-NEXT: %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
5 ; CHECK-NEXT: %broadcast.splatinsert = insertelement <4 x i32> undef, i32 %index, i32 0
6 ; CHECK-NEXT: %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> undef, <4 x i32> zeroinitializer
7 ; CHECK-NEXT: %induction = add <4 x i32> %broadcast.splat,
8 ; CHECK-NEXT: %0 = add i32 %index, 0
9 ; CHECK-NEXT: %1 = call <4 x i16> @llvm.fshl.v4i16(<4 x i16> undef, <4 x i16> undef, <4 x i16> )
10 ; CHECK-NEXT: %index.next = add i32 %index, 4
11 ; CHECK-NEXT: %2 = icmp eq i32 %index.next, %n.vec
12 ; CHECK-NEXT: br i1 %2, label %middle.block, label %vector.body, !llvm.loop !0
13 ;
14 define void @test_fshl(i32 %width) {
15 entry:
16 br label %for.body9.us.us
17
18 for.cond6.for.cond.cleanup8_crit_edge.us.us: ; preds = %for.body9.us.us
19 ret void
20
21 for.body9.us.us: ; preds = %for.body9.us.us, %entry
22 %x.020.us.us = phi i32 [ 0, %entry ], [ %inc.us.us, %for.body9.us.us ]
23 %conv4.i.us.us = tail call i16 @llvm.fshl.i16(i16 undef, i16 undef, i16 15)
24 %inc.us.us = add nuw i32 %x.020.us.us, 1
25 %exitcond50 = icmp eq i32 %inc.us.us, %width
26 br i1 %exitcond50, label %for.cond6.for.cond.cleanup8_crit_edge.us.us, label %for.body9.us.us
27 }
28
29 declare i16 @llvm.fshl.i16(i16, i16, i16)