Skip to content

Commit 9cbb0f4

Browse files
committed
[VPlan] Address review
1 parent 7e7fcbb commit 9cbb0f4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Transforms/Vectorize/VPlanUtils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@ bool vputils::isUniformAcrossVFsAndUFs(VPValue *V) {
110110
return TypeSwitch<const VPRecipeBase *, bool>(R)
111111
.Case<VPDerivedIVRecipe>([](const auto *R) { return true; })
112112
.Case<VPReplicateRecipe>([](const auto *R) {
113+
// Be conservative about side-effects, except for the
114+
// known-side-effecting assumes and stores, which we know will be
115+
// uniform.
113116
return R->isSingleScalar() &&
117+
(!R->mayHaveSideEffects() ||
118+
isa<AssumeInst, StoreInst>(R->getUnderlyingInstr())) &&
114119
all_of(R->operands(), isUniformAcrossVFsAndUFs);
115120
})
116121
.Case<VPInstruction>([](const auto *VPI) {

0 commit comments

Comments
 (0)