Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NickGuy-Arm committed Dec 10, 2024
1 parent 646ffe3 commit b3550a5
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ static bool isNeg(Value *V);
static Value *getNegOperand(Value *V);

namespace {
template<typename T, typename IterT>
std::optional<T> findCommonBetweenCollections(IterT A, IterT B) {
auto Common = llvm::find_if(A, [B](T I){return llvm::is_contained(B, I);});
if (Common != A.end())
return std::make_optional(*Common);
return std::nullopt;
}
template <typename T, typename IterT>
std::optional<T> findCommonBetweenCollections(IterT A, IterT B) {
auto Common = llvm::find_if(A, [B](T I) { return llvm::is_contained(B, I); });
if (Common != A.end())
return std::make_optional(*Common);
return std::nullopt;
}

class ComplexDeinterleavingLegacyPass : public FunctionPass {
class ComplexDeinterleavingLegacyPass : public FunctionPass {
public:
static char ID;

Expand Down Expand Up @@ -207,7 +207,7 @@ struct ComplexDeinterleavingCompositeNode {
}
}

bool AreOperandsValid() { return OperandsValid; }
bool areOperandsValid() { return OperandsValid; }
};

class ComplexDeinterleavingGraph {
Expand Down Expand Up @@ -1034,13 +1034,14 @@ ComplexDeinterleavingGraph::identifyPartialReduction(Value *R, Value *I) {
if (!isa<VectorType>(R->getType()) || !isa<VectorType>(I->getType()))
return nullptr;

auto CommonUser = findCommonBetweenCollections<Value*>(R->users(), I->users());
auto CommonUser =
findCommonBetweenCollections<Value *>(R->users(), I->users());
if (!CommonUser)
return nullptr;

auto *IInst = dyn_cast<IntrinsicInst>(*CommonUser);
if (!IInst || IInst->getIntrinsicID() !=
Intrinsic::experimental_vector_partial_reduce_add)
Intrinsic::experimental_vector_partial_reduce_add)
return nullptr;

if (NodePtr CN = identifyDotProduct(IInst))
Expand Down Expand Up @@ -1756,7 +1757,7 @@ void ComplexDeinterleavingGraph::identifyReductionNodes() {
bool ComplexDeinterleavingGraph::checkNodes() {

for (NodePtr N : CompositeNodes) {
if (!N->AreOperandsValid())
if (!N->areOperandsValid())
return false;
}

Expand Down

0 comments on commit b3550a5

Please sign in to comment.