Skip to content

Commit 1bf2f2e

Browse files
committed
Change identifyNode parameter to use bool* instead of bool&
Remove debug comments
1 parent b241068 commit 1bf2f2e

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ class ComplexDeinterleavingGraph {
338338
NodePtr identifyPartialReduction(Value *R, Value *I);
339339
NodePtr identifyDotProduct(Value *Inst);
340340

341-
NodePtr identifyNode(Value *R, Value *I);
342-
NodePtr identifyNode(Value *R, Value *I, bool &FromCache);
341+
NodePtr identifyNode(Value *R, Value *I, bool *FromCache = nullptr);
343342

344343
/// Determine if a sum of complex numbers can be formed from \p RealAddends
345344
/// and \p ImagAddens. If \p Accumulator is not null, add the result to it.
@@ -990,7 +989,7 @@ ComplexDeinterleavingGraph::identifyDotProduct(Value *V) {
990989
BImag = UnwrapCast(BImag);
991990

992991
bool WasANodeFromCache = false;
993-
NodePtr Node = identifyNode(AReal, AImag, WasANodeFromCache);
992+
NodePtr Node = identifyNode(AReal, AImag, &WasANodeFromCache);
994993

995994
// In the case that a node was identified to figure out the rotation, ensure
996995
// that trying to identify a node with AReal and AImag post-unwrap results in
@@ -1053,17 +1052,12 @@ ComplexDeinterleavingGraph::identifyPartialReduction(Value *R, Value *I) {
10531052
}
10541053

10551054
ComplexDeinterleavingGraph::NodePtr
1056-
ComplexDeinterleavingGraph::identifyNode(Value *R, Value *I) {
1057-
bool _;
1058-
return identifyNode(R, I, _);
1059-
}
1060-
1061-
ComplexDeinterleavingGraph::NodePtr
1062-
ComplexDeinterleavingGraph::identifyNode(Value *R, Value *I, bool &FromCache) {
1055+
ComplexDeinterleavingGraph::identifyNode(Value *R, Value *I, bool *FromCache) {
10631056
auto It = CachedResult.find({R, I});
10641057
if (It != CachedResult.end()) {
10651058
LLVM_DEBUG(dbgs() << " - Folding to existing node\n");
1066-
FromCache = true;
1059+
if (FromCache != nullptr)
1060+
*FromCache = true;
10671061
return It->second;
10681062
}
10691063

@@ -1690,7 +1684,6 @@ bool ComplexDeinterleavingGraph::collectPotentialReductions(BasicBlock *B) {
16901684
}
16911685

16921686
void ComplexDeinterleavingGraph::identifyReductionNodes() {
1693-
dbgs() << "identifyReductionNodes\n";
16941687
SmallVector<bool> Processed(ReductionInfo.size(), false);
16951688
SmallVector<Instruction *> OperationInstruction;
16961689
for (auto &P : ReductionInfo)
@@ -1746,7 +1739,6 @@ void ComplexDeinterleavingGraph::identifyReductionNodes() {
17461739
RealPHI = ReductionInfo[Real].first;
17471740
ImagPHI = nullptr;
17481741
PHIsFound = false;
1749-
dbgs() << "identifyNode from Phi " << *RealPHI << " / " << *Real << "\n";
17501742
auto Node = identifyNode(Real->getOperand(0), Real->getOperand(1));
17511743
if (Node && PHIsFound) {
17521744
LLVM_DEBUG(

0 commit comments

Comments
 (0)