Home | History | Annotate | Download | only in opt

Lines Matching refs:SENode

49 uint32_t SENode::NumberOfNodes = 0;
58 SENode* ScalarEvolutionAnalysis::CreateNegation(SENode* operand) {
62 if (operand->GetType() == SENode::Constant) {
65 std::unique_ptr<SENode> negation_node{new SENegative(this)};
70 SENode* ScalarEvolutionAnalysis::CreateConstant(int64_t integer) {
72 std::unique_ptr<SENode>(new SEConstantNode(this, integer)));
75 SENode* ScalarEvolutionAnalysis::CreateRecurrentExpression(
76 const Loop* loop, SENode* offset, SENode* coefficient) {
98 SENode* ScalarEvolutionAnalysis::AnalyzeMultiplyOp(
104 SENode* op1 =
106 SENode* op2 =
112 SENode* ScalarEvolutionAnalysis::CreateMultiplyNode(SENode* operand_1,
113 SENode* operand_2) {
118 if (operand_1->GetType() == SENode::Constant &&
119 operand_2->GetType() == SENode::Constant) {
124 std::unique_ptr<SENode> multiply_node{new SEMultiplyNode(this)};
132 SENode* ScalarEvolutionAnalysis::CreateSubtraction(SENode* operand_1,
133 SENode* operand_2) {
135 if (operand_1->GetType() == SENode::Constant &&
136 operand_2->GetType() == SENode::Constant) {
144 SENode* ScalarEvolutionAnalysis::CreateAddNode(SENode* operand_1,
145 SENode* operand_2) {
147 if (operand_1->GetType() == SENode::Constant &&
148 operand_2->GetType() == SENode::Constant) {
157 std::unique_ptr<SENode> add_node{new SEAddNode(this)};
165 SENode* ScalarEvolutionAnalysis::AnalyzeInstruction(const Instruction* inst) {
169 SENode* output = nullptr;
198 SENode* ScalarEvolutionAnalysis::AnalyzeConstant(const Instruction* inst) {
228 SENode* ScalarEvolutionAnalysis::AnalyzeAddOp(const Instruction* inst) {
235 SENode* op1 =
238 SENode* op2 =
249 SENode* ScalarEvolutionAnalysis::AnalyzePhiInstruction(const Instruction* phi) {
300 SENode* value_node = AnalyzeInstruction(value_inst);
312 if (value_node->GetType() != SENode::Add)
315 SENode* step_node = nullptr;
316 SENode* phi_operand = nullptr;
317 SENode* operand_1 = value_node->GetChild(0);
318 SENode* operand_2 = value_node->GetChild(1);
352 SENode* ScalarEvolutionAnalysis::CreateValueUnknownNode(
359 SENode* ScalarEvolutionAnalysis::CreateCantComputeNode() {
364 SENode* ScalarEvolutionAnalysis::GetCachedOrAdd(
365 std::unique_ptr<SENode> prospective_node) {
371 SENode* raw_ptr_to_node = prospective_node.get();
377 const SENode* node) const {
397 SENode* ScalarEvolutionAnalysis::GetCoefficientFromRecurrentTerm(
398 SENode* node, const Loop* loop) {
409 SENode* ScalarEvolutionAnalysis::UpdateChildNode(SENode* parent,
410 SENode* old_child,
411 SENode* new_child) {
413 if (parent->GetType() != SENode::Add) return parent;
415 std::vector<SENode*> new_children;
416 for (SENode* child : *parent) {
424 std::unique_ptr<SENode> add_node{new SEAddNode(this)};
425 for (SENode* child : new_children) {
434 SENode* ScalarEvolutionAnalysis::BuildGraphWithoutRecurrentTerm(
435 SENode* node, const Loop* loop) {
447 std::vector<SENode*> new_children;
458 std::unique_ptr<SENode> add_node{new SEAddNode(this)};
459 for (SENode* child : new_children) {
468 SERecurrentNode* ScalarEvolutionAnalysis::GetRecurrentTerm(SENode* node,
478 std::string SENode::AsString() const {
498 bool SENode::operator==(const SENode& other) const {
532 if (GetType() == SENode::ValueUnknown) {
548 bool SENode::operator!=(const SENode& other) const { return !(*this == other); }
583 size_t SENodeHash::operator()(const SENode* node) const {
594 if (node->GetType() == SENode::Constant)
617 if (node->GetType() == SENode::ValueUnknown) {
621 // Hash the pointers of the child nodes, each SENode has a unique pointer
623 const std::vector<SENode*>& children = node->GetChildren();
624 for (const SENode* child : children) {
632 size_t SENodeHash::operator()(const std::unique_ptr<SENode>& node) const {
636 void SENode::DumpDot(std::ostream& out, bool recurse) const {
637 size_t unique_id = std::hash<const SENode*>{}(this);
639 if (GetType() == SENode::Constant) {
643 for (const SENode* child : children_) {
644 size_t child_unique_id = std::hash<const SENode*>{}(child);
661 bool Eval(const SENode* node, bool or_equal_zero, bool* result) {
808 Signedness Visit(const SENode* node) {
810 case SENode::Constant:
813 case SENode::RecurrentAddExpr:
816 case SENode::Negative:
819 case SENode::CanNotCompute:
822 case SENode::ValueUnknown:
825 case SENode::Add:
828 case SENode::Multiply:
901 const SENode* node,
904 for (const SENode* operand : make_range(++node->begin(), node->end())) {
917 bool ScalarEvolutionAnalysis::IsAlwaysGreaterThanZero(SENode* node,
923 SENode* node, bool* is_ge_zero) const {
931 static SENode* RemoveOneNodeFromMultiplyChain(SEMultiplyNode* mul,
932 const SENode* node) {
933 SENode* lhs = mul->GetChildren()[0];
934 SENode* rhs = mul->GetChildren()[1];
942 SENode* res = RemoveOneNodeFromMultiplyChain(lhs->AsSEMultiplyNode(), node);
947 SENode* res = RemoveOneNodeFromMultiplyChain(rhs->AsSEMultiplyNode(), node);
958 SENode* lhs = node_;
959 SENode* rhs = rhs_wrapper.node_;
978 SENode* res = RemoveOneNodeFromMultiplyChain(lhs->AsSEMultiplyNode(), rhs);