Re: [PATCH 3/3] allow to normalize the pseudos

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 5, 2017 at 12:54 PM, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> The problem that the patch here tries to solve is that *between* different
> versions of sparse, because of some subtle (or not so subtle) changes
> in the details of linearization or the optimization, a function, while
> having essentially the same intermediate code have in fact different
> name (here just the number) for its pseudos.
> And these differences are annoying when comparing results, during
> development and for the test suite. Also, given the 'problem', it's very
> fine to keep the code simple and only make the changes in a separate
> pass only used for dev & test.
>
> I have already tried several things in the past 6 months and anything
> a bit smart had some problems, it's why, finally, I opted for the brute force
> here in this patch.
>
> I think that what you propose here, will just allow to have consecutive
> pseudo numbers but I don't see how it will give the guarantee that
> "same code" will give "same pseudo numbers" and this will be easily
> be 'diffed out' so that only real differences will show up in diff output.

You will still need to reset the pseudo_base per show_entry().
That way, each function is reset the displaying pseudo to start
from 1. Same code should have the same pseudo number at the
same instruction, no?

As far as I can tell, behavior should be very  similar to your patch.
Just don't need to do a separate pass to go through each instruction.

> Well, it's true for now that we could reset the counter at each function
> and this would already 'solve' most of the cases I had. But what if
> we begin to add a second pass of automatic inlining?

That is still fine, each pseudo has its own memory allocation.
The number is just for show_instruction text output. Make sure
reset the pseudo_base inside show_entry() will force the inlined function
allocate new pseudo for different pseudo, base on the memory allocation.
If after inline two different pseudo has the same "nr", as long as they
both smaller than pseudo_base, they will be assign to different number
 in the new round.

> And keeping unique names every pseudo has advantages.

I think each pseudo do has unique pointer and storage so that did not change.
The "nr" is only for showing the text information.

If we want to be smart about comparing the output, we should have
a smarter diff against instructions. Right now if one of the basic block
use one more pseudo will likely impact other basic block because the
pseudo has shifted for other basic block, even it is the instruction code
is equivalent for other basic block.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux