Skip to content

Commit 0383020

Browse files
NickGuy-Armtstellar
authored andcommitted
[llvm] Fix crash when complex deinterleaving operates on an unrolled loop (llvm#129735)
When attempting to perform complex deinterleaving on an unrolled loop containing a reduction, the complex deinterleaving pass would fail to accommodate the wider types when accumulating the unrolled paths. Instead of trying to alter the incoming IR to fit expectations, the pass should instead decide against processing any reduction that results in a non-complex or non-vector value. (cherry picked from commit 3f4b2f1)
1 parent dc7b743 commit 0383020

File tree

2 files changed

+202
-0
lines changed

2 files changed

+202
-0
lines changed

llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,17 @@ void ComplexDeinterleavingGraph::identifyReductionNodes() {
17411741
LLVM_DEBUG(
17421742
dbgs() << "Identified single reduction starting from instruction: "
17431743
<< *Real << "/" << *ReductionInfo[Real].second << "\n");
1744+
1745+
// Reducing to a single vector is not supported, only permit reducing down
1746+
// to scalar values.
1747+
// Doing this here will leave the prior node in the graph,
1748+
// however with no uses the node will be unreachable by the replacement
1749+
// process. That along with the usage outside the graph should prevent the
1750+
// replacement process from kicking off at all for this graph.
1751+
// TODO Add support for reducing to a single vector value
1752+
if (ReductionInfo[Real].second->getType()->isVectorTy())
1753+
continue;
1754+
17441755
Processed[i] = true;
17451756
auto RootNode = prepareCompositeNode(
17461757
ComplexDeinterleavingOperation::ReductionSingle, Real, nullptr);

0 commit comments

Comments
 (0)