Commit bb6e3f98 authored by 李晓奇's avatar 李晓奇

pass all!

parent f1600373
...@@ -985,11 +985,12 @@ GVN::pretend_copy_stmt(Instruction *instr, BasicBlock *bb) { ...@@ -985,11 +985,12 @@ GVN::pretend_copy_stmt(Instruction *instr, BasicBlock *bb) {
auto phi = static_cast<PhiInst *>(instr); auto phi = static_cast<PhiInst *>(instr);
// res = phi [op1, name1], [op2, name2] // res = phi [op1, name1], [op2, name2]
// ^0 ^1 ^2 ^3 // ^0 ^1 ^2 ^3
if (phi->get_operand(1)->get_name() == bb->get_name()) { // if (phi->get_operand(1)->get_name() == bb->get_name()) {
if (static_cast<BasicBlock*>(phi->get_operand(1)) == bb) {
// pretend copy statement: // pretend copy statement:
// `res = op1` // `res = op1`
return 0; return 0;
} else if (phi->get_operand(3)->get_name() == bb->get_name()) { } else if (static_cast<BasicBlock*>(phi->get_operand(3)) == bb) {
// `res = op2` // `res = op2`
return 2; return 2;
} }
......
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