Lines Matching refs:bb
308 static Bool is_stack_access(IRSB* const bb, IRExpr* const addr_expr)
315 for (i = 0; i < bb->stmts_size; i++)
317 if (bb->stmts[i]
318 && bb->stmts[i]->tag == Ist_WrTmp
319 && bb->stmts[i]->Ist.WrTmp.tmp == addr_expr->Iex.RdTmp.tmp)
321 IRExpr* e = bb->stmts[i]->Ist.WrTmp.data;
346 static IRExpr* instr_trace_mem_load(IRSB* const bb, IRExpr* addr_expr,
351 tmp = newIRTemp(bb->tyenv, typeOfIRExpr(bb->tyenv, addr_expr));
352 addStmtToIRSB(bb, IRStmt_WrTmp(tmp, addr_expr));
355 addStmtToIRSB(bb,
369 static void instr_trace_mem_store(IRSB* const bb, IRExpr* const addr_expr,
376 tl_assert(!data_expr_hi || typeOfIRExpr(bb->tyenv, data_expr_hi) == Ity_I32);
378 ty_data_expr = typeOfIRExpr(bb->tyenv, data_expr_lo);
384 IRTemp tmp = newIRTemp(bb->tyenv, Ity_F32);
386 addStmtToIRSB(bb, IRStmt_WrTmp(tmp, data_expr_lo));
390 IRTemp tmp = newIRTemp(bb->tyenv, Ity_F64);
392 addStmtToIRSB(bb, IRStmt_WrTmp(tmp, data_expr_lo));
399 IRTemp tmp = newIRTemp(bb->tyenv, Ity_I32);
400 addStmtToIRSB(bb, IRStmt_WrTmp(tmp, IRExpr_Unop(Iop_ReinterpF32asI32,
405 IRTemp tmp = newIRTemp(bb->tyenv, Ity_I64);
406 addStmtToIRSB(bb, IRStmt_WrTmp(tmp, IRExpr_Unop(Iop_ReinterpF64asI64,
433 tmp = newIRTemp(bb->tyenv, sizeof(HWord) == 4 ? Ity_I32 : Ity_I64);
434 addStmtToIRSB(bb,
443 tmp = newIRTemp(bb->tyenv, Ity_I32);
444 addStmtToIRSB(bb,
448 tmp = newIRTemp(bb->tyenv, Ity_I32);
449 addStmtToIRSB(bb, IRStmt_WrTmp(tmp,
456 addStmtToIRSB(bb,
466 static void instrument_load(IRSB* const bb, IRExpr* const addr_expr,
473 if (!s_check_stack_accesses && is_stack_access(bb, addr_expr))
515 addStmtToIRSB(bb, IRStmt_Dirty(di));
518 static void instrument_store(IRSB* const bb, IRExpr* addr_expr,
526 size = sizeofIRType(typeOfIRExpr(bb->tyenv, data_expr));
529 IRTemp tmp = newIRTemp(bb->tyenv, typeOfIRExpr(bb->tyenv, addr_expr));
530 addStmtToIRSB(bb, IRStmt_WrTmp(tmp, addr_expr));
532 instr_trace_mem_store(bb, addr_expr, NULL, data_expr);
535 if (!s_check_stack_accesses && is_stack_access(bb, addr_expr))
577 addStmtToIRSB(bb, IRStmt_Dirty(di));
589 IRSB* bb;
593 /* Set up BB */
594 bb = emptyIRSB();
595 bb->tyenv = deepCopyIRTypeEnv(bb_in->tyenv);
596 bb->next = deepCopyIRExpr(bb_in->next);
597 bb->jumpkind = bb_in->jumpkind;
598 bb->offsIP = bb_in->offsIP;
617 addStmtToIRSB(bb, st);
628 addStmtToIRSB(bb, st);
633 instrument_store(bb, st->Ist.Store.addr, st->Ist.Store.data);
634 addStmtToIRSB(bb, st);
643 addr_expr = instr_trace_mem_load(bb, addr_expr,
646 instrument_load(bb, data->Iex.Load.addr,
650 addStmtToIRSB(bb, st);
672 addStmtToIRSB(bb, IRStmt_Dirty(di));
681 addStmtToIRSB(bb, IRStmt_Dirty(di));
688 addStmtToIRSB(bb, st);
706 dataSize = sizeofIRType(typeOfIRExpr(bb->tyenv, cas->dataLo));
711 instr_trace_mem_store(bb, cas->addr, cas->dataHi, cas->dataLo);
713 instrument_load(bb, cas->addr, dataSize);
715 addStmtToIRSB(bb, st);
731 addr_expr = instr_trace_mem_load(bb, addr_expr,
734 instrument_load(bb, addr_expr, sizeofIRType(dataTy));
738 instr_trace_mem_store(bb, st->Ist.LLSC.addr, NULL,
741 addStmtToIRSB(bb, st);
751 addStmtToIRSB(bb, st);
760 return bb;