File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -11744,12 +11744,15 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
1174411744 for (ExternalUser &EU : ExternalUses) {
1174511745 // Uses by ephemeral values are free (because the ephemeral value will be
1174611746 // removed prior to code generation, and so the extraction will be
11747- // removed as well) as well as uses in unreachable blocks or in landing pads
11748- // (rarely executed).
11749- if (EphValues.count(EU.User) ||
11750- (EU.User &&
11751- (!DT->isReachableFromEntry(cast<Instruction>(EU.User)->getParent()) ||
11752- cast<Instruction>(EU.User)->getParent()->isLandingPad())))
11747+ // removed as well).
11748+ if (EphValues.count(EU.User))
11749+ continue;
11750+
11751+ // Used in unreachable blocks or in landing pads (rarely executed).
11752+ if (BasicBlock *UserParent =
11753+ EU.User ? cast<Instruction>(EU.User)->getParent() : nullptr;
11754+ UserParent &&
11755+ (!DT->isReachableFromEntry(UserParent) || UserParent->isLandingPad()))
1175311756 continue;
1175411757
1175511758 // We only add extract cost once for the same scalar.
You can’t perform that action at this time.
0 commit comments