From 8006576b3646f3ee621b38b5f27a138a50d073bf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 23 Jun 2010 12:19:07 -0700 Subject: [PATCH] ir_function_inlining: Allow inlining of loops and conditionals. The new cloning code handles them. --- ir_function_can_inline.cpp | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/ir_function_can_inline.cpp b/ir_function_can_inline.cpp index 5761a742049..8bb8e0d9ed7 100644 --- a/ir_function_can_inline.cpp +++ b/ir_function_can_inline.cpp @@ -39,28 +39,14 @@ class ir_function_can_inline_visitor : public ir_hierarchical_visitor { public: ir_function_can_inline_visitor() { - this->can_inline = true; this->num_returns = 0; } - virtual ir_visitor_status visit_enter(ir_loop *); virtual ir_visitor_status visit_enter(ir_return *); - virtual ir_visitor_status visit_enter(ir_if *); - bool can_inline; int num_returns; }; -ir_visitor_status -ir_function_can_inline_visitor::visit_enter(ir_loop *ir) -{ - /* FINISHME: Implement loop cloning in ir_function_inlining.cpp */ - (void) ir; - this->can_inline = false; - return visit_stop; -} - - ir_visitor_status ir_function_can_inline_visitor::visit_enter(ir_return *ir) { @@ -69,16 +55,6 @@ ir_function_can_inline_visitor::visit_enter(ir_return *ir) return visit_continue; } - -ir_visitor_status -ir_function_can_inline_visitor::visit_enter(ir_if *ir) -{ - /* FINISHME: Implement if cloning in ir_function_inlining.cpp. */ - (void) ir; - this->can_inline = false; - return visit_stop; -} - bool can_inline(ir_call *call) { @@ -91,5 +67,5 @@ can_inline(ir_call *call) if (last && !last->as_return()) v.num_returns++; - return v.can_inline && v.num_returns == 1; + return v.num_returns == 1; } -- 2.30.2