Skip to content

Commit bf0d6f0

Browse files
committed
!fixup address latest comments, thanks
1 parent 96a0568 commit bf0d6f0

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,10 +2375,9 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
23752375
if (auto *II = dyn_cast<AssumeInst>(Cloned))
23762376
AC->registerAssumption(II);
23772377

2378-
// End if-block.
2379-
VPRegionBlock *Parent = RepRecipe->getParent()->getParent();
23802378
assert(
2381-
(Parent || !RepRecipe->getParent()->getPlan()->getVectorLoopRegion() ||
2379+
(RepRecipe->getParent()->getParent() ||
2380+
!RepRecipe->getParent()->getPlan()->getVectorLoopRegion() ||
23822381
all_of(RepRecipe->operands(),
23832382
[](VPValue *Op) { return Op->isDefinedOutsideLoopRegions(); })) &&
23842383
"Expected a recipe is either within a region or all of its operands "

llvm/test/Transforms/LoopVectorize/AArch64/masked-call.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -996,9 +996,9 @@ define void @test_widen_exp_v2(ptr noalias %p2, ptr noalias %p, i64 %n) #5 {
996996
; TFA_INTERLEAVE-NEXT: [[ACTIVE_LANE_MASK_ENTRY1:%.*]] = icmp ult i64 1, [[TMP0]]
997997
; TFA_INTERLEAVE-NEXT: br label %[[VECTOR_BODY:.*]]
998998
; TFA_INTERLEAVE: [[VECTOR_BODY]]:
999-
; TFA_INTERLEAVE-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[TMP27:%.*]], %[[TMP19:.*]] ]
1000-
; TFA_INTERLEAVE-NEXT: [[ACTIVE_LANE_MASK:%.*]] = phi i1 [ [[ACTIVE_LANE_MASK_ENTRY]], %[[ENTRY]] ], [ [[ACTIVE_LANE_MASK_NEXT:%.*]], %[[TMP19]] ]
1001-
; TFA_INTERLEAVE-NEXT: [[ACTIVE_LANE_MASK2:%.*]] = phi i1 [ [[ACTIVE_LANE_MASK_ENTRY1]], %[[ENTRY]] ], [ [[ACTIVE_LANE_MASK_NEXT6:%.*]], %[[TMP19]] ]
999+
; TFA_INTERLEAVE-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[TMP27:%.*]], %[[PRED_STORE_CONTINUE5:.*]] ]
1000+
; TFA_INTERLEAVE-NEXT: [[ACTIVE_LANE_MASK:%.*]] = phi i1 [ [[ACTIVE_LANE_MASK_ENTRY]], %[[ENTRY]] ], [ [[ACTIVE_LANE_MASK_NEXT:%.*]], %[[PRED_STORE_CONTINUE5]] ]
1001+
; TFA_INTERLEAVE-NEXT: [[ACTIVE_LANE_MASK2:%.*]] = phi i1 [ [[ACTIVE_LANE_MASK_ENTRY1]], %[[ENTRY]] ], [ [[ACTIVE_LANE_MASK_NEXT6:%.*]], %[[PRED_STORE_CONTINUE5]] ]
10021002
; TFA_INTERLEAVE-NEXT: [[TMP4:%.*]] = load double, ptr [[P2]], align 8
10031003
; TFA_INTERLEAVE-NEXT: [[TMP5:%.*]] = tail call double @llvm.exp.f64(double [[TMP4]]) #[[ATTR7:[0-9]+]]
10041004
; TFA_INTERLEAVE-NEXT: [[TMP8:%.*]] = tail call double @llvm.exp.f64(double [[TMP4]]) #[[ATTR7]]
@@ -1016,11 +1016,11 @@ define void @test_widen_exp_v2(ptr noalias %p2, ptr noalias %p, i64 %n) #5 {
10161016
; TFA_INTERLEAVE-NEXT: [[TMP15:%.*]] = xor i1 [[TMP13]], true
10171017
; TFA_INTERLEAVE-NEXT: [[TMP16:%.*]] = xor i1 [[TMP14]], true
10181018
; TFA_INTERLEAVE-NEXT: [[TMP17:%.*]] = or i1 [[TMP15]], [[TMP16]]
1019-
; TFA_INTERLEAVE-NEXT: br i1 [[TMP17]], label %[[BB18:.*]], label %[[TMP19]]
1019+
; TFA_INTERLEAVE-NEXT: br i1 [[TMP17]], label %[[BB18:.*]], label %[[PRED_STORE_CONTINUE5]]
10201020
; TFA_INTERLEAVE: [[BB18]]:
10211021
; TFA_INTERLEAVE-NEXT: store double [[SPEC_SELECT]], ptr [[P]], align 8
1022-
; TFA_INTERLEAVE-NEXT: br label %[[TMP19]]
1023-
; TFA_INTERLEAVE: [[TMP19]]:
1022+
; TFA_INTERLEAVE-NEXT: br label %[[PRED_STORE_CONTINUE5]]
1023+
; TFA_INTERLEAVE: [[PRED_STORE_CONTINUE5]]:
10241024
; TFA_INTERLEAVE-NEXT: [[TMP27]] = add i64 [[INDEX]], 2
10251025
; TFA_INTERLEAVE-NEXT: [[TMP11:%.*]] = add i64 [[INDEX]], 1
10261026
; TFA_INTERLEAVE-NEXT: [[ACTIVE_LANE_MASK_NEXT]] = icmp ult i64 [[INDEX]], [[TMP3]]

llvm/test/Transforms/LoopVectorize/X86/small-size.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ define void @example2(i32 %n, i32 %x) optsize {
258258

259259
; Loop has no primary induction as its integer IV has step -1 starting at
260260
; unknown N, but can still be vectorized.
261+
; Note: Most scalar pointer induction GEPs could be sunk into the conditional
262+
; blocks.
261263
define void @example3(i32 %n, ptr noalias nocapture %p, ptr noalias nocapture %q) optsize {
262264
; CHECK-LABEL: @example3(
263265
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[N:%.*]], 0
@@ -445,6 +447,8 @@ define void @example23b(ptr noalias nocapture %src, ptr noalias nocapture %dst)
445447
}
446448

447449
; We CAN vectorize this example by folding the tail it entails.
450+
; Note: Most scalar pointer induction GEPs could be sunk into the conditional
451+
; blocks.
448452
define void @example23c(ptr noalias nocapture %src, ptr noalias nocapture %dst) optsize {
449453
; CHECK-LABEL: @example23c(
450454
; CHECK-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]

llvm/test/Transforms/LoopVectorize/pointer-induction.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
; RUN: opt < %s -passes=loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -lv-strided-pointer-ivs=true -S | FileCheck --check-prefixes=CHECK,STRIDED %s
44
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
55

6-
6+
; Note: Most scalar pointer induction GEPs could be sunk into the conditional
7+
; blocks.
78
; Function Attrs: nofree norecurse nounwind
89
define void @a(ptr readnone %b) {
910
; CHECK-LABEL: @a(

llvm/test/Transforms/LoopVectorize/tail-folding-vectorization-factor-1.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ for.body:
8282
br i1 %exitcond, label %for.cond.cleanup, label %for.body
8383
}
8484

85+
; Note: Most scalar pointer induction GEPs could be sunk into the conditional
86+
; blocks.
8587
define void @VF1-VPWidenCanonicalIVRecipeExe(ptr %ptr1) {
8688
; CHECK-LABEL: @VF1-VPWidenCanonicalIVRecipeExe(
8789
; CHECK-NEXT: entry:

0 commit comments

Comments
 (0)