From: Yongjia Zhang Date: Thu, 17 Jul 2014 18:14:41 +0000 (+0800) Subject: Enable structural analysis X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e5595b39baa0299b9d908591f1966d6ddb6c7b5;p=contrib%2Fbeignet.git Enable structural analysis enable structural analysis and use if, else and endif in the generated asm. Signed-off-by: Yongjia Zhang Reviewed-by: Zhigang Gong --- diff --git a/backend/src/llvm/llvm_to_gen.cpp b/backend/src/llvm/llvm_to_gen.cpp index 153b11d..328dbc1 100644 --- a/backend/src/llvm/llvm_to_gen.cpp +++ b/backend/src/llvm/llvm_to_gen.cpp @@ -60,6 +60,8 @@ #include "llvm/llvm_to_gen.hpp" #include "sys/cvar.hpp" #include "sys/platform.hpp" +#include "ir/unit.hpp" +#include "ir/structural_analysis.hpp" #include @@ -244,6 +246,16 @@ namespace gbe #endif passes.run(mod); + const ir::Unit::FunctionSet& fs = unit.getFunctionSet(); + ir::Unit::FunctionSet::const_iterator iter = fs.begin(); + while(iter != fs.end()) + { + analysis::ControlTree *ct = new analysis::ControlTree(iter->second); + ct->analyze(); + delete ct; + iter++; + } + return true; } } /* namespace gbe */