File tree 2 files changed +6
-3
lines changed
test/Transforms/LoopVectorize/AArch64 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -469,8 +469,9 @@ Value *VPInstruction::generate(VPTransformState &State) {
469
469
return Builder.CreateNot (A, Name);
470
470
}
471
471
case Instruction::ExtractElement: {
472
+ assert (State.VF .isVector () && " Only extract elements from vectors" );
472
473
Value *Vec = State.get (getOperand (0 ));
473
- Value *Idx = State.get (getOperand (1 ), true );
474
+ Value *Idx = State.get (getOperand (1 ), /* IsScalar= */ true );
474
475
return Builder.CreateExtractElement (Vec, Idx, Name);
475
476
}
476
477
case Instruction::ICmp: {
@@ -887,6 +888,8 @@ bool VPInstruction::onlyFirstLaneUsed(const VPValue *Op) const {
887
888
return false ;
888
889
case Instruction::PHI:
889
890
return true ;
891
+ case Instruction::ExtractElement:
892
+ return Op == getOperand (1 );
890
893
case Instruction::ICmp:
891
894
case Instruction::Select:
892
895
case Instruction::Or:
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ define i64 @same_exit_block_pre_inc_use1_sve() #1 {
14
14
; CHECK-NEXT: Cost of 4 for VF vscale x 16: EMIT vp<{{.*}}> = first-active-lane vp<{{.*}}>
15
15
; CHECK-NEXT: Cost of 2 for VF vscale x 16: EMIT vp<{{.*}}> = extractelement ir<{{.*}}>, vp<{{.*}}>
16
16
; CHECK-NEXT: Cost of 4 for VF vscale x 16: EMIT vp<{{.*}}>.1 = first-active-lane vp<{{.*}}>
17
- ; CHECK-NEXT: Cost of 2 for VF vscale x 16: EMIT vp<{{.*}}>.1 = extractelement ir<{{.*}}>, vp<%first.active.lane >.1
17
+ ; CHECK-NEXT: Cost of 2 for VF vscale x 16: EMIT vp<{{.*}}>.1 = extractelement ir<{{.*}}>, vp<{{.*}} >.1
18
18
; CHECK: LV: Minimum required TC for runtime checks to be profitable:32
19
19
entry:
20
20
%p1 = alloca [1024 x i8 ]
@@ -53,7 +53,7 @@ define i64 @same_exit_block_pre_inc_use1_nosve() {
53
53
; CHECK-NEXT: Cost of 48 for VF 16: EMIT vp<{{.*}}> = first-active-lane vp<{{.*}}>
54
54
; CHECK-NEXT: Cost of 2 for VF 16: EMIT vp<{{.*}}> = extractelement ir<{{.*}}>, vp<{{.*}}>
55
55
; CHECK-NEXT: Cost of 48 for VF 16: EMIT vp<{{.*}}>.1 = first-active-lane vp<{{.*}}>
56
- ; CHECK-NEXT: Cost of 2 for VF 16: EMIT vp<{{.*}}>.1 = extractelement ir<{{.*}}>, vp<%first.active.lane >.1
56
+ ; CHECK-NEXT: Cost of 2 for VF 16: EMIT vp<{{.*}}>.1 = extractelement ir<{{.*}}>, vp<{{.*}} >.1
57
57
; CHECK: LV: Minimum required TC for runtime checks to be profitable:176
58
58
; CHECK-NEXT: LV: Vectorization is not beneficial: expected trip count < minimum profitable VF (64 < 176)
59
59
; CHECK-NEXT: LV: Too many memory checks needed.
You can’t perform that action at this time.
0 commit comments