diff options
| author | Jeff Garzik <jeff@garzik.org> | 2011-08-27 10:55:04 +0300 |
|---|---|---|
| committer | Pekka Enberg <penberg@kernel.org> | 2011-08-27 11:00:46 +0300 |
| commit | f0f961f3a2d84c368aefadd8e5fc20036bfd110e (patch) | |
| tree | 9b05e5df4d74852cbbcdc6f1ee0f5e3c536c9afb /linearize.h | |
| parent | 6071a81229aee0c44028e379edbe6f7f0e55c6cc (diff) | |
| download | sparse-dev-f0f961f3a2d84c368aefadd8e5fc20036bfd110e.tar.gz | |
sparse, llvm: if-else code generation
It gets the code a bit farther, with the following test case:
int foo(int x)
{
if (x > 0xffff)
x++;
else
x--;
return x;
}
* run with
./sparse-llvm hello.c | llvm-dis
for an IMO more useful disassembly than via 'llc'
* add 'priv' to struct basic_block
* run a first pass through the BB's, creating LLVMBasicBlockRef's and assigning
them to bb->priv
* comment out unssa() call, and implement OP_PHI and OP_PHISOURCE, which LLVM
directly supports.
* remove '%' prefix from PSEUDO_REG names, as it was redundant and made
llvm-dis output ugly
* implement support for conditional and unconditional branches (OP_BR)
* implement OP_COPY. a possibly better implementation would be a single-source
LLVMBuildPhi
[ penberg@kernel.org: minor cleanups ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'linearize.h')
| -rw-r--r-- | linearize.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/linearize.h b/linearize.h index c441c739..424ba970 100644 --- a/linearize.h +++ b/linearize.h @@ -232,6 +232,7 @@ struct basic_block { struct basic_block_list *children; /* destinations */ struct instruction_list *insns; /* Linear list of instructions */ struct pseudo_list *needs, *defines; + void *priv; }; static inline int is_branch_goto(struct instruction *br) |
