Commit 92ddf834 authored by 李晓奇's avatar 李晓奇

can pass loop3

parent 0f5a162d
# Lab4 实验文档 # Lab4 实验文档
- [Lab4 实验文档](#lab4-实验文档) - [Lab4 实验文档](#lab4-实验文档)
- [0. 前言](#0-前言) - [0. 前言](#0-前言)
- [1. GVN 基础知识](#1-gvn-基础知识) - [1. GVN 基础知识](#1-gvn-基础知识)
- [1.1 GVN 简介](#11-gvn-简介) - [1.1 GVN 简介](#11-gvn-简介)
- [1.2 GVN 相关概念](#12-gvn-相关概念) - [1.2 GVN 相关概念](#12-gvn-相关概念)
- [1. IR 假设](#1-ir-假设) - [1. IR 假设](#1-ir-假设)
...@@ -14,8 +17,11 @@ ...@@ -14,8 +17,11 @@
- [7. Join 操作](#7-join-操作) - [7. Join 操作](#7-join-操作)
- [8. 变量等价与表达式等价](#8-变量等价与表达式等价) - [8. 变量等价与表达式等价](#8-变量等价与表达式等价)
- [9. Transfer Function](#9-transfer-function) - [9. Transfer Function](#9-transfer-function)
- [2. GVN 算法(论文中提供的伪代码)](#2-gvn-算法论文中提供的伪代码) - [2. GVN 算法(论文中提供的伪代码)](#2-gvn-算法论文中提供的伪代码)
- [3. 实验内容](#3-实验内容) - [3. 实验内容](#3-实验内容)
- [3.1 GVN pass 实现内容要求](#31-gvn-pass-实现内容要求) - [3.1 GVN pass 实现内容要求](#31-gvn-pass-实现内容要求)
- [3.2 GVN 辅助类](#32-gvn-辅助类) - [3.2 GVN 辅助类](#32-gvn-辅助类)
- [3.3 注册及运行 GVN Pass](#33-注册及运行-gvn-pass) - [3.3 注册及运行 GVN Pass](#33-注册及运行-gvn-pass)
...@@ -23,8 +29,11 @@ ...@@ -23,8 +29,11 @@
- [运行 Pass](#运行-pass) - [运行 Pass](#运行-pass)
- [3.3 自动测试](#33-自动测试) - [3.3 自动测试](#33-自动测试)
- [3.4 Tips](#34-tips) - [3.4 Tips](#34-tips)
- [4. 提交要求](#4-提交要求) - [4. 提交要求](#4-提交要求)
- [目录结构](#目录结构) - [目录结构](#目录结构)
- [提交要求和评分标准](#提交要求和评分标准) - [提交要求和评分标准](#提交要求和评分标准)
## 0. 前言 ## 0. 前言
......
This diff is collapsed.
[{
"function": "main",
"pout": {"label_entry": [["%op0", ], ["%op1", ], ["%op2", "%op3", ], ],}},]
\ No newline at end of file
...@@ -263,9 +263,7 @@ GVN::intersect(shared_ptr<CongruenceClass> ci, shared_ptr<CongruenceClass> cj) { ...@@ -263,9 +263,7 @@ GVN::intersect(shared_ptr<CongruenceClass> ci, shared_ptr<CongruenceClass> cj) {
if (c->members_.size()) // not empty if (c->members_.size()) // not empty
{ {
if (c->index_ == 0) { if (c->index_ == 0) {
// it must be a phi instruction // we should use the `index` int the previous block
// and be separated to 2 copy statement
// we should use the copy-stmt int the previous block
auto instr = static_cast<Instruction *>(*c->members_.begin()); auto instr = static_cast<Instruction *>(*c->members_.begin());
auto instr_phi = dynamic_cast<PhiInst *>(instr); auto instr_phi = dynamic_cast<PhiInst *>(instr);
int exact_idx; int exact_idx;
...@@ -570,7 +568,6 @@ GVN::transferFunction(Instruction *instr, Value *e, partitions pin) { ...@@ -570,7 +568,6 @@ GVN::transferFunction(Instruction *instr, Value *e, partitions pin) {
} }
// TODO: get different ValueExpr by Instruction::OpID, modify pout // TODO: get different ValueExpr by Instruction::OpID, modify pout
// ??
// get ve and vpf // get ve and vpf
shared_ptr<Expression> ve; shared_ptr<Expression> ve;
if (e) { if (e) {
......
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