Skip to content

Commit 24a9da4

Browse files
committed
[VPlan] Address review
1 parent 60a2e03 commit 24a9da4

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
@@ -113,7 +113,12 @@ bool vputils::isUniformAcrossVFsAndUFs(VPValue *V) {
113113
return TypeSwitch<const VPRecipeBase *, bool>(R)
114114
.Case<VPDerivedIVRecipe>([](const auto *R) { return true; })
115115
.Case<VPReplicateRecipe>([](const auto *R) {
116+
// Be conservative about side-effects, except for the
117+
// known-side-effecting assumes and stores, which we know will be
118+
// uniform.
116119
return R->isSingleScalar() &&
120+
(!R->mayHaveSideEffects() ||
121+
isa<AssumeInst, StoreInst>(R->getUnderlyingInstr())) &&
117122
all_of(R->operands(), isUniformAcrossVFsAndUFs);
118123
})
119124
.Case<VPInstruction>([](const auto *VPI) {

0 commit comments

Comments
 (0)