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) {
11744
11744
for (ExternalUser &EU : ExternalUses) {
11745
11745
// Uses by ephemeral values are free (because the ephemeral value will be
11746
11746
// 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()))
11753
11756
continue;
11754
11757
11755
11758
// We only add extract cost once for the same scalar.
You can’t perform that action at this time.
0 commit comments