|
From: Maurice v. d. P. <gri...@ge...> - 2004-11-01 18:30:01
|
Hi, Yesterday I submitted a wishlist item to bugzilla that can be found here: http://bugs.kde.org/show_bug.cgi?id=3D92456 The idea is to not only report the use of undefined values, but also=20 where the undefined values were copied from. The comments on the bug=20 report describe it in more detail. What I am interested in is how feasible people think the approach from=20 comment #2 onwards is. The feasibility depends on things like how much=20 copying of undefined values is done and for how long the copies persist. Again the report describes it more clearly. I would like to do some testing to gather numbers on this, but maybe there are people on this list that already have insights into this or even know of some things that have been overlooked. Regards, Maurice. --=20 Maurice van der Pot Gentoo Linux Developer gri...@ge... http://www.gentoo.org Creator of BiteMe! gri...@kf... http://www.kfk4ever.com |
|
From: Nicholas N. <nj...@ca...> - 2004-11-02 09:28:25
|
On Mon, 1 Nov 2004, Maurice van der Pot wrote: > Yesterday I submitted a wishlist item to bugzilla that can be found here: > > http://bugs.kde.org/show_bug.cgi?id=92456 > > The idea is to not only report the use of undefined values, but also > where the undefined values were copied from. The comments on the bug > report describe it in more detail. > > > What I am interested in is how feasible people think the approach from > comment #2 onwards is. The feasibility depends on things like how much > copying of undefined values is done and for how long the copies persist. > Again the report describes it more clearly. > > I would like to do some testing to gather numbers on this, but maybe > there are people on this list that already have insights into this > or even know of some things that have been overlooked. Note that some further discussion of this has taken place at bugs.kde.org/show_bug.cgi?id=92456, in case anyone wants to follow it. N |
|
From: Maurice v. d. P. <gri...@ge...> - 2004-11-07 14:29:32
|
Hi,
I've been studying valgrind's source and I have a few questions.
1) Is it allowed to simply call VG_(synth_ccall) multiple times from=20
within synth_LOADV for instance? I was planning something like=20
this:
VG_(synth_ccall) ( helper, 1, 1, argv, tagv, tv_reg,
regs_live_before, regs_live_after );
UInt argv2[] =3D { a_reg, tv_reg };
Tag tagv2[] =3D { RealReg, RealReg };
VG_(synth_ccall) ( helper2, 2, 2, argv2, tagv2, INVALID_REALREG,
regs_live_after, regs_live_after );
2) Is there a way to get to a register itself instead of the value it
contains, from a helper function? In helper2 I would like to somehow
modify some information about tv_reg dependent on both tv_reg's own=20
value and the value of a_reg.
3) Alternatively i might want to add code to do this to the first helper
function. Is it possible to get to the register that will receive the
return value? Or should I modify synth_ccall to receive not only the
return value but also the extra information that needs to be remembered
about the return value register?
I hope I'm making sense.
Best regards,
Maurice.
--=20
Maurice van der Pot
Gentoo Linux Developer gri...@ge... http://www.gentoo.org
Creator of BiteMe! gri...@kf... http://www.kfk4ever.com
|
|
From: Nicholas N. <nj...@ca...> - 2004-11-07 15:43:20
|
On Sun, 7 Nov 2004, Maurice van der Pot wrote:
> 1) Is it allowed to simply call VG_(synth_ccall) multiple times from
> within synth_LOADV for instance? I was planning something like
> this:
>
> VG_(synth_ccall) ( helper, 1, 1, argv, tagv, tv_reg,
> regs_live_before, regs_live_after );
>
> UInt argv2[] = { a_reg, tv_reg };
> Tag tagv2[] = { RealReg, RealReg };
>
> VG_(synth_ccall) ( helper2, 2, 2, argv2, tagv2, INVALID_REALREG,
> regs_live_after, regs_live_after );
No, as this comment says:
WARNING: a UInstr should *not* be translated with synth_ccall followed
by some other x86 assembly code; vg_liveness_analysis() doesn't expect
such behaviour and everything will fall over.
> 2) Is there a way to get to a register itself instead of the value it
> contains, from a helper function? In helper2 I would like to somehow
> modify some information about tv_reg dependent on both tv_reg's own
> value and the value of a_reg.
>
>A 3) Alternatively i might want to add code to do this to the first helper
> function. Is it possible to get to the register that will receive the
> return value? Or should I modify synth_ccall to receive not only the
> return value but also the extra information that needs to be remembered
> about the return value register?
If it's only LOADV that you want to augment, I would add an extra arg to
the functions that get called by LOADV, and pass in whatever extra info
you need that way, if you see what I mean.
N
|
|
From: Maurice v. d. P. <gri...@ge...> - 2004-11-07 19:01:13
|
On Sun, Nov 07, 2004 at 03:43:00PM +0000, Nicholas Nethercote wrote: > On Sun, 7 Nov 2004, Maurice van der Pot wrote: =20 > >2) Is there a way to get to a register itself instead of the value it > > contains, from a helper function? In helper2 I would like to somehow > > modify some information about tv_reg dependent on both tv_reg's own > > value and the value of a_reg. > > > >A 3) Alternatively i might want to add code to do this to the first help= er > > function. Is it possible to get to the register that will receive the > > return value? Or should I modify synth_ccall to receive not only the > > return value but also the extra information that needs to be remembered > > about the return value register? >=20 > If it's only LOADV that you want to augment, I would add an extra arg to= =20 > the functions that get called by LOADV, and pass in whatever extra info= =20 > you need that way, if you see what I mean. It's not only LOADV. For each move of V bits I also need the origin address so I can update the administration that keeps track of the origin.=20 I'd prefer to do all this stuff in C functions, so I would like to use the= =20 synth_ccall/synth_call(?) functions. What is the exact restriction on calli= ng synth_ccall? At most once at the end of a function? Or must it be the only code generating part of a synth_INSTR call?=20 At the moment I'm not sure where I can insert my own code for all these=20 synth_INSTR calls. Regards, Maurice. --=20 Maurice van der Pot Gentoo Linux Developer gri...@ge... http://www.gentoo.org Creator of BiteMe! gri...@kf... http://www.kfk4ever.com |
|
From: Nicholas N. <nj...@ca...> - 2004-11-07 19:26:32
|
On Sun, 7 Nov 2004, Maurice van der Pot wrote: > I'd prefer to do all this stuff in C functions, so I would like to use the > synth_ccall/synth_call(?) functions. synth_ccall() is for calling C functions, synth_call is for calling asm subroutines. You want synth_ccall(). > What is the exact restriction on calling > synth_ccall? At most once at the end of a function? Or must it be the only > code generating part of a synth_INSTR call? The latter, IIRC. > At the moment I'm not sure where I can insert my own code for all these > synth_INSTR calls. I would still recommend passing extra args to the relevant C functions rather than doing extra C function calls; C calls are expensive. N |
|
From: Maurice v. d. P. <gri...@ge...> - 2004-11-07 20:31:56
|
On Sun, Nov 07, 2004 at 07:26:27PM +0000, Nicholas Nethercote wrote: > On Sun, 7 Nov 2004, Maurice van der Pot wrote: >=20 > >At the moment I'm not sure where I can insert my own code for all these > >synth_INSTR calls. >=20 > I would still recommend passing extra args to the relevant C functions=20 > rather than doing extra C function calls; C calls are expensive. I agree, but unfortunately only LOADV and STOREV call C functions. The=20 rest just emits instructions. Maurice. --=20 Maurice van der Pot Gentoo Linux Developer gri...@ge... http://www.gentoo.org Creator of BiteMe! gri...@kf... http://www.kfk4ever.com |
|
From: Maurice v. d. P. <gri...@ge...> - 2004-11-27 16:12:34
|
Hey guys,
On Sun, Nov 07, 2004 at 03:29:08PM +0100, I wrote:
> 1) Is it allowed to simply call VG_(synth_ccall) multiple times from=20
> within synth_LOADV for instance? I was planning something like=20
> this:
>=20
> VG_(synth_ccall) ( helper, 1, 1, argv, tagv, tv_reg,
> regs_live_before, regs_live_after );
>=20
> UInt argv2[] =3D { a_reg, tv_reg };
> Tag tagv2[] =3D { RealReg, RealReg };
>=20
> VG_(synth_ccall) ( helper2, 2, 2, argv2, tagv2, INVALID_REALREG,
> regs_live_after, regs_live_after );
I would say that this example is valid and that liveness analysis will
work just fine. For functions other than synth_LOADV and synth_STOREV
I will have to do something more though. I'm thinking that the other
functions (e.g. synth_SETV) do not change the liveness of the registers=20
because they are not passed regs_live_before and regs_live_after.=20
To be able to call a C function from these, I'd have to change that.
I know C calls are very slow, but I'd like to first do a proof of=20
concept implementation and then, if it turns out to work, see if I can
find a better way to implement it.
> 2) Is there a way to get to a register itself instead of the value it
> contains, from a helper function? In helper2 I would like to somehow
> modify some information about tv_reg dependent on both tv_reg's own=20
> value and the value of a_reg.
I haven't found an answer to this question yet. What I am trying to do is
keep track of the origin of values while they are being copied around. If
for instance LOADV is executed, I should be able to take the information=20
that is associated with the address and store it so it is associated with
the register. All I need to do this is a unique and constant id of the=20
register involved. When at a later time STOREV is executed for the same
register, I should be able to use the id that I get to retrieve the informa=
tion
=66rom the administration I keep.
> 3) Alternatively i might want to add code to do this to the first helper
> function. Is it possible to get to the register that will receive the
> return value? Or should I modify synth_ccall to receive not only the
> return value but also the extra information that needs to be remembered
> about the return value register?
This is still an option if it is possible.
A last option that I see is to pass an id of the register as another=20
parameter to the helper. That would be possible if register allocation
is done before the synth_LOADV etc functions are called, right?
I was thinking of something like this:
UInt argv2[] =3D { a_reg, tv_reg, tv_reg };
Tag tagv2[] =3D { RealReg, RealReg, Literal };
=20
VG_(synth_ccall) ( helper2, 3, 3, argv2, tagv2, INVALID_REALREG,
regs_live_after, regs_live_after );
But that didn't work.
Maurice.
--=20
Maurice van der Pot
Gentoo Linux Developer gri...@ge... http://www.gentoo.org
Creator of BiteMe! gri...@kf... http://www.kfk4ever.com
|