mirror of
git://c9x.me/qbe.git
synced 2026-04-05 09:59:47 +00:00
parseref() has code to reuse address constants, but this is not done in other passes such as fold or isel. Introduce a new function newcon() which takes a Con and returns a Ref for that constant, and use this whenever creating address constants. This is necessary to fix folding of address constants when one operand is already folded. For example, in %a =l add $x, 1 %b =l add %a, 2 %c =w loadw %b %a and %b were folded to $x+1 and $x+3 respectively, but then the second add is visited again since it uses %a. This gets folded to $x+3 as well, but as a new distinct constant. This results in %b getting labeled as bottom instead of either constant, disabling the replacement of %b by a constant in subsequent instructions (such as the loadw). |
||
|---|---|---|
| amd64 | ||
| arm64 | ||
| doc | ||
| minic | ||
| test | ||
| tools | ||
| .gitignore | ||
| .tag | ||
| alias.c | ||
| all.h | ||
| cfg.c | ||
| copy.c | ||
| fold.c | ||
| gas.c | ||
| LICENSE | ||
| live.c | ||
| load.c | ||
| main.c | ||
| Makefile | ||
| mem.c | ||
| ops.h | ||
| parse.c | ||
| README | ||
| rega.c | ||
| spill.c | ||
| ssa.c | ||
| util.c | ||
QBE - Backend Compiler http://c9x.me/compile/ doc/ Documentation. minic/ An example C frontend for QBE. tools/ Miscellaneous tools (testing). test/ Tests. amd64/ arm64/ Architecture-specific code. The LICENSE file applies to all files distributed. - Compilation Invoke GNU make in this directory to create the executable file obj/qbe. On some systems (BSD) you might have to use 'gmake' instead of 'make'.