@@ -5635,8 +5635,11 @@ BoUpSLP::getReorderingData(const TreeEntry &TE, bool TopToBottom) {
5635
5635
auto PHICompare = [&](unsigned I1, unsigned I2) {
5636
5636
Value *V1 = TE.Scalars[I1];
5637
5637
Value *V2 = TE.Scalars[I2];
5638
- if (V1 == V2 || (V1->getNumUses() == 0 && V2->getNumUses() == 0) ||
5639
- isa<PoisonValue>(V1) || isa<PoisonValue>(V2))
5638
+ if (V1 == V2 || (V1->getNumUses() == 0 && V2->getNumUses() == 0))
5639
+ return false;
5640
+ if (isa<PoisonValue>(V1))
5641
+ return true;
5642
+ if (isa<PoisonValue>(V2))
5640
5643
return false;
5641
5644
if (V1->getNumUses() < V2->getNumUses())
5642
5645
return true;
@@ -21733,9 +21736,6 @@ bool SLPVectorizerPass::vectorizeStoreChains(BoUpSLP &R) {
21733
21736
V2->getValueOperand()->getType()->getScalarSizeInBits())
21734
21737
return false;
21735
21738
// UndefValues are compatible with all other values.
21736
- if (isa<UndefValue>(V->getValueOperand()) ||
21737
- isa<UndefValue>(V2->getValueOperand()))
21738
- return false;
21739
21739
if (auto *I1 = dyn_cast<Instruction>(V->getValueOperand()))
21740
21740
if (auto *I2 = dyn_cast<Instruction>(V2->getValueOperand())) {
21741
21741
DomTreeNodeBase<llvm::BasicBlock> *NodeI1 =
@@ -21749,14 +21749,8 @@ bool SLPVectorizerPass::vectorizeStoreChains(BoUpSLP &R) {
21749
21749
"Different nodes should have different DFS numbers");
21750
21750
if (NodeI1 != NodeI2)
21751
21751
return NodeI1->getDFSNumIn() < NodeI2->getDFSNumIn();
21752
- InstructionsState S = getSameOpcode({I1, I2}, *TLI);
21753
- if (S.getOpcode())
21754
- return false;
21755
21752
return I1->getOpcode() < I2->getOpcode();
21756
21753
}
21757
- if (isa<Constant>(V->getValueOperand()) &&
21758
- isa<Constant>(V2->getValueOperand()))
21759
- return false;
21760
21754
return V->getValueOperand()->getValueID() <
21761
21755
V2->getValueOperand()->getValueID();
21762
21756
};
0 commit comments