summary refs log tree commit diff
path: root/alias.c
AgeCommit message (Collapse)Author
2022-11-22use a new struct for symbolsQuentin Carbonneaux
Symbols are a useful abstraction that occurs in both Con and Alias. In this patch they get their own struct. This new struct packages a symbol name and a type; the type tells us where the symbol name must be interpreted (currently, in gobal memory or in thread-local storage). The refactor fixed a bug in addcon(), proving the value of packaging symbol names with their type.
2022-11-20export getalias()Quentin Carbonneaux
We will be using it in the new coalesce() pass.
2022-11-20make multiple calls to fillalias() possibleQuentin Carbonneaux
The asserts (a->type == ABot) made it impossible to run fillalias() multiple times. We now reset the Alias.type field of all temps before starting. Getting rid of the asserts would have been another option.
2022-11-20stored bytes in Alias informationQuentin Carbonneaux
Stack slots may have padding bytes, and if we want to have precise liveness information it's important that we are able to tell them apart. This patch extends fillalias() to remember for every slot what bytes were ever assigned. In case the slot address does not escape we know that only these bytes matter. To save space, we only store this information if the slot size is less than or equal to NBit. The Alias struct was reworked a bit to save some space. I am still not very satisfied with its layout though.
2022-11-20argc does not leak its address argumentQuentin Carbonneaux
2022-11-20make Alias.base an intQuentin Carbonneaux
We had the invariant that it'd always be a temporary.
2022-10-08"rel" fields become "reloc"Quentin Carbonneaux
2022-10-08do not drop relocation kind in alias analysisQuentin Carbonneaux
2019-02-18mark phi arguments as escapingQuentin Carbonneaux
Thanks to Michael Forney for spotting this oversight and providing the test case. Note: because esc() leaves ABot unchanged, the assertion "a->type == ABot" on line 122 remains valid.
2017-05-17intern symbol namesQuentin Carbonneaux
Symbols in the source file are still limited in length because the rest of the code assumes that strings always fit in NString bytes. Regardless, there is already a benefit because comparing/copying symbol names does not require using strcmp()/strcpy() anymore.
2017-04-10simplify slot logic in alias analysisQuentin Carbonneaux
The previous code was buggy. It would put a stack pointer on the heap when handling "add $foo, 42". The new code is more straightforward and hopefully more correct. Only temporaries with a "stack" alias class will have a slot pointer.
2017-02-24fix pretty bad bug in alias analysisQuentin Carbonneaux
When a temporary marked local is escaping, the whole slot must be marked as such. To solve this, Alias now holds a pointer to the alias information of the slot. For simplicity of the code, this pointer is always valid and fetching ->type out of it is meaningful.
2017-02-23propagate aliasing information through copiesQuentin Carbonneaux
2017-02-06use uint for block idsQuentin Carbonneaux
2016-12-12implement a simple alias analysisQuentin Carbonneaux