Commit graph

16 commits

Author SHA1 Message Date
Quentin Carbonneaux
5fee3da6ac rename blknew() to newblk()
This is consistent with newtmp()
and newcon().
2023-03-22 11:43:46 +01:00
Quentin Carbonneaux
70f297bab7 fix case of Pool constants 2022-10-03 10:41:30 +02:00
Michael Forney
2cba9f6871 cfg: remove unnecessary check for jump type
This condition should match any jump with two successors. This is
needed on riscv64, where there is no flags register, so Jjnz is
used all the way to emit().
2022-02-17 22:35:22 +01:00
Quentin Carbonneaux
7ba69be87b fuse epilog deduplication with jump threading 2019-05-05 15:19:32 +02:00
Quentin Carbonneaux
ae80e4f7ca fix bug in jumps simplification
In presence of jump loops, the algorithm would
create cycles in the disjoint-set data structure.
This caused infinite recursion and stack overflows.
2017-08-17 04:50:22 -04:00
Quentin Carbonneaux
49a4593c33 prepare for multi-target
This big diff does multiple changes to allow
the addition of new targets to qbe.  The
changes are listed below in decreasing order
of impact.

1. Add a new Target structure.

To add support for a given target, one has to
implement all the members of the Target
structure.  All the source files where changed
to use this interface where needed.

2. Single out amd64-specific code.

In this commit, the amd64 target T_amd64_sysv
is the only target available, it is implemented
in the amd64/ directory.  All the non-static
items in this directory are prefixed with either
amd64_ or amd64_sysv (for items that are
specific to the System V ABI).

3. Centralize Ops information.

There is now a file 'ops.h' that must be used to
store all the available operations together with
their metadata.  The various targets will only
select what they need; but it is beneficial that
there is only *one* place to change to add a new
instruction.

One good side effect of this change is that any
operation 'xyz' in the IL now as a corresponding
'Oxyz' in the code.

4. Misc fixes.

One notable change is that instruction selection
now generates generic comparison operations and
the lowering to the target's comparisons is done
in the emitter.

GAS directives for data are the same for many
targets, so data emission was extracted in a
file 'gas.c'.

5. Modularize the Makefile.

The Makefile now has a list of C files that
are target-independent (SRC), and one list
of C files per target.  Each target can also
use its own 'all.h' header (for example to
define registers).
2017-04-08 21:56:20 -04:00
Quentin Carbonneaux
f151e42658 remove unused parameter from uffind() 2017-02-27 12:01:48 -05:00
Quentin Carbonneaux
4c3c80e7e1 minor tweaks to simpljmp pass 2017-02-27 11:54:55 -05:00
Quentin Carbonneaux
e80252a52b scrub assembly output
Notably, this adds a new pass to get rid of
jumps on jumps.
2017-02-27 10:34:29 -05:00
Quentin Carbonneaux
c71f44c5a8 update assert() missed in 7e1c1f 2017-02-07 21:56:00 -05:00
Quentin Carbonneaux
8215b50a10 fix edge deletion bug in sccp
When an edge is deleted, the phis and predecessors of the
destination block have to be updated.  This is what blkdel()
was doing, but at a level too coarse.  The new function
edgedel() allows to remove a single edge (and takes care of
multiple edges).
2017-02-06 15:58:09 -05:00
Quentin Carbonneaux
1a76fd11f5 robustness fix in fillfron()
This makes it possible to call it several times in a row.
2017-02-06 14:37:43 -05:00
Quentin Carbonneaux
7e1c1f9f77 use uint for block ids 2017-02-06 14:36:27 -05:00
Quentin Carbonneaux
2b4ece6f99 use a less obtuse api for vnew() 2017-01-12 22:31:51 -05:00
Quentin Carbonneaux
3c3afdc896 schedule loop nesting computations earlier 2016-12-21 09:56:40 -05:00
Quentin Carbonneaux
12f9d16c7b create cfg.c for cfg-related functions 2016-12-12 22:16:57 -05:00