PandA-2024.02
|
Collapse and if and its "then" branch only if it is shorter than one cycle and the else is a BB composed only by return and PHI statements. More...
#include "remove_ending_if.hpp"
#include "Parameter.hpp"
#include "allocation_information.hpp"
#include "application_manager.hpp"
#include "basic_block.hpp"
#include "behavioral_helper.hpp"
#include "call_graph.hpp"
#include "call_graph_manager.hpp"
#include "custom_set.hpp"
#include "cyclic_topological_sort.hpp"
#include "dbgPrintHelper.hpp"
#include "design_flow_manager.hpp"
#include "ext_tree_node.hpp"
#include "function_behavior.hpp"
#include "hls.hpp"
#include "hls_constraints.hpp"
#include "hls_manager.hpp"
#include "hls_step.hpp"
#include "schedule.hpp"
#include "string_manipulation.hpp"
#include "token_interface.hpp"
#include "tree_basic_block.hpp"
#include "tree_helper.hpp"
#include "tree_manager.hpp"
#include "tree_manipulation.hpp"
#include "tree_reindex.hpp"
#include <cstdlib>
#include <fstream>
Go to the source code of this file.
Collapse and if and its "then" branch only if it is shorter than one cycle and the else is a BB composed only by return and PHI statements.
Complete description: This step collapses an if block and its "then" branch only if the branch lasts one cycle and doesn't contain store and call. Furthermore, the BB following the if should be the last BB (preceding the EXTI) and has to contain only a return statement ad a PHI statement, also the "then" BB has to be linked to this block. | _ _ _ _| _ _ _ _ _ _ _ _ _ _ _ | | | | | IF BLOC | |IF + THEN STMTs| |_ _ _ _ _ _ _ | |_ _ _ _ _ _ _ _| / \ | / \ | / \ TRANSFORMATION | _ _ _ _ /_ _ _ \ _ _ _ _|_ _ _ _ | | / ----—> | | | THEN BRANCH | / | RETURN | |_ _ _ _ _ _ _ | / |_ _ _ _ _ _ _ _| \ / \ / \ / _ __ _ _/_ _ | | | RETURN & PHI| |_ _ _ _ _ _ _|
Macro idea:
Find the pattern = chain of if condition
Manipulation For each stmt in the bloc identified as "then" branch:
Definition in file remove_ending_if.cpp.