Skip to content

Commit 5add927

Browse files
committed
Ensure that the ComplexDeinterleavingPass operates only on complex numbers
1 parent ac40f76 commit 5add927

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,11 +1756,18 @@ void ComplexDeinterleavingGraph::identifyReductionNodes() {
17561756

17571757
bool ComplexDeinterleavingGraph::checkNodes() {
17581758

1759+
bool FoundDeinterleaveNode = false;
17591760
for (NodePtr N : CompositeNodes) {
17601761
if (!N->areOperandsValid())
17611762
return false;
1763+
if (N->Operation == ComplexDeinterleavingOperation::Deinterleave)
1764+
FoundDeinterleaveNode = true;
17621765
}
17631766

1767+
// We need a deinterleave node in order to guarantee that we're working with complex numbers.
1768+
if (!FoundDeinterleaveNode)
1769+
return false;
1770+
17641771
// Collect all instructions from roots to leaves
17651772
SmallPtrSet<Instruction *, 16> AllInstructions;
17661773
SmallVector<Instruction *, 8> Worklist;

0 commit comments

Comments
 (0)