Re: [RFC][PATCH 0/3] implement pseudo->ctype

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

 



I played with the new ->ctype in pseudo a little bit to generate LLVM IR.
It seems much easier to emit correct type at backend using ->ctype.

The code is available at:

git clone --recursive https://github.com/xiw/splay.git

Try `make' and `make check' if you have LLVM.

See example inputs in `test'.  Currently the generator works for simple
programs like md5.c (with -D_FORTIFY_SOURCE=0).

You can also find patches to sparse at:

https://github.com/xiw/sparse/compare/splay

- xi

On Jun 4, 2012, at 2:54 AM, Xi Wang wrote:

> This patchset tries to implement Chris's `counter RFC': adding ->ctype
> to pseudo, while removing ->type and ->size from instruction.  In this
> way, it provides easy access to type information for backend.
> 
> The first patch adds ->ctype to struct pseudo and doesn't touch struct
> instruction.  It could be applied alone if we really want backward
> compatibility.
> 
> The second patch does more destructive work.  It removes ->type and
> ->size from struct instruction and updates client uses.
> 
> The third patch updates sparse-llvm in a naive way, which should have
> been much simpler with the new ->ctype in pseudo.  I guess in some cases
> ->ctype is even necessary.  Consider the example below.
> 
> void foo(int x, ...);
> foo(1, 2, 3LL);
> 
> Is it possible to get the types of the 2nd and 3rd arguments in current
> code, which are simply PSEUDO_VAL?
> 
> Xi Wang (3):
>  add ->ctype to struct pseudo
>  remove ->type and ->size from struct instruction
>  sparse, llvm: sync with new struct instruction
> 
> cse.c         |    6 +--
> example.c     |   12 ++---
> flow.c        |   12 ++---
> linearize.c   |  147 +++++++++++++++++++++++++--------------------------------
> linearize.h   |   17 ++++---
> memops.c      |    4 +-
> simplify.c    |   24 +++++-----
> sparse-llvm.c |   50 ++++++++++----------
> sparse.c      |    2 +-
> unssa.c       |    3 +-
> 10 files changed, 131 insertions(+), 146 deletions(-)
> 
> -- 
> 1.7.9.5
> 

--
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