Commit 864f2a42 authored by 刘睿博's avatar 刘睿博 🎯

add TODO

parent 06f81e55
...@@ -43,10 +43,12 @@ void LoopInvariantCodeMotion::traverse_loop(std::shared_ptr<Loop> loop) { ...@@ -43,10 +43,12 @@ void LoopInvariantCodeMotion::traverse_loop(std::shared_ptr<Loop> loop) {
} }
run_on_loop(loop); run_on_loop(loop);
} }
// 1. 遍历当前循环及其子循环的所有指令
// 2. 收集所有指令到loop_instructions中 // TODO: 实现collect_loop_info函数
// 3. 检查store指令是否修改了全局变量,如果是则添加到updated_global中 // 1. 遍历当前循环及其子循环的所有指令
// 4. 检查是否包含非纯函数调用,如果有则设置contains_impure_call为true // 2. 收集所有指令到loop_instructions中
// 3. 检查store指令是否修改了全局变量,如果是则添加到updated_global中
// 4. 检查是否包含非纯函数调用,如果有则设置contains_impure_call为true
void LoopInvariantCodeMotion::collect_loop_info( void LoopInvariantCodeMotion::collect_loop_info(
std::shared_ptr<Loop> loop, std::shared_ptr<Loop> loop,
std::set<Value *> &loop_instructions, std::set<Value *> &loop_instructions,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment