From: Florian Krohm Date: Thu, 31 May 2012 15:48:13 +0000 (+0000) Subject: Reduce size of an IRStmt from 40 bytes to 32 bytes on LP64 X-Git-Tag: svn/VALGRIND_3_8_0~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb6b4f1bbe043ca65dd2f21e2125d610b2869bf1;p=thirdparty%2Fvalgrind.git Reduce size of an IRStmt from 40 bytes to 32 bytes on LP64 by allocating the details of a PutI statement into a struct of its own and link to that (as is being done for Dirty and CAS). These are the valgrind bits (see also VEX r2361). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12596 --- diff --git a/coregrind/m_translate.c b/coregrind/m_translate.c index 607b030f8f..17d4947a76 100644 --- a/coregrind/m_translate.c +++ b/coregrind/m_translate.c @@ -586,7 +586,7 @@ IRSB* vg_SP_update_pass ( void* closureV, deal with SP changing in weird ways (well, we can, but not at this time of night). */ if (st->tag == Ist_PutI) { - descr = st->Ist.PutI.descr; + descr = st->Ist.PutI.details->descr; minoff_ST = descr->base; maxoff_ST = descr->base + descr->nElems * sizeofIRType(descr->elemTy) - 1; @@ -984,8 +984,8 @@ static void gen_PUSH ( IRSB* bb, IRExpr* e ) /* PutI/GetI have I32-typed indexes regardless of guest word size */ addStmtToIRSB( bb, - IRStmt_PutI(descr, narrowTo32(bb->tyenv,IRExpr_RdTmp(t1)), 0, e) - ); + IRStmt_PutI(mkIRPutI(descr, + narrowTo32(bb->tyenv,IRExpr_RdTmp(t1)), 0, e))); } diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index 378fa581ff..0ddd7abc04 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -1274,13 +1274,15 @@ void do_shadow_PUT ( MCEnv* mce, Int offset, given GETI (passed in in pieces). */ static -void do_shadow_PUTI ( MCEnv* mce, - IRRegArray* descr, - IRAtom* ix, Int bias, IRAtom* atom ) +void do_shadow_PUTI ( MCEnv* mce, IRPutI *puti) { IRAtom* vatom; IRType ty, tyS; Int arrSize;; + IRRegArray* descr = puti->descr; + IRAtom* ix = puti->ix; + Int bias = puti->bias; + IRAtom* atom = puti->data; // Don't do shadow PUTIs if we're not doing undefined value checking. // Their absence lets Vex's optimiser remove all the shadow computation @@ -1307,7 +1309,7 @@ void do_shadow_PUTI ( MCEnv* mce, IRRegArray* new_descr = mkIRRegArray( descr->base + mce->layout->total_sizeB, tyS, descr->nElems); - stmt( 'V', mce, IRStmt_PutI( new_descr, ix, bias, vatom )); + stmt( 'V', mce, IRStmt_PutI( mkIRPutI(new_descr, ix, bias, vatom) )); } } @@ -4992,8 +4994,8 @@ static Bool checkForBogusLiterals ( /*FLAT*/ IRStmt* st ) case Ist_Put: return isBogusAtom(st->Ist.Put.data); case Ist_PutI: - return isBogusAtom(st->Ist.PutI.ix) - || isBogusAtom(st->Ist.PutI.data); + return isBogusAtom(st->Ist.PutI.details->ix) + || isBogusAtom(st->Ist.PutI.details->data); case Ist_Store: return isBogusAtom(st->Ist.Store.addr) || isBogusAtom(st->Ist.Store.data); @@ -5222,11 +5224,7 @@ IRSB* MC_(instrument) ( VgCallbackClosure* closure, break; case Ist_PutI: - do_shadow_PUTI( &mce, - st->Ist.PutI.descr, - st->Ist.PutI.ix, - st->Ist.PutI.bias, - st->Ist.PutI.data ); + do_shadow_PUTI( &mce, st->Ist.PutI.details); break; case Ist_Store: @@ -5966,9 +5964,10 @@ static void schemeS ( MCEnv* mce, IRStmt* st ) break; case Ist_PutI: { + IRPutI *puti = st->Ist.PutI.details; IRRegArray* descr_b; IRAtom *t1, *t2, *t3, *t4; - IRRegArray* descr = st->Ist.PutI.descr; + IRRegArray* descr = puti->descr; IRType equivIntTy = MC_(get_otrack_reg_array_equiv_int_type)(descr); /* If this array is unshadowable for whatever reason, @@ -5983,12 +5982,12 @@ static void schemeS ( MCEnv* mce, IRStmt* st ) /* Compute a value to Put - the conjoinment of the origin for the data to be Put-ted (obviously) and of the index value (not so obviously). */ - t1 = schemeE( mce, st->Ist.PutI.data ); - t2 = schemeE( mce, st->Ist.PutI.ix ); + t1 = schemeE( mce, puti->data ); + t2 = schemeE( mce, puti->ix ); t3 = gen_maxU32( mce, t1, t2 ); t4 = zWidenFrom32( mce, equivIntTy, t3 ); - stmt( 'B', mce, IRStmt_PutI( descr_b, st->Ist.PutI.ix, - st->Ist.PutI.bias, t4 )); + stmt( 'B', mce, IRStmt_PutI( mkIRPutI(descr_b, puti->ix, + puti->bias, t4) )); break; }