aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp
diff options
context:
space:
mode:
authorNicholas Guy <nicholas.guy@arm.com>2025-01-09 08:31:57 +0000
committerGitHub <noreply@github.com>2025-01-09 08:31:57 +0000
commit1b2943534fa20a61c07592a9bd90203e682ae0f4 (patch)
treef8f0af0c9925fa9636d981a39ab756d6e54f08ae /llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp
parent4847395c5459f9c476808f9337abdae7fbd78a23 (diff)
downloadllvm-1b2943534fa20a61c07592a9bd90203e682ae0f4.zip
llvm-1b2943534fa20a61c07592a9bd90203e682ae0f4.tar.gz
llvm-1b2943534fa20a61c07592a9bd90203e682ae0f4.tar.bz2
[llvm] Fix crash caused by reprocessing complex reductions (#122077)
If a complex pattern had the shape of both a complex->complex reduction and a complex->single reduction, the matching would recognise both and deem the graph a valid transformation. Preventing this reprocessing results in only one of these matching, meaning that in the case of an invalid graph, we don't try to transform it anyway.
Diffstat (limited to 'llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp')
-rw-r--r--llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp b/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp
index aec8df9..92053ed 100644
--- a/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp
+++ b/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp
@@ -1730,7 +1730,7 @@ void ComplexDeinterleavingGraph::identifyReductionNodes() {
auto *Real = OperationInstruction[i];
// We want to check that we have 2 operands, but the function attributes
// being counted as operands bloats this value.
- if (Real->getNumOperands() < 2)
+ if (Processed[i] || Real->getNumOperands() < 2)
continue;
RealPHI = ReductionInfo[Real].first;