LLVM 24.0.0git
SLPReductionUtils.h
Go to the documentation of this file.
1//===- SLPReductionUtils.h - SLP reduction match helpers -------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Internal header used by SLPVectorizer.cpp. It declares free reduction
10// pattern-match helpers that do not depend on BoUpSLP or any other SLP-private
11// type.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TRANSFORMS_VECTORIZE_SLPVECTORIZER_SLPREDUCTIONUTILS_H
16#define LLVM_LIB_TRANSFORMS_VECTORIZE_SLPVECTORIZER_SLPREDUCTIONUTILS_H
17
18namespace llvm {
19class Instruction;
20class PHINode;
21} // namespace llvm
22
23namespace llvm::slpvectorizer {
24
25/// \returns the first operand of \p I that does not match \p Phi. If
26/// the operand is not an instruction, returns nullptr.
27Instruction *getNonPhiOperand(Instruction *I, PHINode *Phi);
28
29/// \returns true if \p I is a candidate instruction for reduction
30/// vectorization.
31bool isReductionCandidate(Instruction *I);
32
33} // namespace llvm::slpvectorizer
34
35#endif // LLVM_LIB_TRANSFORMS_VECTORIZE_SLPVECTORIZER_SLPREDUCTIONUTILS_H
#define I(x, y, z)
Definition MD5.cpp:57
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition BasicBlock.h:73
A private "module" namespace for types and utilities used by this pass.
Instruction * getNonPhiOperand(Instruction *I, PHINode *Phi)
bool isReductionCandidate(Instruction *I)
This is an optimization pass for GlobalISel generic memory operations.