#include "source/opt/scalar_analysis.h"
#include <functional>
#include <string>
#include <utility>
#include "source/opt/ir_context.h"
namespace spvtools {
namespace opt {
uint32_t SENode::NumberOfNodes = …;
ScalarEvolutionAnalysis::ScalarEvolutionAnalysis(IRContext* context)
: … { … }
SENode* ScalarEvolutionAnalysis::CreateNegation(SENode* operand) { … }
SENode* ScalarEvolutionAnalysis::CreateConstant(int64_t integer) { … }
SENode* ScalarEvolutionAnalysis::CreateRecurrentExpression(
const Loop* loop, SENode* offset, SENode* coefficient) { … }
SENode* ScalarEvolutionAnalysis::AnalyzeMultiplyOp(
const Instruction* multiply) { … }
SENode* ScalarEvolutionAnalysis::CreateMultiplyNode(SENode* operand_1,
SENode* operand_2) { … }
SENode* ScalarEvolutionAnalysis::CreateSubtraction(SENode* operand_1,
SENode* operand_2) { … }
SENode* ScalarEvolutionAnalysis::CreateAddNode(SENode* operand_1,
SENode* operand_2) { … }
SENode* ScalarEvolutionAnalysis::AnalyzeInstruction(const Instruction* inst) { … }
SENode* ScalarEvolutionAnalysis::AnalyzeConstant(const Instruction* inst) { … }
SENode* ScalarEvolutionAnalysis::AnalyzeAddOp(const Instruction* inst) { … }
SENode* ScalarEvolutionAnalysis::AnalyzePhiInstruction(const Instruction* phi) { … }
SENode* ScalarEvolutionAnalysis::CreateValueUnknownNode(
const Instruction* inst) { … }
SENode* ScalarEvolutionAnalysis::CreateCantComputeNode() { … }
SENode* ScalarEvolutionAnalysis::GetCachedOrAdd(
std::unique_ptr<SENode> prospective_node) { … }
bool ScalarEvolutionAnalysis::IsLoopInvariant(const Loop* loop,
const SENode* node) const { … }
SENode* ScalarEvolutionAnalysis::GetCoefficientFromRecurrentTerm(
SENode* node, const Loop* loop) { … }
SENode* ScalarEvolutionAnalysis::UpdateChildNode(SENode* parent,
SENode* old_child,
SENode* new_child) { … }
SENode* ScalarEvolutionAnalysis::BuildGraphWithoutRecurrentTerm(
SENode* node, const Loop* loop) { … }
SERecurrentNode* ScalarEvolutionAnalysis::GetRecurrentTerm(SENode* node,
const Loop* loop) { … }
std::string SENode::AsString() const { … }
bool SENode::operator==(const SENode& other) const { … }
bool SENode::operator!=(const SENode& other) const { … }
namespace {
template <typename T, size_t size_of_t>
struct PushToStringImpl;
PushToStringImpl<T, 8>;
PushToStringImpl<T, 4>;
template <typename T>
void PushToString(T id, std::u32string* str) { … }
}
size_t SENodeHash::operator()(const SENode* node) const { … }
size_t SENodeHash::operator()(const std::unique_ptr<SENode>& node) const { … }
void SENode::DumpDot(std::ostream& out, bool recurse) const { … }
namespace {
class IsGreaterThanZero { … };
}
bool ScalarEvolutionAnalysis::IsAlwaysGreaterThanZero(SENode* node,
bool* is_gt_zero) const { … }
bool ScalarEvolutionAnalysis::IsAlwaysGreaterOrEqualToZero(
SENode* node, bool* is_ge_zero) const { … }
namespace {
SENode* RemoveOneNodeFromMultiplyChain(SEMultiplyNode* mul,
const SENode* node) { … }
}
std::pair<SExpression, int64_t> SExpression::operator/(
SExpression rhs_wrapper) const { … }
}
}