name
string
code
string
asm
string
file
string
optimization::common_expr_del::BlockNodes::add_leaf_node(mir::inst::Value)
NodeId add_leaf_node(mir::inst::Value val) { auto id = nodes.size(); NodeId nodeId(id); auto node = std::make_shared<Node>(); node->value = val; if (val.index() == 1) { var_map[std::get<mir::inst::VarId>(val)] = nodeId; } nodes.push_back(node); node_map[*node] = id; return node...
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rsi, %r15 movq %rdi, %r14 movq 0x10(%rdi), %rbx subq 0x8(%rdi), %rbx leaq 0x10(%rsp), %rdi movq $0x0, -0x8(%rdi) leaq 0x8(%rsp), %r12 leaq 0x7(%rsp), %rdx movq %r12, %rsi callq 0x2ed32 movq (%r12), %rdi addq $0x78, %rdi movq %r15, %rsi callq 0x2ecb2 shr...
/segviol[P]indigo/backend/optimization/common_expression_delete.hpp
optimization::common_expr_del::BlockNodes::export_insts(mir::inst::BasicBlk&)
void export_insts(mir::inst::BasicBlk& block) { auto& inst = block.inst; for (auto iter = nodes.begin(); iter != nodes.end(); ++iter) { iter->get()->init_main_var(); } while (added.size() < nodes.size()) { for (int i = nodes.size() - 1; i >= 0; --i) { exportNode(i); } } ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x328, %rsp # imm = 0x328 movq %rsi, %r12 movq %rdi, %r15 movq 0x8(%rdi), %rbx cmpq 0x10(%rdi), %rbx je 0x2ace5 movq (%rbx), %rdi callq 0x2ee88 addq $0x10, %rbx cmpq 0x10(%r15), %rbx jne 0x2acb7 jmp 0x2ace5 movl %r14d, %eax decl %eax js ...
/segviol[P]indigo/backend/optimization/common_expression_delete.hpp
optimization::common_expr_del::Node::Node(std::variant<mir::inst::Op, optimization::common_expr_del::ExtraNormOp, optimization::common_expr_del::InNormOp>, std::vector<std::variant<int, optimization::common_expr_del::NodeId, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator...
Node(Op op, std::vector<Operand> operands) : op(op), operands(operands), is_leaf(false) { // if (op.index() == 1 && std::get<ExtraNormOp>(op) == ExtraNormOp::Ref) { // assert(operands.size() == 1); // } }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %r14 movq %rdi, %rbx movq %rdx, %rsi callq 0x2a73e movq %r14, 0x18(%rbx) xorl %eax, %eax movl %eax, 0x30(%rbx) movb %al, 0x40(%rbx) leaq 0xc2eaf(%rip), %rcx # 0xeffb8 addq $0x10, %rcx movq %rcx, 0x28(%rbx) movw $0x1, 0x41(%rbx) leaq 0x48(%rbx), %rcx movq %rcx, 0x50(%rbx) ...
/segviol[P]indigo/backend/optimization/common_expression_delete.hpp
optimization::common_expr_del::Node::operator<(optimization::common_expr_del::Node const&) const
bool operator<(const Node& other) const { if (is_leaf != other.is_leaf) { return is_leaf < other.is_leaf; } if (op.index() != other.op.index()) { return op.index() < other.op.index(); } // same kind op if (op.index() == 0) { if (std::get<NormOp>(op) != std::get<NormOp>(other.op...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movb 0xf8(%rsi), %al cmpb %al, 0xf8(%rdi) jne 0x2d329 movq %rsi, %rbx movq %rdi, %r14 movzbl 0x1c(%rdi), %eax movb 0x1c(%rsi), %cl cmpb %cl, %al jne 0x2d327 leaq 0x18(%r14), %r12 leaq 0x18(%rbx), %r15 movq %r12, %rdi cmpl $0x1, %eax je 0...
/segviol[P]indigo/backend/optimization/common_expression_delete.hpp
optimization::common_expr_del::Node::Node()
Node() : is_leaf(true) {}
xorl %eax, %eax movl %eax, 0x30(%rdi) movb %al, 0x40(%rdi) xorps %xmm0, %xmm0 movups %xmm0, (%rdi) movups %xmm0, 0xd(%rdi) leaq 0xc1201(%rip), %rcx # 0xeffb8 addq $0x10, %rcx movq %rcx, 0x28(%rdi) movw $0x1, 0x41(%rdi) leaq 0x48(%rdi), %rcx movq %rcx, 0x50(%rdi) movq %rcx, 0x48(%rdi) movq %rax, 0x58(%rdi) leaq 0x60...
/segviol[P]indigo/backend/optimization/common_expression_delete.hpp
optimization::common_expr_del::Node::init_main_var()
void init_main_var() { if (value.has_value() // && value->index() == 0 || // value.has_value() && value->index() == 1 && // std::get<mir::inst::VarId>(value.value()).id > 10000 ) { mainVar = value.value(); } else { for (auto var : live_vars) { if (!env...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rdi, %rbx cmpb $0x1, 0x98(%rdi) jne 0x2eed8 leaq 0x30(%rbx), %rax leaq 0x80(%rbx), %rsi leaq 0x8(%rsp), %rdi movq %rax, (%rdi) movsbq 0x90(%rbx), %rax leaq 0xbf734(%rip), %rcx # 0xee5f8 callq *0x8(%rcx,%rax,8) movzwl 0x91(%rbx)...
/segviol[P]indigo/backend/optimization/common_expression_delete.hpp
optimization::common_expr_del::BlockNodes::exportNode(unsigned int)
bool exportNode(uint32_t idx) { if (added.count(idx)) { return false; } bool flag = false; auto parents = nodes[idx]->parents; for (auto nodeId : parents) { if (!added.count(nodeId.id)) { flag = true; } } if (flag) { return false; } exportQueue.push_ba...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rdi, %rbx movl %esi, 0x4(%rsp) movq 0xa0(%rdi), %rcx leaq 0x98(%rdi), %r15 movq %r15, %rax testq %rcx, %rcx je 0x2f0c6 movq %r15, %rax xorl %edx, %edx cmpl %esi, 0x20(%rcx) setb %dl cmovaeq %rcx, %rax movq 0x10(%rcx,%rdx,8), %rcx t...
/segviol[P]indigo/backend/optimization/common_expression_delete.hpp
optimization::common_expr_del::BlockNodes::convert_operand_to_value(std::variant<int, optimization::common_expr_del::NodeId, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
mir::inst::Value convert_operand_to_value(Operand operand) { if (operand.index() == 0) { auto imm = std::get<int>(operand); return imm; } else { auto nodeId = std::get<NodeId>(operand); return nodes[nodeId.id]->mainVar; } }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx cmpb $0x0, 0x20(%rdx) je 0x2f25e movq %rsi, %r14 movq %rdx, %rdi callq 0x2da02 movl (%rax), %eax movq 0x8(%r14), %rcx shlq $0x4, %rax movq (%rcx,%rax), %r14 leaq 0x8(%rbx), %rax leaq 0x30(%r14), %rsi movb $-0x1, 0x18(%rbx) movb 0x40(%r14), %cl movb %cl, 0x18(%rbx) movq %...
/segviol[P]indigo/backend/optimization/common_expression_delete.hpp
mir::inst::LoadOffsetInst::LoadOffsetInst(mir::inst::Value, mir::inst::VarId, mir::inst::Value)
LoadOffsetInst(Value src, VarId dest, Value offset = 0) : src(src), Inst(dest), offset(offset) {}
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rcx, %rbx movq %rsi, %r15 movq %rdi, %r14 movl 0x8(%rdx), %eax leaq 0xbe4d8(%rip), %rcx # 0xee058 movq %rcx, 0x8(%rdi) movl %eax, 0x10(%rdi) leaq 0xc06ba(%rip), %rax # 0xf0248 addq $0x10, %rax movq %rax, (%rdi) leaq 0x20(%rdi), %...
/segviol[P]indigo/backend/../mir/mir.hpp
optimization::global_expr_move::Global_Expr_Mov::pass_name[abi:cxx11]() const
std::string pass_name() const { return name; }
pushq %rbx movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) movq 0x10(%rsi), %rax movq 0x18(%rsi), %rdx addq %rax, %rdx movq %rax, %rsi callq 0x18456 movq %rbx, %rax popq %rbx retq nop
/segviol[P]indigo/backend/optimization/global_expression_move.hpp
optimization::global_expr_move::Global_Expr_Mov::optimize_func(mir::inst::MirFunction&)
void optimize_func(mir::inst::MirFunction& func) { if (func.type->is_extern) { return; } auto& startblk = func.basic_blks.begin()->second; for (auto& blkpair : func.basic_blks) { auto& blk = blkpair.second; for (auto iter = blkpair.second.inst.begin(); iter != blkpair.secon...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x4b8, %rsp # imm = 0x4B8 movq %rdi, 0x60(%rsp) movq 0x28(%rsi), %rax cmpb $0x0, 0x30(%rax) jne 0x313f5 movq 0x80(%rsi), %rbp movq %rsi, 0x110(%rsp) leaq 0x70(%rsi), %rax movq %rax, 0x1b0(%rsp) cmpq %rax, %rbp je 0x3028b movq 0x110(%rsp)...
/segviol[P]indigo/backend/optimization/global_expression_move.hpp
optimization::global_expr_move::Global_Expr_Mov::bfs(int, std::variant<optimization::global_expr_move::Op, std::pair<std::pair<mir::inst::VarId, mir::inst::Value>, mir::inst::VarId>>)
mir::types::LabelId bfs(int start, std::variant<Op, LoadOp> op) { auto prec = env->func.basic_blks.at(start).preceding; if (prec.size() == 0) { return start; } std::set<mir::types::LabelId> res; if (prec.size() == 1) { auto p = bfs(*prec.begin(), op); if (env->blk_op_map.at(p).has_...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x258, %rsp # imm = 0x258 movq %rdx, 0x8(%rsp) movq %rdi, 0x18(%rsp) leaq 0x14(%rsp), %rax movl %esi, (%rax) movq 0xbff29(%rip), %rcx # 0xf14e0 movq (%rcx), %rdi addq $0x68, %rdi movq %rax, %rsi callq 0x2066a leaq 0x10(%rax), %rsi le...
/segviol[P]indigo/backend/optimization/global_expression_move.hpp
optimization::global_expr_move::BlockOps::BlockOps(mir::inst::BasicBlk&, bool)
BlockOps(mir::inst::BasicBlk& blk, bool offset = false) { for (auto& inst : blk.inst) { auto& i = *inst; if (inst->inst_kind() == mir::inst::InstKind::Op) { auto opInst = dynamic_cast<mir::inst::OpInst*>(&i); ops.insert({Op(opInst->op, opInst->lhs, opInst->rhs), opInst->dest}); } e...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x128, %rsp # imm = 0x128 movl %edx, 0x24(%rsp) leaq 0x30(%rdi), %rax movq %rax, (%rdi) movq $0x1, 0x8(%rdi) xorps %xmm0, %xmm0 movups %xmm0, 0x10(%rdi) movl $0x3f800000, 0x20(%rdi) # imm = 0x3F800000 movups %xmm0, 0x28(%rdi) leaq 0x40(%...
/segviol[P]indigo/backend/optimization/global_expression_move.hpp
optimization::global_expr_move::hasher::operator()(optimization::global_expr_move::Op const&) const
size_t operator()(const Op& p) const { int lhs = p.lhs.index() == 0 ? std::get<int>(p.lhs) : std::get<mir::inst::VarId>(p.lhs).id; int rhs = p.rhs.index() == 0 ? std::get<int>(p.rhs) : std::get<mir::inst::VarId>(p.rhs).id; return std::hash<i...
pushq %rbp pushq %rbx pushq %rax movq %rsi, %rbx leaq 0x10(%rsi), %rdi cmpb $0x0, 0x20(%rsi) je 0x32887 callq 0x32916 addq $0x8, %rax jmp 0x3288c callq 0x328b4 movl (%rax), %ebp leaq 0x30(%rbx), %rdi cmpb $0x0, 0x40(%rbx) je 0x328a3 callq 0x32916 addq $0x8, %rax jmp 0x328a8 callq 0x328b4 xorl (%rax), %ebp movslq %ebp, ...
/segviol[P]indigo/backend/optimization/global_expression_move.hpp
optimization::global_expr_move::BlockOps::has_op(std::variant<optimization::global_expr_move::Op, std::pair<std::pair<mir::inst::VarId, mir::inst::Value>, mir::inst::VarId>>)
bool has_op(std::variant<Op, LoadOp> op) { // for (auto& op : ops) { // auto opInst = // mir::inst::OpInst(mir::inst::VarId(0), op.lhs, op.rhs, op.op); // std::cout << opInst << std::endl; // } if (disable_op(op)) { return false; } if (op.index() == 0) { return ops....
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x98, %rsp movq %rsi, %r14 movq %rdi, %rbx leaq 0x48(%rsp), %r15 movb $-0x1, 0x48(%r15) movsbq 0x48(%rsi), %rax movb %al, 0x48(%r15) leaq 0x8(%rsp), %rdi movq %r15, (%rdi) leaq 0xbb540(%rip), %rcx # 0xee6c0 callq *0x8(%rcx,%rax,8) movq %rbx, %rdi movq %r15, %rsi cal...
/segviol[P]indigo/backend/optimization/global_expression_move.hpp
optimization::global_expr_move::BlockOps::disable_op(std::variant<optimization::global_expr_move::Op, std::pair<std::pair<mir::inst::VarId, mir::inst::Value>, mir::inst::VarId>>)
bool disable_op(std::variant<Op, LoadOp> op) { if (op.index() == 0) { return false; } else { auto load = std::get<LoadOp>(op); return stores.count(load.first.first); } }
cmpb $0x0, 0x48(%rsi) je 0x335ee pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x48, %rsp movq %rdi, %rbx movq %rsi, %rdi callq 0x33946 movq %rax, %r14 leaq 0xbab24(%rip), %r15 # 0xee058 leaq 0x20(%rsp), %r12 movq %r15, -0x18(%r12) movl 0x8(%rax), %eax movl %eax, -0x10(%r12) leaq 0x18(%r14), %rsi movb $-0x1, 0x...
/segviol[P]indigo/backend/optimization/global_expression_move.hpp
optimization::memvar_propagation::Memory_Var_Propagation::pass_name[abi:cxx11]() const
std::string pass_name() const { return name; }
pushq %rbx movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) movq 0x8(%rsi), %rax movq 0x10(%rsi), %rdx addq %rax, %rdx movq %rax, %rsi callq 0x18456 movq %rbx, %rax popq %rbx retq nop
/segviol[P]indigo/backend/optimization/memvar_propagation.hpp
optimization::memvar_propagation::Dest::operator==(optimization::memvar_propagation::Dest const&) const
bool operator<(const VarId& other) const { return id < other.id; }
movl 0x8(%rdi), %ecx cmpl 0x8(%rsi), %ecx jne 0x38096 pushq %rbp pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %rax addq $0x18, %rdi cmpb $0x0, 0x28(%rax) movb 0x28(%rsi), %al je 0x38099 cmpb $0x1, %al jne 0x3809d addq $0x18, %rbx callq 0x32916 movq %rax, %r14 movq %rbx, %rdi callq 0x32916 movl 0x8(%r14), %ecx cmpl ...
/segviol[P]indigo/backend/../mir/mir.hpp
optimization::const_merge::Merge_Const::pass_name[abi:cxx11]() const
std::string pass_name() const { return name; }
pushq %rbx movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) movq 0x38(%rsi), %rax movq 0x40(%rsi), %rdx addq %rax, %rdx movq %rax, %rsi callq 0x18456 movq %rbx, %rax popq %rbx retq nop
/segviol[P]indigo/backend/optimization/const_merge.hpp
optimization::const_merge::Merge_Const::optimize_mir(mir::inst::MirPackage&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<c...
void optimize_mir(mir::inst::MirPackage& package, std::map<std::string, std::any>& extra_data_repo) { for (auto iter = package.functions.begin(); iter != package.functions.end(); iter++) { optimize_func(iter->second); } }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq 0x20(%rsi), %r15 addq $0x10, %rbx cmpq %rbx, %r15 je 0x38b60 movq %rdi, %r14 leaq 0x40(%r15), %rsi movq %r14, %rdi callq 0x38bd8 movq %r15, %rdi callq 0xc260 movq %rax, %r15 cmpq %rbx, %rax jne 0x38b44 popq %rbx popq %r14 popq %r15 retq
/segviol[P]indigo/backend/optimization/const_merge.hpp
optimization::const_merge::Env::add_usepoint(mir::inst::VarId, int, int)
void add_usepoint(mir::inst::VarId var, mir::types::LabelId labelId, int idx) { if (!usepoints.count(var)) { usepoints.insert( {var, std::vector<std::pair<mir::types::LabelId, int>>()}); } usepoints.at(var).push_back({labelId, idx}); }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x28, %rsp movl %ecx, %ebx movl %edx, %ebp movq %rsi, %r14 movq %rdi, %r15 addq $0x8, %r15 movq %r15, %rdi callq 0x207b4 testq %rax, %rax jne 0x391b7 leaq 0xb4edc(%rip), %rax # 0xee058 movq %rsp, %rsi movq %rax, (%rsi) movl 0x8(%r14), %eax movl %eax, 0x8(%rsi) xorps...
/segviol[P]indigo/backend/optimization/const_merge.hpp
optimization::const_merge::Env::get_inst(std::pair<int, int>)
std::unique_ptr<mir::inst::Inst>& get_inst( std::pair<mir::types::LabelId, int> pair) { return func.basic_blks.at(pair.first).inst.at(pair.second); }
pushq %rbx subq $0x10, %rsp leaq 0x8(%rsp), %rbx movq %rsi, (%rbx) movq (%rdi), %rdi addq $0x68, %rdi movq %rbx, %rsi callq 0x2066a movslq 0x4(%rbx), %rsi movq 0x40(%rax), %rcx movq 0x48(%rax), %rdx subq %rcx, %rdx sarq $0x3, %rdx cmpq %rsi, %rdx jbe 0x3942a leaq (%rcx,%rsi,8), %rax addq $0x10, %rsp popq %rbx retq leaq...
/segviol[P]indigo/backend/optimization/const_merge.hpp
optimization::cast_inst::Cast_Inst::pass_name[abi:cxx11]() const
std::string pass_name() const { return name; }
pushq %rbx movq %rdi, %rbx leaq 0x10(%rdi), %rax movq %rax, (%rdi) movq 0x38(%rsi), %rax movq 0x40(%rsi), %rdx addq %rax, %rdx movq %rax, %rsi callq 0x18456 movq %rbx, %rax popq %rbx retq nop
/segviol[P]indigo/backend/optimization/cast_inst.hpp
optimization::algebraic_simplification::AlgebraicSimplification::optimize_mir(mir::inst::MirPackage&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std...
void optimize_mir(mir::inst::MirPackage& package, std::map<std::string, std::any>& extra_data_repo) { for (auto& i : package.functions) { if (!i.second.type->is_extern) { optimize_func(i.first, i.second); } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rsi, %rbx movq 0x20(%rsi), %r15 addq $0x10, %rbx cmpq %rbx, %r15 je 0x3a06a movq %rdi, %r14 leaq 0x18(%rsp), %rbp leaq 0x8(%rsp), %r12 movq 0x68(%r15), %rax cmpb $0x0, 0x30(%rax) jne 0x3a05a leaq 0x40(%r15), %r13 movq %rbp, 0x8(%rs...
/segviol[P]indigo/backend/optimization/algebraic_simplification.hpp
optimization::algebraic_simplification::AlgebraicSimplification::optimize_func(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, mir::inst::MirFunction&)
void optimize_func(std::string name, mir::inst::MirFunction& mirFunction) { for (auto blksIter = mirFunction.basic_blks.begin(); blksIter != mirFunction.basic_blks.end(); blksIter++) { for (size_t i = 0; i < blksIter->second.inst.size(); i++) { mir::inst::Inst* instIter = blksIter->second.ins...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq %rdi, 0x38(%rsp) movq 0x80(%rdx), %r15 movq %rdx, 0x80(%rsp) leaq 0x70(%rdx), %rax movq %rax, 0x90(%rsp) cmpq %rax, %r15 je 0x3a8e4 leaq 0xb5e81(%rip), %rax # 0xeffb8 addq $0x10, %rax movq %rax, 0x8(%rs...
/segviol[P]indigo/backend/optimization/algebraic_simplification.hpp
optimization::ref_count::Ref_Count::DFS(mir::inst::BasicBlk&, std::set<int, std::less<int>, std::allocator<int>>&, int, int)
void DFS(mir::inst::BasicBlk& startblk, std::set<mir::types::LabelId>& visited, int pri, int next_pri = -1) { if (visited.count(startblk.id)) { return; } for (auto& inst : startblk.inst) { for (auto var : inst->useVars()) { env->add_priority(var, pri); } env->add_p...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x98, %rsp movl %r8d, %r15d movl %ecx, %ebp movq %rdx, %rbx movq %rsi, %r12 movq %rdi, %r14 leaq 0x8(%rsi), %r13 movq %rdx, %rdi movq %r13, %rsi callq 0x21e0c testq %rax, %rax jne 0x3b8f7 movq %r13, 0x10(%rsp) movl %r15d, 0xc(%rsp) movq %r14, 0x20(...
/segviol[P]indigo/backend/optimization/ref_count.hpp
optimization::graph_color::Graph_Color::optimize_mir(mir::inst::MirPackage&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<c...
void optimize_mir(mir::inst::MirPackage& package, std::map<std::string, std::any>& extra_data_repo) { for (auto iter = package.functions.begin(); iter != package.functions.end(); iter++) { optimize_func(iter->first, iter->second); } extra_data_repo[name] = func_color_map; ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movq 0x20(%rsi), %r12 addq $0x10, %r15 cmpq %r15, %r12 je 0x3bb2d leaq 0x38(%rsp), %rbp leaq 0x28(%rsp), %r13 movq %rbp, 0x28(%rsp) movq 0x20(%r12), %rsi movq 0x28(%r12), %rdx addq %rsi, %r...
/segviol[P]indigo/backend/optimization/graph_color.hpp
optimization::graph_color::Graph_Color::optimize_func(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, mir::inst::MirFunction&)
void optimize_func(std::string funcId, mir::inst::MirFunction& func) { if (func.type->is_extern) { return; } LOG(TRACE) << "Running graph coloring for" << func.name << std::endl; std::set<mir::inst::VarId> cross_blk_vars; auto map = std::make_shared<Color_Map>(std::map<mir::inst::VarId, color>...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x338, %rsp # imm = 0x338 movq %rdi, 0xe0(%rsp) movq 0x28(%rdx), %rax cmpb $0x0, 0x30(%rax) jne 0x3db73 movq %rsi, %rbx movq %rdx, 0x120(%rsp) xorl %ebp, %ebp leaq 0x28(%rsp), %rdi movb %bpl, (%rdi) callq 0x16f7b leaq 0xb21e4(%rip), %rax...
/segviol[P]indigo/backend/optimization/graph_color.hpp
optimization::graph_color::Conflict_Map::Conflict_Map(std::shared_ptr<std::map<mir::inst::VarId, int, std::less<mir::inst::VarId>, std::allocator<std::pair<mir::inst::VarId const, int>>>>, mir::inst::MirFunction&, unsigned int)
Conflict_Map(std::shared_ptr<Color_Map> color_map, mir::inst::MirFunction& func, u_int color_num = 8) : color_num(color_num), color_map(color_map), func(func) { unused_colors = std::make_shared<std::set<int>>(); for (int i = 0; i < color_num; i++) { unused_colors->insert(i); } ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 movl %ecx, %ebp movq %rdx, %r12 movq %rsi, %r14 movq %rdi, %rbx leaq 0x8(%rdi), %rcx xorl %eax, %eax movl %eax, 0x8(%rdi) movq %rax, 0x10(%rdi) movq %rcx, 0x18(%rdi) movq %rcx, 0x20(%rdi) movq %rax, 0x28(%rdi) l...
/segviol[P]indigo/backend/optimization/graph_color.hpp
optimization::graph_color::Conflict_Map::remove_edge_less_colors()
void remove_edge_less_colors() { while (true) { if (!edge_vars.size()) { return; } auto min_edge_iter = edge_vars.begin(); auto min_edge = min_edge_iter->first; std::set<mir::inst::VarId> vars_to_remove; if (min_edge >= color_num) { return; } for (auto...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp cmpq $0x0, 0xe8(%rdi) je 0x3f46b movq %rdi, %rbx leaq 0x10(%rsp), %r13 leaq 0xc8(%rdi), %rbp leaq 0xaecbc(%rip), %r14 # 0xee058 leaq 0x38(%rsp), %r15 movq 0xd8(%rbx), %r12 movl 0x20(%r12), %ecx movl $0x0, 0x10(%rsp) xorl %eax, %eax m...
/segviol[P]indigo/backend/optimization/graph_color.hpp
optimization::graph_color::Conflict_Map::merge(mir::inst::VarId, mir::inst::VarId)
void merge(mir::inst::VarId var1, mir::inst::VarId var2) { if (!merged_Map.count(var2)) { merged_Map[var2] = std::set<mir::inst::VarId>(); } int priority = func.variables.at(var1.id).priority; if (merged_var_Map.count(var1)) { auto old_merged_var = merged_var_Map.at(var1); if (old_merg...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rdx, %r14 movq %rsi, %r12 movq %rdi, %r15 leaq 0x90(%rdi), %rbp movq %rbp, %rdi movq %rdx, %rsi callq 0x405e6 testq %rax, %rax jne 0x403e2 leaq 0x18(%rsp), %rbx xorps %xmm0, %xmm0 movaps %xmm0, 0x8(%rbx) movaps %xmm0, 0x18(%rbx) mo...
/segviol[P]indigo/backend/optimization/graph_color.hpp
optimization::graph_color::Conflict_Map::add_conflict(mir::inst::VarId, std::set<mir::inst::VarId, std::less<mir::inst::VarId>, std::allocator<mir::inst::VarId>>)
void add_conflict(mir::inst::VarId defVar, std::set<mir::inst::VarId> useVars) { if (merged_var_Map.count(defVar)) { defVar = merged_var_Map.at(defVar); } if (!static_Map.count(defVar)) { static_Map[defVar] = std::set<mir::inst::VarId>(); dynamic_Map[defVar] = std::set<...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbp leaq 0x60(%rdi), %r13 movq %r13, %rdi callq 0x40288 testq %rax, %rax je 0x412d0 movq %r13, %rdi movq %r14, %rsi callq 0x402d4 movl 0x8(%rax), %eax movl %eax, 0x8(%r14) movq %rbp, %rdi movq ...
/segviol[P]indigo/backend/optimization/graph_color.hpp
optimization::graph_color::Conflict_Map::available_color(std::set<mir::inst::VarId, std::less<mir::inst::VarId>, std::allocator<mir::inst::VarId>>&)
color available_color(std::set<mir::inst::VarId>& neighbors) { std::vector<bool> colors(color_num, true); for (auto var : neighbors) { colors[color_map->at(var)] = false; } for (int i = 0; i < color_num; i++) { if (colors[i]) { if (unused_colors->count(i)) { unused_colors->...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp movq %rsi, %r14 movq %rdi, %rbx movl 0x19c(%rdi), %esi leaq 0x10(%rsp), %rdx movb $0x1, (%rdx) leaq 0x20(%rsp), %rdi leaq 0xf(%rsp), %rcx callq 0x42a5a movq 0x18(%r14), %r15 addq $0x8, %r14 cmpq %r14, %r15 je 0x428b3 movabsq $-0x80000000...
/segviol[P]indigo/backend/optimization/graph_color.hpp
front::optimization::scalize_fake_var_array::ScalizeFakeVarArray::optimize_bmir(mir::inst::MirPackage&, front::optimization::bmir_variable_table::BmirVariableTable&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::variant<std::shared_ptr<mir::inst::Inst>, std::s...
virtual void optimize_bmir( mir::inst::MirPackage& package, bmir_variable_table::BmirVariableTable& bmirVariableTable, std::map<std::string, std::vector<irGenerator::Instruction>>& funcInsts, std::map<std::string, std::any>& messages) { for (auto& func : funcInsts) { optimize_functiom(...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rcx, %rbx movq %rdx, (%rsp) movq 0x18(%rcx), %r13 addq $0x8, %rbx cmpq %rbx, %r13 je 0x43e6d movq %rsi, %r15 movq %rdi, %r12 leaq 0x18(%rsp), %r14 leaq 0x8(%rsp), %rbp movq %r14, 0x8(%rsp) movq 0x20(%r13), %rsi movq 0x28(%r13), %rd...
/segviol[P]indigo/frontend/optimization/scalize_fake_var_array.hpp
front::optimization::scalize_fake_var_array::ScalizeFakeVarArray::optimize_functiom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, mir::inst::MirPackage&, front::optimization::bmir_variable_table::BmirVariableTable&, std::vector<std::variant<std::shared_ptr<mir::inst::Inst>, std::shared...
void optimize_functiom( std::string funcName, mir::inst::MirPackage& package, bmir_variable_table::BmirVariableTable& bmirVariableTable, std::vector<irGenerator::Instruction>& insts) { std::map<uint32_t, std::pair<std::string, uint32_t>> tmpVarId2Offset; std::map<uint32_t, std::string> tmpVarI...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1b8, %rsp # imm = 0x1B8 movq %rcx, 0x58(%rsp) leaq 0x120(%rsp), %r15 xorl %eax, %eax movl %eax, (%r15) movq %rax, 0x8(%r15) movq %r15, 0x10(%r15) movq %r15, 0x18(%r15) movq %rax, 0x20(%r15) leaq 0x190(%rsp), %rcx movl %eax, (%rcx) movq...
/segviol[P]indigo/frontend/optimization/scalize_fake_var_array.hpp
argparse::Argument::Argument<1ul, 0ul>(std::basic_string_view<char, std::char_traits<char>> (&&) [1ul], std::integer_sequence<unsigned long, 0ul>)
explicit Argument(std::string_view(&&a)[N], std::index_sequence<I...>) : mIsOptional((is_optional(a[I]) || ...)), mIsRequired(false), mIsUsed(false) { ((void)mNames.emplace_back(a[I]), ...); std::sort( mNames.begin(), mNames.end(), [](const auto &lhs, const auto &rhs) { return lh...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %rsi, %rbp movq %rdi, %rbx leaq 0x38(%rdi), %r15 xorps %xmm0, %xmm0 movups %xmm0, 0x10(%rdi) movups %xmm0, (%rdi) xorl %eax, %eax movq %rax, 0x20(%rdi) movq %r15, 0x28(%rdi) movq %rax, 0x30(%rdi) movb %al, 0x38(%rdi) leaq 0x48(%rdi)...
/segviol[P]indigo/include/argparse/argparse.hpp
AixLog::Log::~Log()
virtual ~Log() { sync(); }
pushq %rbx movq %rdi, %rbx leaq 0xa7c8d(%rip), %rax # 0xeebd8 movq %rax, (%rdi) callq 0x47068 leaq 0x130(%rbx), %rdi callq 0x46d2c leaq 0xb8(%rbx), %rdi callq 0x17518 leaq 0xa6f6e(%rip), %rax # 0xedee0 movq %rax, 0x88(%rbx) movq 0x90(%rbx), %rdi leaq 0xa0(%rbx), %rax cmpq %rax, %rdi je 0x46f97 movq (%rax), %rsi...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
AixLog::Log::sync()
int sync() override { std::lock_guard<std::recursive_mutex> lock(mutex_); if (!get_stream().str().empty()) { if (conditional_.is_true()) { for (const auto& sink : log_sinks_) { if (sink->filter.match(metadata_)) sink->log(metadata_, get_stream().str()); } } ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rdi, %r14 leaq 0x148(%rdi), %r12 movq %r12, %rdi callq 0xc520 testl %eax, %eax jne 0x471e2 movq %r14, %rdi callq 0x472b2 addq $0x18, %rax movq %rsp, %rdi movq %rax, %rsi callq 0xc590 leaq 0x10(%rsp), %rax movq -0x10(%rax), %rdi mov...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
AixLog::Filter::match(AixLog::Metadata const&) const
static std::ostream& operator<<(std::ostream& os, const Timestamp& timestamp) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.timestamp = timestamp; } else if (timestamp) { os << timestamp.to_string(); } ret...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp cmpq $0x0, 0x28(%rdi) je 0x47324 movq %rsi, %rbx movq %rdi, %r15 addq $0x8, %rsi callq 0x476d0 leaq 0x8(%r15), %r12 cmpq %r12, %rax je 0x47328 movq %rax, %r14 jmp 0x4738a movb $0x1, %al jmp 0x47393 leaq 0xa6bb1(%rip), %rbp # 0xedee0 ...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
AixLog::Filter::add_filter(AixLog::Severity)
void add_filter(Severity severity) { tag_filter_["*"] = severity; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x38, %rsp movl %esi, %ebx movq %rdi, %r14 leaq 0xa6543(%rip), %r12 # 0xedee0 leaq 0x10(%rsp), %rdi movq %r12, -0x8(%rdi) leaq 0x20(%rsp), %r15 movq %r15, -0x10(%r15) leaq 0x74b70(%rip), %rsi # 0xbc526 leaq 0x74b6a(%rip), %rdx # 0xbc527 callq 0x1ae2c movb $0...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
AixLog::SinkCout::~SinkCout()
SinkCout(const Filter& filter, const std::string& format = "%Y-%m-%d %H-%M-%S.#ms [#severity] (#tag_func)") : SinkFormat(filter, format) {}
pushq %rbx movq %rdi, %rbx leaq 0xa6dc5(%rip), %rax # 0xeed20 movq %rax, (%rdi) movq 0x38(%rdi), %rdi leaq 0x48(%rbx), %rax cmpq %rax, %rdi je 0x47f76 movq (%rax), %rsi incq %rsi callq 0xc3d0 leaq 0xa6ddb(%rip), %rax # 0xeed58 movq %rax, (%rbx) leaq 0x8(%rbx), %rdi callq 0x47e58 movl $0x58, %esi movq %rbx, %rdi...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
AixLog::Log::add_logsink(std::shared_ptr<AixLog::Sink> const&)
void add_logsink(const log_sink_ptr& sink) { std::lock_guard<std::recursive_mutex> lock(mutex_); log_sinks_.push_back(sink); }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %r14 movq %rdi, %r15 leaq 0x148(%rdi), %rbx movq %rbx, %rdi callq 0xc520 testl %eax, %eax jne 0x489f7 addq $0x130, %r15 # imm = 0x130 movq %r15, %rdi movq %r14, %rsi callq 0x48a12 movq %rbx, %rdi popq %rbx popq %r14 popq %r15 jmp 0xc2d0 movl %eax, %edi callq 0xc230...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
backend::Backend::should_run_pass(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool Backend::should_run_pass(std::string& pass_name) { if (options.run_pass && (options.run_pass->find(pass_name) == options.run_pass->end())) { return false; } else { if (options.skip_pass.find(pass_name) != options.skip_pass.end()) { return false; } else { return true; } } }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %r14 movq %rdi, %rbx movq 0x60(%rdi), %rdi cmpb $0x1, 0x78(%rdi) jne 0x49137 addq $0x48, %rdi movq %r14, %rsi callq 0x3750e movq 0x60(%rbx), %rcx addq $0x50, %rcx cmpq %rcx, %rax je 0x4915e movq 0x60(%rbx), %rdi subq $-0x80, %rdi movq %r14, %rsi callq 0x3750e movl $0x88, %ecx...
/segviol[P]indigo/backend/backend.cpp
AixLog::operator<<(std::ostream&, AixLog::Timestamp const&)
static std::ostream& operator<<(std::ostream& os, const Timestamp& timestamp) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.timestamp = timestamp; } else if (timestamp) { os << timestamp.to_string(); } ret...
pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rdi, %rbx movq 0xa738f(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x49bc7 movq 0xa741c(%rip), %rsi # 0xf0fd0 leaq 0xa42cd(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %...
/segviol[P]indigo/backend/../include/aixlog.hpp
backend::Backend::do_mir_to_arm_transform()
void Backend::do_mir_to_arm_transform() { LOG(INFO) << ("Doing mir->arm transform\n"); auto code = arm::ArmCode(); for (auto& f : package.functions) { if (f.second.type->is_extern) continue; auto cg = codegen::Codegen(f.second, package, extra_data, options.allow_conditiona...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x368, %rsp # imm = 0x368 movq %rdi, 0x28(%rsp) leaq 0x128(%rsp), %rdi movb $0x2, (%rdi) callq 0x49d9c leaq 0xa344d(%rip), %r14 # 0xedee0 leaq 0xb8(%rsp), %rax movq %r14, -0x18(%rax) movq %rax, -0x10(%rax) movq $0x0, -0x8(%rax) movb ...
/segviol[P]indigo/backend/backend.cpp
arm::Function::~Function()
Function(std::string& name, std::shared_ptr<mir::types::FunctionTy> ty, std::vector<std::unique_ptr<Inst>>&& inst, std::map<std::string, ConstValue>&& local_const, uint32_t stack_size) : name(name), ty(ty), inst(std::move(inst)), local_const(std::move(local_const)), ...
pushq %rbx movq %rdi, %rbx movq 0x80(%rdi), %rdi testq %rdi, %rdi je 0x4cbfd callq 0x17e2e leaq 0x40(%rbx), %rdi callq 0x1894e leaq 0x28(%rbx), %rdi callq 0x1969e movq 0x8(%rbx), %rdi addq $0x18, %rbx cmpq %rbx, %rdi je 0x4cc28 movq (%rbx), %rsi incq %rsi popq %rbx jmp 0xc3d0 popq %rbx retq
/segviol[P]indigo/backend/../arm_code/arm.hpp
backend::codegen::Codegen::~Codegen()
Codegen(mir::inst::MirFunction& func, mir::inst::MirPackage& package, std::map<std::string, std::any>& extra_data, bool enable_cond_exec = true) : func(func), package(package), extra_data(extra_data), inst(), reg_map(), fixed_vars(), var_collapse...
pushq %rbx movq %rdi, %rbx addq $0x1b8, %rdi # imm = 0x1B8 callq 0x4e06a movq 0x1a0(%rbx), %rdi testq %rdi, %rdi je 0x4cc55 movq 0x1b0(%rbx), %rsi subq %rdi, %rsi callq 0xc3d0 leaq 0x170(%rbx), %rdi callq 0x1dc38 leaq 0x138(%rbx), %rdi callq 0x4e07e leaq 0x100(%rbx), %rdi callq 0x4e07e leaq 0xc8(%rbx), %rdi ...
/segviol[P]indigo/backend/codegen/codegen.hpp
arm::Operand2::operator==(arm::Operand2 const&) const
bool operator==(const Operand2& other) const { auto this_ = dynamic_cast<const std::variant<RegisterOperand, int32_t>&>(*this); auto other_ = dynamic_cast<const std::variant<RegisterOperand, int32_t>&>(other); return this_ == other_; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x48, %rsp movq %rsi, %rbx movb $-0x1, %bpl leaq 0x30(%rsp), %r12 movb %bpl, 0x10(%r12) movsbq 0x18(%rdi), %rax leaq 0x8(%rdi), %rsi movb %al, 0x10(%r12) leaq 0x18(%rsp), %r14 movq %r12, (%r14) leaq 0xa0243(%rip), %r13 # 0xeee40 movq %r14, %rdi...
/segviol[P]indigo/backend/optimization/../../arm_code/arm.hpp
optimization::loop_expand::Const_Loop_Expand::optimize_mir(mir::inst::MirPackage&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_st...
void Const_Loop_Expand::optimize_mir( mir::inst::MirPackage& mir, std::map<std::string, std::any>& extra_data_repo) { for (auto& f : mir.functions) { if (f.second.type->is_extern || f.first == "$$5_main") continue; optimize_func(f.second); } }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq 0x20(%rsi), %r14 addq $0x10, %rbx cmpq %rbx, %r14 je 0x4fafb leaq 0x6ada4(%rip), %r15 # 0xba86c movq 0x68(%r14), %rax cmpb $0x0, 0x30(%rax) jne 0x4faeb leaq 0x20(%r14), %rdi movq %r15, %rsi callq 0xc0d0 testl %eax, %eax je 0x4faeb leaq 0x40(%r14), %rsi callq 0x4...
/segviol[P]indigo/backend/optimization/const_loop_expand.cpp
AixLog::operator<<(std::ostream&, AixLog::Function const&)
static std::ostream& operator<<(std::ostream& os, const Function& function) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.function = function; } else if (function) { os << function.name; } return os; }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movq 0x9f827(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x5172f movq 0x9f8b4(%rip), %rsi # 0xf0fd0 leaq 0x9c765(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %r14 jmp 0x51732 x...
/segviol[P]indigo/backend/optimization/../../include/aixlog.hpp
AixLog::operator<<(std::ostream&, AixLog::Timestamp const&)
static std::ostream& operator<<(std::ostream& os, const Timestamp& timestamp) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.timestamp = timestamp; } else if (timestamp) { os << timestamp.to_string(); } ret...
pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rdi, %rbx movq 0x9f74a(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x5180c movq 0x9f7d7(%rip), %rsi # 0xf0fd0 leaq 0x9c688(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %...
/segviol[P]indigo/backend/optimization/../../include/aixlog.hpp
optimization::loop_expand::loop_info::operator<(optimization::loop_expand::loop_info const&) const
bool operator<(const loop_info& other) const { switch (in_op) { case mir::inst::Op::Eq: return init_var.second == other.in_value; case mir::inst::Op::Neq: return init_var.second != other.in_value; case mir::inst::Op::Lt: return init_var.second < other.in_value; case m...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xe8, %rsp movq %rdi, %rbx movl 0x20(%rdi), %eax addl $-0x6, %eax cmpl $0x5, %eax ja 0x521cb leaq 0x686ce(%rip), %rcx # 0xba83c movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movl 0x18(%rbx), %eax cmpl 0x24(%rsi), %eax setg %al jmp 0x527...
/segviol[P]indigo/backend/optimization/const_loop_expand.cpp
optimization::func_array_global::Func_Array_Global::optimize_func(mir::inst::MirFunction&, mir::inst::MirPackage&)
void Func_Array_Global::optimize_func(mir::inst::MirFunction& func, mir::inst::MirPackage& mir) { if (!func.basic_blks.size() || func.name == "$$5_main") { return; } auto& startBlk = func.basic_blks.begin()->second; var_replace::Var_Replace vp(func); std::set<mir::ins...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x418, %rsp # imm = 0x418 cmpq $0x0, 0x90(%rsi) je 0x5475b movq %rdx, %rbx movq %rsi, %r13 leaq 0x8(%rsi), %rdi leaq 0x67672(%rip), %rsi # 0xba86c callq 0xc0d0 testl %eax, %eax je 0x5475b movq %rbx, 0xd0(%rsp) movq 0x80(%r13), %r14 l...
/segviol[P]indigo/backend/optimization/func_array_global.cpp
arm::ConstValue::~ConstValue()
virtual ~ConstValue() {}
pushq %rbx subq $0x10, %rsp movq %rdi, %rbx leaq 0x8(%rdi), %rsi movzbl 0x28(%rdi), %eax leaq 0x98ea9(%rip), %rcx # 0xede70 leaq 0xf(%rsp), %rdi callq *(%rcx,%rax,8) movb $-0x1, 0x28(%rbx) addq $0x10, %rsp popq %rbx retq movq %rax, %rdi callq 0x17c47 nop
/segviol[P]indigo/backend/optimization/./../../arm_code/arm.hpp
optimization::loop_unrolling::expand_loop(mir::inst::MirFunction&, mir::inst::BasicBlk&, optimization::loop_unrolling::loop_info)
void expand_loop(mir::inst::MirFunction& func, mir::inst::BasicBlk& blk, loop_info info) { auto& loop_start = func.basic_blks.at(info.loop_start); LOG(TRACE) << "unroll loop starts at " << info.loop_start << std::endl; LOG(TRACE) << "init_val: " << info.init_var << std::endl; LOG(TRACE) << "ch...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x2a8, %rsp # imm = 0x2A8 movq %rsi, %r14 movq %rdi, %r13 leaq 0x68(%rdi), %r12 movq %rdx, 0x58(%rsp) leaq 0x4(%rdx), %rsi movq %r12, %rdi movq %rsi, 0x68(%rsp) callq 0x2066a movq %rax, %r15 xorl %ebx, %ebx leaq 0x88(%rsp), %rdi movb %bl...
/segviol[P]indigo/backend/optimization/loop_unrolling.cpp
AixLog::operator<<(std::ostream&, AixLog::Function const&)
static std::ostream& operator<<(std::ostream& os, const Function& function) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.function = function; } else if (function) { os << function.name; } return os; }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movq 0x99a69(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x574ed movq 0x99af6(%rip), %rsi # 0xf0fd0 leaq 0x969a7(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %r14 jmp 0x574f0 x...
/segviol[P]indigo/backend/optimization/../../include/aixlog.hpp
AixLog::operator<<(std::ostream&, AixLog::Timestamp const&)
static std::ostream& operator<<(std::ostream& os, const Timestamp& timestamp) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.timestamp = timestamp; } else if (timestamp) { os << timestamp.to_string(); } ret...
pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rdi, %rbx movq 0x9998c(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x575ca movq 0x99a19(%rip), %rsi # 0xf0fd0 leaq 0x968ca(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %...
/segviol[P]indigo/backend/optimization/../../include/aixlog.hpp
optimization::loop_unrolling::Rewriter::get_insts(int, mir::inst::VarId&)
std::vector<std::unique_ptr<mir::inst::Inst>> get_insts( int times, mir::inst::VarId& new_change_var) { std::vector<std::unique_ptr<mir::inst::Inst>> res; auto cond = mir::inst::VarId(0); for (int i = 0; i < times; i++) { var_map.clear(); if (i) { var_map.insert(phi_var_pair); ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xd8, %rsp movq %rcx, 0x40(%rsp) movq %rsi, %r14 xorps %xmm0, %xmm0 movups %xmm0, (%rdi) movq %rdi, 0x18(%rsp) movq $0x0, 0x10(%rdi) movl %edx, 0x34(%rsp) testl %edx, %edx jle 0x581a1 leaq 0x10(%r14), %rbp leaq 0x40(%r14), %rax movq %rax, 0x78(%rsp...
/segviol[P]indigo/backend/optimization/loop_unrolling.cpp
optimization::loop_unrolling::Rewriter::copy_var(mir::inst::VarId)
mir::inst::VarId copy_var(mir::inst::VarId var) { if (var_map.count(var)) { return var_map.at(var); } auto id = get_new_VarId(); var_map.insert({var, id}); func.variables.insert({id, func.variables.at(var)}); return id; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx leaq 0x10(%rsi), %r12 movq %r12, %rdi movq %rdx, %rsi callq 0x40288 testq %rax, %rax je 0x584fd movq %r12, %rdi movq %r14, %rsi callq 0x402d4 leaq 0x95b69(%rip), %rcx # 0xee058 movq %rc...
/segviol[P]indigo/backend/optimization/loop_unrolling.cpp
optimization::complex_dce::ComplexDceRunner::calc_remained_vars()
void ComplexDceRunner::calc_remained_vars() { // Add all stored variables to root vars std::deque<VarId> remaining; std::unordered_set<VarId> visited; bool changed = true; while (changed) { changed = false; remaining.clear(); for (auto x : ref_vars) remaining.push_back(x); while (!remaining...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xf8, %rsp movq %rdi, %rbx xorps %xmm0, %xmm0 leaq 0x20(%rsp), %rdi movaps %xmm0, 0x40(%rdi) movaps %xmm0, 0x30(%rdi) movaps %xmm0, 0x20(%rdi) movaps %xmm0, 0x10(%rdi) movaps %xmm0, (%rdi) xorl %esi, %esi callq 0x3fea8 leaq 0xf0(%rsp), %rax movq %r...
/segviol[P]indigo/backend/optimization/complex_dead_code_elimination.cpp
AixLog::operator<<(std::ostream&, AixLog::Timestamp const&)
static std::ostream& operator<<(std::ostream& os, const Timestamp& timestamp) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.timestamp = timestamp; } else if (timestamp) { os << timestamp.to_string(); } ret...
pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rdi, %rbx movq 0x947f1(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x5c765 movq 0x9487e(%rip), %rsi # 0xf0fd0 leaq 0x9172f(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %...
/segviol[P]indigo/include/aixlog.hpp
AixLog::operator<<(std::ostream&, AixLog::Severity const&)
static std::ostream& operator<<(std::ostream& os, const Severity& log_severity) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); if (log->metadata_.severity != log_severity) { log->sync(); ...
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x1a8, %rsp # imm = 0x1A8 movq %rdi, %r15 movq 0x945d6(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x5c980 movq 0x94663(%rip), %rsi # 0xf0fd0 leaq 0x91514(%rip), %rdx # 0xede88 xorl...
/segviol[P]indigo/include/aixlog.hpp
optimization::value_shift_collapse::mir_op_to_arm_shift(mir::inst::Op)
arm::RegisterShiftKind mir_op_to_arm_shift(Op op) { switch (op) { case Op::Shl: return arm::RegisterShiftKind::Lsl; case Op::Shr: return arm::RegisterShiftKind::Lsr; case Op::ShrA: return arm::RegisterShiftKind::Asr; default: throw std::logic_error("Input is not a valid shift!"...
pushq %r14 pushq %rbx pushq %rax addl $-0x10, %edi cmpl $0x3, %edi jae 0x5ff44 shll $0x3, %edi movl $0x201, %eax # imm = 0x201 movl %edi, %ecx shrl %cl, %eax addq $0x8, %rsp popq %rbx popq %r14 retq movl $0x10, %edi callq 0xc170 movq %rax, %rbx leaq 0x5b317(%rip), %rsi # 0xbb26f movq %rax, %rdi callq 0xc...
/segviol[P]indigo/backend/optimization/value_shift_collapse.cpp
backend::codegen::Codegen::translate_function()
arm::Function Codegen::translate_function() { init_reg_map(); scan_stack(); scan(); generate_startup(); std::vector<std::unique_ptr<arm::Inst>> inst_sink = std::move(inst); std::set<uint32_t> vis; for (auto it = bb_ordering.begin(); it != bb_ordering.end(); it++) { auto bb_id = *it; inst.clear(); ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x168, %rsp # imm = 0x168 movq %rsi, %r14 movq %rdi, 0x130(%rsp) movq %rsi, %rdi callq 0x63c4e movq %r14, %rdi callq 0x63cb6 movq %r14, %rdi callq 0x63d5a movq %r14, %rdi callq 0x64696 movups 0x18(%r14), %xmm0 movaps %xmm0, 0x100(%rsp) m...
/segviol[P]indigo/backend/codegen/codegen.cpp
AixLog::operator<<(std::ostream&, AixLog::Function const&)
static std::ostream& operator<<(std::ostream& os, const Function& function) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.function = function; } else if (function) { os << function.name; } return os; }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movq 0x8c028(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x64f2e movq 0x8c0b5(%rip), %rsi # 0xf0fd0 leaq 0x88f66(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %r14 jmp 0x64f31 x...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
AixLog::operator<<(std::ostream&, AixLog::Severity const&)
static std::ostream& operator<<(std::ostream& os, const Severity& log_severity) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); if (log->metadata_.severity != log_severity) { log->sync(); ...
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x1a8, %rsp # imm = 0x1A8 movq %rdi, %r15 movq 0x8bd30(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x65226 movq 0x8bdbd(%rip), %rsi # 0xf0fd0 leaq 0x88c6e(%rip), %rdx # 0xede88 xorl...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
backend::codegen::Codegen::emit_phi_move(std::unordered_set<mir::inst::VarId, std::hash<mir::inst::VarId>, std::equal_to<mir::inst::VarId>, std::allocator<mir::inst::VarId>>&)
void Codegen::emit_phi_move(std::unordered_set<mir::inst::VarId>& i) { for (auto id : i) { auto collapsed = get_collapsed_var(id); if (collapsed == id) { continue; } auto src_reg = get_or_alloc_vgp(id); // display_reg_name(LOG(DEBUG), src_reg); // auto vis = std::set<mir::inst::VarId>();...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq 0x10(%rsi), %r15 testq %r15, %r15 je 0x65ac3 movq %rdi, %rbx leaq 0x18(%rdi), %rax movq %rax, 0x20(%rsp) leaq 0x8868a(%rip), %r12 # 0xee058 leaq 0x8af63(%rip), %rax # 0xf0938 addq $0x10, %rax movq %rax, 0x18(%rsp) leaq 0x8ad...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::translate_inst(mir::inst::OpInst&)
void Codegen::translate_inst(mir::inst::OpInst& i) { // Reverse when: // - lhs is immediate // - lhs is variable with shift and rhs is regular variable bool reverse_params = ((i.lhs.is_immediate() && !i.rhs.is_immediate()) || (!i.lhs.is_immediate() && !i.rhs.is_immediate() && ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq %rsi, %r12 movq %rdi, %rbx leaq 0x18(%rsi), %r13 movb 0x30(%rsi), %al testb %al, %al jne 0x65b15 cmpb $0x0, 0x50(%r12) jne 0x65b43 xorl %ebp, %ebp testb %al, %al je 0x65bcd cmpb $0x0, 0x50(%r12) je 0x65bcd cmpb $0x0, 0x32(%r12) je 0...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::translate_inst(mir::inst::OpAccInst&)
void Codegen::translate_inst(mir::inst::OpAccInst& i) { switch (i.op) { case mir::inst::OpAcc::MulAdd: inst.push_back(std::make_unique<Arith4Inst>( arm::OpCode::Mla, translate_var_reg(i.dest), translate_value_to_reg(i.lhs), translate_value_to_reg(i.rhs), translate_var_reg(i.acc...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %rsi, %r14 movq %rdi, %rbx movl 0x68(%rsi), %eax cmpl $0x1, %eax je 0x66932 testl %eax, %eax jne 0x669f5 leaq 0x18(%rbx), %rax movq %rax, 0x10(%rsp) movl 0x10(%r14), %eax leaq 0x877ca(%rip), %rcx # 0xee058 leaq 0x18(%rsp), %r12 ...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::translate_inst(mir::inst::StoreInst&)
void Codegen::translate_inst(mir::inst::StoreInst& i) { auto ins = std::make_unique<LoadStoreInst>( arm::OpCode::StR, translate_value_to_reg(i.val), translate_var_to_memory_arg(i.dest)); inst.push_back(std::move(ins)); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x88, %rsp movq %rsi, %r14 movq %rdi, %rbx addq $0x18, %rsi callq 0x6a270 movl %eax, %ebp leaq 0x8698d(%rip), %rax # 0xee058 leaq 0x48(%rsp), %rdx movq %rax, (%rdx) movl 0x10(%r14), %eax movl %eax, 0x8(%rdx) leaq 0x58(%rsp), %r12 movq %r12, %rd...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::translate_inst(mir::inst::PtrOffsetInst&)
void Codegen::translate_inst(mir::inst::PtrOffsetInst& i) { auto& ptr_ty = func.variables.at(i.ptr).ty; auto ptr_ty_ = static_cast<mir::types::PtrTy*>(&*ptr_ty); auto item_size = ptr_ty_->item->size().value(); auto offset_value = i.offset; if (auto int_val = offset_value.get_if<int32_t>()) { *int_val *= ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %rsi, %r14 movq %rdi, %rbx movq (%rdi), %rdi addq $0x38, %rdi movl 0x20(%rsi), %eax leaq 0x38(%rsp), %rsi movl %eax, (%rsi) callq 0x1df18 movq 0x8(%rax), %rax movq 0x8(%rax), %rdi movq (%rdi), %rax callq *0x18(%rax) btq $0x20, %rax ...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::translate_branch(mir::inst::JumpInstruction&)
void Codegen::translate_branch(mir::inst::JumpInstruction& j) { last_jump = std::move(this_jump); this_jump = std::nullopt; switch (j.kind) { case mir::inst::JumpInstructionKind::Br: inst.push_back(std::make_unique<BrInst>( OpCode::B, format_bb_label(func.name, j.bb_true))); break; c...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq %rsi, %r14 movq %rdi, %rbx movups 0x1fc(%rdi), %xmm0 movups %xmm0, 0x1ec(%rdi) cmpb $0x1, 0x208(%rdi) jne 0x685cc movb $0x0, 0x208(%rbx) movl 0x8(%r14), %eax cmpq $0x3, %rax ja 0x68f71 leaq 0x52d7b(%rip), %rcx # 0xbb35c movslq (...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::get_or_alloc_vd(mir::inst::VarId)
arm::Reg Codegen::get_or_alloc_vd(mir::inst::VarId v_) { auto v = get_collapsed_var(v_); auto found = reg_map.find(v); if (found != reg_map.end()) { assert(arm::register_type(found->second) == arm::RegisterKind::VirtualDoubleVector); return found->second; } else { auto reg = alloc_vd(); ...
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x40, %rsp movq %rsi, %rbx movq %rdi, %r14 leaq 0x84a59(%rip), %r12 # 0xee058 leaq 0x30(%rsp), %rdx movq %r12, (%rdx) movl 0x8(%rsi), %eax movl %eax, 0x8(%rdx) leaq 0x8(%rsp), %rdi movq %r14, %rsi callq 0x6952c movq 0x40(%r14), %rdx leaq 0x38(%r14), %rax ...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::add_collapsed_var(mir::inst::VarId, mir::inst::VarId)
void Codegen::add_collapsed_var(mir::inst::VarId tgt, mir::inst::VarId item) { auto tgt_src = get_collapsed_var(tgt); auto item_src = get_collapsed_var(item); var_collapse.insert_or_assign(item_src, tgt_src); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x48, %rsp movq %rdx, %rbx movq %rdi, %r14 leaq 0x84842(%rip), %r12 # 0xee058 leaq 0x38(%rsp), %rdx movq %r12, (%rdx) movl 0x8(%rsi), %eax movl %eax, 0x8(%rdx) leaq 0x8(%rsp), %r15 movq %r15, %rdi movq %r14, %rsi callq 0x6952c leaq 0x18(%rsp), %rdx movq %r12, (%rdx)...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::deal_phi(mir::inst::PhiInst&)
void Codegen::deal_phi(mir::inst::PhiInst& phi) { auto dest = phi.dest; LOG(TRACE) << dest << " <- "; for (auto& x : phi.vars) { LOG(TRACE) << x << " "; add_collapsed_var(dest, x); // var_collapse.insert({x, dest}); } LOG(TRACE) << std::endl; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x128, %rsp # imm = 0x128 movq %rsi, %r13 movq %rdi, 0xd8(%rsp) leaq 0x847b3(%rip), %rax # 0xee058 movq %rax, 0xf8(%rsp) movl 0x10(%rsi), %eax movl %eax, 0x100(%rsp) xorl %ebx, %ebx leaq 0xf(%rsp), %rdi movb %bl, (%rdi) callq 0x651e0...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::translate_value_to_reg(mir::inst::Value&)
arm::Reg Codegen::translate_value_to_reg(mir::inst::Value& v) { if (auto x = v.get_if<int32_t>()) { auto int_value = *x; auto reg = alloc_vgp(); uint32_t imm_u = int_value; make_number(reg, imm_u); return reg; } else if (auto x = v.get_if<mir::inst::VarId>()) { auto reg = get_or_alloc_vgp(*x...
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x18, %rsp movq %rsi, %r15 movq %rdi, %rbx movzbl 0x18(%rsi), %eax cmpl $0x1, %eax je 0x6a2c2 testl %eax, %eax jne 0x6a39c movl 0x8(%r15), %ebp movl 0x20c(%rbx), %esi leal 0x1(%rsi), %eax movl %eax, 0x20c(%rbx) movl $0x3, %edi callq 0xb56e5 movl %eax, %r14d movq %rbx, %...
/segviol[P]indigo/backend/codegen/codegen.cpp
backend::codegen::Codegen::emit_compare(mir::inst::VarId&, mir::inst::Value&, mir::inst::Value&, arm::ConditionCode, bool)
void Codegen::emit_compare(mir::inst::VarId& dest, mir::inst::Value& lhs, mir::inst::Value& rhs, arm::ConditionCode cond, bool reversed) { if (reversed) { cond = reverse_cond(cond); } inst.push_back( std::make_unique<Arith2Inst>(OpCode::Cmp, translat...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movl %r8d, %r15d movq %rcx, %r12 movq %rdx, %r13 movq %rsi, 0x20(%rsp) movq %rdi, %r14 testl %r9d, %r9d je 0x6a90c movzbl %r15b, %edi callq 0xb5a40 movl %eax, %r15d movq %r14, %rdi movq %r13, %rsi callq 0x6a270 movl %eax, %ebx leaq 0x58(...
/segviol[P]indigo/backend/codegen/codegen.cpp
arm::Function::Function(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::shared_ptr<mir::types::FunctionTy>, std::vector<std::unique_ptr<arm::Inst, std::default_delete<arm::Inst>>, std::allocator<std::unique_ptr<arm::Inst, std::default_delete<arm::Inst>>>>&&, std::map<std::__cxx11::...
Function(std::string& name, std::shared_ptr<mir::types::FunctionTy> ty, std::vector<std::unique_ptr<Inst>>&& inst, std::map<std::string, ConstValue>&& local_const, uint32_t stack_size) : name(name), ty(ty), inst(std::move(inst)), local_const(std::move(local_const)), ...
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movl %r9d, %ebp movq %r8, %r15 movq %rcx, %r12 movq %rdx, %rbx movq %rdi, %r14 leaq 0x85e02(%rip), %rax # 0xf0ad0 addq $0x10, %rax movq %rax, (%rdi) addq $0x8, %rdi leaq 0x18(%r14), %rax movq %rax, 0x8(%r14) movq (%rsi), %rax movq 0x8(%rsi), %rdx addq %rax, %rd...
/segviol[P]indigo/backend/codegen/../../arm_code/arm.hpp
backend::codegen::format_bb_label[abi:cxx11](std::basic_string_view<char, std::char_traits<char>>, unsigned int)
inline std::string format_bb_label(std::string_view function_name, uint32_t label_id) { auto s = std::stringstream(); s << ".bb_" << function_name << "$" << label_id; return s.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x190, %rsp # imm = 0x190 movl %ecx, %ebp movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx leaq 0x8(%rsp), %rdi callq 0xc270 leaq 0x18(%rsp), %r12 leaq 0x508a9(%rip), %rsi # 0xbb639 movl $0x4, %edx movq %r12, %rdi callq 0xc440 movq %r12, %rdi mo...
/segviol[P]indigo/backend/codegen/codegen.hpp
backend::codegen::format_fn_end_label[abi:cxx11](std::basic_string_view<char, std::char_traits<char>>)
inline std::string format_fn_end_label(std::string_view function_name) { auto s = std::stringstream(); s << ".end_" << function_name << "$"; return s.str(); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x188, %rsp # imm = 0x188 movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx movq %rsp, %rdi callq 0xc270 leaq 0x10(%rsp), %r12 leaq 0x507e0(%rip), %rsi # 0xbb63e movl $0x5, %edx movq %r12, %rdi callq 0xc440 movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx ca...
/segviol[P]indigo/backend/codegen/codegen.hpp
backend::codegen::format_load_pc_label[abi:cxx11](std::basic_string_view<char, std::char_traits<char>>, unsigned int)
inline std::string format_load_pc_label(std::string_view function_name, uint32_t label_id) { auto s = std::stringstream(); s << ".ld_pc_" << function_name << "$" << label_id; return s.str(); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x190, %rsp # imm = 0x190 movl %ecx, %ebp movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx leaq 0x8(%rsp), %rdi callq 0xc270 leaq 0x18(%rsp), %r12 leaq 0x502a1(%rip), %rsi # 0xbb661 movl $0x7, %edx movq %r12, %rdi callq 0xc440 movq %r12, %rdi mo...
/segviol[P]indigo/backend/codegen/codegen.hpp
arm::CtrlInst::CtrlInst(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::any, bool)
Inst(OpCode op, ConditionCode cond = ConditionCode::Always) : op(op), cond(cond){}
movl $0x21, 0x8(%rdi) movb $0x10, 0xc(%rdi) leaq 0x83b9a(%rip), %rax # 0xf0a90 addq $0x10, %rax movq %rax, (%rdi) movb %cl, 0xd(%rdi) leaq 0x20(%rdi), %rcx movq %rcx, 0x10(%rdi) movq (%rsi), %r8 leaq 0x10(%rsi), %rax cmpq %rax, %r8 je 0x6cf21 movq %r8, 0x10(%rdi) movq (%rax), %rcx movq %rcx, 0x20(%rdi) jmp 0x6cf27 ...
/segviol[P]indigo/backend/codegen/../../arm_code/arm.hpp
AixLog::operator<<(std::ostream&, AixLog::Tag const&)
static std::ostream& operator<<(std::ostream& os, const Tag& tag) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.tag = tag; } else if (tag) { os << tag.text; } return os; }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movq 0x81ca7(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x6f2af movq 0x81d34(%rip), %rsi # 0xf0fd0 leaq 0x7ebe5(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %r14 jmp 0x6f2b2 x...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
backend::codegen::CodeAlignOptimization::optimize_func(arm::Function&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, s...
void CodeAlignOptimization::optimize_func( arm::Function &f, std::map<std::string, std::any> &extra_data_repo) { auto cycle_set = std::any_cast<optimization::CycleStartType>( extra_data_repo.at(optimization::CYCLE_START_DATA_NAME)) .at(f.name); std::vector<std::uniq...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movq %rdx, %rdi movq %rsi, %rbx leaq 0x7fcd6(%rip), %rsi # 0xf2388 callq 0x72b14 movq %rax, %rdi callq 0x72ca2 testq %rax, %rax je 0x72ac8 xorl %ecx, %ecx leaq 0x50(%rsp), %r14 movq %rcx, (%r14) movq 0x8(%rax), %rdx movq %rdx, 0x8(%r...
/segviol[P]indigo/backend/codegen/align_code.cpp
backend::codegen::RegAllocator::alloc_regs()
void RegAllocator::alloc_regs() { construct_reg_map(); calc_live_intervals(); LOG(TRACE, "bb_reg_use") << "BB starting point" << std::endl; for (auto x : point_bb_map) { LOG(TRACE, "bb_reg_use") << x.first << " -> " << x.second << std::endl; } // LOG(TRACE, "bb_reg_use") << "BB Reg use:" << std::endl;...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %rdi, %r14 callq 0x7393a movq %r14, %rdi callq 0x74344 xorl %ebx, %ebx leaq 0xf(%rsp), %rdi movb %bl, (%rdi) callq 0x74e57 leaq 0x7b186(%rip), %rax # 0xedee0 leaq 0x68(%rsp), %rdi movq %rax, -0x8(%rdi) ...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
AixLog::operator<<(std::ostream&, AixLog::Timestamp const&)
static std::ostream& operator<<(std::ostream& os, const Timestamp& timestamp) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.timestamp = timestamp; } else if (timestamp) { os << timestamp.to_string(); } ret...
pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rdi, %rbx movq 0x7c2d4(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x74c82 movq 0x7c361(%rip), %rsi # 0xf0fd0 leaq 0x79212(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
AixLog::operator<<(std::ostream&, AixLog::Tag const&)
static std::ostream& operator<<(std::ostream& os, const Tag& tag) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); log->metadata_.tag = tag; } else if (tag) { os << tag.text; } return os; }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movq 0x7c180(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x74dd6 movq 0x7c20d(%rip), %rsi # 0xf0fd0 leaq 0x790be(%rip), %rdx # 0xede88 xorl %ecx, %ecx callq 0xc420 movq %rax, %r14 jmp 0x74dd9 x...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
AixLog::operator<<(std::ostream&, AixLog::Severity const&)
static std::ostream& operator<<(std::ostream& os, const Severity& log_severity) { Log* log = dynamic_cast<Log*>(os.rdbuf()); if (log != nullptr) { std::lock_guard<std::recursive_mutex> lock(log->mutex_); if (log->metadata_.severity != log_severity) { log->sync(); ...
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x1a8, %rsp # imm = 0x1A8 movq %rdi, %r15 movq 0x7c0b9(%rip), %rax # 0xf0f28 movq (%rax), %rcx movq -0x18(%rcx), %rcx movq 0xe8(%rax,%rcx), %rdi testq %rdi, %rdi je 0x74e9d movq 0x7c146(%rip), %rsi # 0xf0fd0 leaq 0x78ff7(%rip), %rdx # 0xede88 xorl...
/segviol[P]indigo/backend/codegen/../../include/aixlog.hpp
backend::codegen::RegAllocator::perform_load_stores()
void RegAllocator::perform_load_stores() { for (int i = 0; i < f.inst.size(); i++) { auto inst_ = &*f.inst[i]; LOG(TRACE) << " " << std::endl << *inst_ << std::endl; cur_cond = inst_->cond; if (auto x = dynamic_cast<Arith3Inst *>(inst_)) { replace_read(x->r1, i); replace_read(x->r2, i); ...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x168, %rsp # imm = 0x168 movq (%rdi), %rcx movq 0x28(%rcx), %rax cmpq %rax, 0x30(%rcx) je 0x76209 movq %rdi, %rbx leaq 0x60(%rsp), %r15 leaq 0x328(%rdi), %rcx movq %rcx, 0x10(%rsp) leaq 0x7b05d(%rip), %rcx # 0xf08f8 addq $0x10, %rcx...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocator::replace_read(unsigned int&, int, std::optional<unsigned int>)
void RegAllocator::replace_read(Reg &r, int i, std::optional<Reg> pre_alloc_transient) { auto disp_reg = [r, i]() { display_reg_name(LOG(TRACE), r); LOG(TRACE) << " at: " << i << " "; }; r = get_collapse_reg(r); if (!is_virtual_register(r)) { disp_reg(); LOG(TRACE...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %rcx, %r14 movl %edx, %r12d movq %rsi, %rbx movq %rdi, %r15 movl (%rsi), %esi movl %esi, 0x90(%rsp) movl %edx, 0x94(%rsp) callq 0x7c1da movl %eax, (%rbx) cmpl $0x3f, %eax jbe 0x76443 leaq 0x118(%r15), %rdi ...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocator::alloc_transient_reg(backend::codegen::Interval, std::optional<unsigned int>)
Reg RegAllocator::alloc_transient_reg(Interval i, std::optional<Reg> orig) { Reg r = -1; if (orig) { LOG(TRACE) << "orig "; display_reg_name(LOG(TRACE), orig.value()); LOG(TRACE) << " "; auto it = active_reg_map.begin(); while (it != active_reg_map.end()) { if (it->first == orig) b...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x248, %rsp # imm = 0x248 movq %rdx, %r14 movq %rsi, %r13 movq %rdi, %r15 btq $0x20, %rdx movq %rsi, 0x88(%rsp) jae 0x77db4 xorl %ebx, %ebx leaq 0x40(%rsp), %rdi movb %bl, (%rdi) callq 0x74e57 leaq 0x7695a(%rip), %rcx # 0xedee0 leaq ...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocator::replace_write(backend::codegen::ReplaceWriteAction, int)
void RegAllocator::replace_write(ReplaceWriteAction r, int i) { auto disp_reg = [&]() { display_reg_name(LOG(TRACE), r.from); LOG(TRACE) << " at: " << i << " "; }; if (r.kind == ReplaceWriteKind::Phys) { // is physical register; mark as occupied active.insert({r.replace_with, Interval(i, UINT32_MA...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x128, %rsp # imm = 0x128 movq %rdi, %r15 leaq 0x88(%rsp), %rax movq %rsi, (%rax) movl %edx, 0x8(%rax) leaq 0x124(%rsp), %rsi movl %ecx, (%rsi) movq %rax, 0xf0(%rsp) movq %rsi, 0xf8(%rsp) cmpl $0x2, %edx je 0x7a5c9 cmpl $0x1, %edx je 0x7...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocator::replace_write(backend::codegen::ReplaceWriteAction, int)::$_0::operator()() const
void RegAllocator::replace_write(ReplaceWriteAction r, int i) { auto disp_reg = [&]() { display_reg_name(LOG(TRACE), r.from); LOG(TRACE) << " at: " << i << " "; }; if (r.kind == ReplaceWriteKind::Phys) { // is physical register; mark as occupied active.insert({r.replace_with, Interval(i, UINT32_MA...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xe8, %rsp movq %rdi, %rbx xorl %ebp, %ebp leaq 0x7(%rsp), %rdi movb %bpl, (%rdi) callq 0x74e57 leaq 0x72f74(%rip), %rcx # 0xedee0 leaq 0x60(%rsp), %rax movq %rcx, -0x18(%rax) movq %rax, -0x10(%rax) movq $0x0, -0x8(%rax) movb %bpl, (%rax) movb ...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocatePass::optimize_func(arm::Function&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::ch...
void RegAllocatePass::optimize_func( arm::Function &f, std::map<std::string, std::any> &extra_data_repo) { auto &var_mapping_data = std::any_cast<optimization::MirVariableToArmVRegType &>( extra_data_repo.at(optimization::MIR_VARIABLE_TO_ARM_VREG_DATA_NAME)); auto &coloring_data = std::any_cast...
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x3f8, %rsp # imm = 0x3F8 movq %rdx, %r15 movq %rsi, %rbx leaq 0x76ee1(%rip), %rsi # 0xf24a0 movq %rdx, %rdi callq 0x72b14 movq %rax, %rdi callq 0x6bee3 movq %rax, %r14 testq %rax, %rax je 0x7b687 leaq 0x18(%rsp), %r12 movq %r12, -0x10(%r12) leaq 0x3dc24(...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocator::add_reg_write(unsigned int, unsigned int)
void add_reg_write(Reg reg, unsigned int point) { if (auto r = live_intervals.find(reg); r != live_intervals.end()) { r->second.add_starting_point(point); } else { live_intervals.insert({reg, Interval(point)}); } auto r_use_insert = reg_assign_count.insert({reg, 1}); if (!r_use_insert.se...
pushq %rbp pushq %r14 pushq %rbx subq $0x10, %rsp movl %edx, %ebx movl %esi, %ebp movq %rdi, %r14 movl %esi, %eax movq 0xe0(%rdi), %rsi movq 0xe8(%rdi), %rdi xorl %r9d, %r9d xorl %edx, %edx divq %rdi movq (%rsi,%rdx,8), %rax testq %rax, %rax je 0x7bbf1 movq (%rax), %r8 movq %rax, %r9 cmpl %ebp, 0x8(%r8) je 0x7bbf1 movq...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocator::display_active_regs()
void display_active_regs() { auto &trace = LOG(TRACE); trace << "active: "; for (auto x : active) { trace << x.first << "->[" << x.second.start << "," << x.second.end << "]" << "; "; } trace << std::endl; trace << "map: "; for (auto x : active_reg_map) { display_reg_n...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xf8, %rsp movq %rdi, %rbp xorl %ebx, %ebx leaq 0xf(%rsp), %rdi movb %bl, (%rdi) callq 0x74e57 leaq 0x720db(%rip), %r15 # 0xedee0 leaq 0x70(%rsp), %r14 movq %r15, -0x18(%r14) movq %r14, -0x10(%r14) movq $0x0, -0x8(%r14) movb %bl, (%r14) movb $0...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocator::invalidate_read(int)
void invalidate_read(int pos) { LOG(DEBUG) << "Invalidating: "; auto it = active.begin(); while (it != active.end()) { if (it->second.end <= pos) { // The register is no longer to be read from, thus is freed auto ait = active_reg_map.begin(); while (ait != active_reg_map.end())...
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xf8, %rsp movl %esi, 0x7c(%rsp) movq %rdi, %r14 movb $0x1, %bl leaq 0x7(%rsp), %rdi movb %bl, (%rdi) callq 0x74e57 leaq 0x71b9f(%rip), %rbp # 0xedee0 leaq 0x60(%rsp), %r13 movq %rbp, -0x18(%r13) movq %r13, -0x10(%r13) movq $0x0, -0x8(%r13) mov...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
backend::codegen::RegAllocator::RegAllocator(arm::Function&, std::map<mir::inst::VarId, int, std::less<mir::inst::VarId>, std::allocator<std::pair<mir::inst::VarId const, int>>>&, std::map<mir::inst::VarId, unsigned int, std::less<mir::inst::VarId>, std::allocator<std::pair<mir::inst::VarId const, unsigned int>>>&)
RegAllocator(arm::Function &f, ColorMap &color_map, std::map<mir::inst::VarId, Reg> &mir_to_arm) : f(f), live_intervals(), reg_map(), stack_size(f.stack_size), spilled_regs(), spill_positions(), color_map(color_map), mir_to_arm(mir_to_arm), ...
movq %rsi, (%rdi) movq %rdx, 0x8(%rdi) movq %rcx, 0x10(%rdi) leaq 0x20(%rdi), %rax xorps %xmm0, %xmm0 movups %xmm0, 0x28(%rdi) movups %xmm0, 0x38(%rdi) movups %xmm0, 0x18(%rdi) movq %rax, 0x30(%rdi) movq %rax, 0x38(%rdi) leaq 0x50(%rdi), %rax movups %xmm0, 0x60(%rdi) movups %xmm0, 0x50(%rdi) movups %xmm0, 0x40(%rdi) mo...
/segviol[P]indigo/backend/codegen/reg_alloc.cpp
front::express::ExpressNode::isBinaryOperation()
bool ExpressNode::isBinaryOperation() { return _operation == OperationType::PLUS || _operation == OperationType::MINU || _operation == OperationType::MUL || _operation == OperationType::DIV || _operation == OperationType::MOD || _operation == OperationType::OR || _operation == Oper...
movl 0x4(%rdi), %eax addl $-0x7, %eax cmpl $0xd, %eax setb %al retq nop
/segviol[P]indigo/frontend/express_node.cpp
front::irGenerator::irGenerator::insertFunc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::shared_ptr<mir::inst::MirFunction>)
void irGenerator::insertFunc(string key, shared_ptr<mir::inst::MirFunction> func) { _package.functions.insert( {key, mir::inst::MirFunction(func->name, func->type)}); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x188, %rsp # imm = 0x188 movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx movq (%rdx), %rax leaq 0x28(%rsp), %r12 movq %r12, -0x10(%r12) movq 0x8(%rax), %rsi movq 0x10(%rax), %rdx addq %rsi, %rdx leaq 0x18(%rsp), %rdi callq 0x18456 movq (%r15), %rax movq 0x28...
/segviol[P]indigo/frontend/ir_generator.cpp