Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Revert "[SLP] Improve gather tree nodes matching when users are PHIs.…
Browse files Browse the repository at this point in the history
… (#69392)"

This reverts commit c80b503.

This change causes a fatal error in the backend and is filed as issue #69670.
  • Loading branch information
dyung committed Oct 20, 2023
1 parent 71bdd2c commit 734b016
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9043,7 +9043,6 @@ BoUpSLP::isGatherShuffledEntry(const TreeEntry *TE, ArrayRef<Value *> VL,
// blocks.
if (auto *PHI = dyn_cast<PHINode>(TEUseEI.UserTE->getMainOp())) {
TEInsertBlock = PHI->getIncomingBlock(TEUseEI.EdgeIdx);
TEInsertPt = TEInsertBlock->getTerminator();
} else {
TEInsertBlock = TEInsertPt->getParent();
}
Expand Down Expand Up @@ -9107,10 +9106,9 @@ BoUpSLP::isGatherShuffledEntry(const TreeEntry *TE, ArrayRef<Value *> VL,
const Instruction *InsertPt =
UserPHI ? UserPHI->getIncomingBlock(UseEI.EdgeIdx)->getTerminator()
: &getLastInstructionInBundle(UseEI.UserTE);
if (TEInsertPt == InsertPt) {
// If 2 gathers are operands of the same entry (regardless of wether
// user is PHI or else), compare operands indices, use the earlier one
// as the base.
if (!UserPHI && TEInsertPt == InsertPt) {
// If 2 gathers are operands of the same non-PHI entry,
// compare operands indices, use the earlier one as the base.
if (TEUseEI.UserTE == UseEI.UserTE && TEUseEI.EdgeIdx < UseEI.EdgeIdx)
continue;
// If the user instruction is used for some reason in different
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
; YAML: Function: test
; YAML: Args:
; YAML: - String: 'Stores SLP vectorized with cost '
; YAML: - Cost: '-6'
; YAML: - Cost: '-3'
; YAML: - String: ' and with tree size '
; YAML: - TreeSize: '14'
; YAML: ...
Expand Down

0 comments on commit 734b016

Please sign in to comment.