Commit Graph

4 Commits

Author SHA1 Message Date
Alvise de Faveri ad524a4d4d ModelGEP: Return the size of the gepped field
ModelGEP calls in LLVM IR now return an integer that has the same
size of the field being addressed by the ModelGEP.

AddressOf calls, instead, can accept any integer size as argument but
always return a pointer-sized integer.
2022-06-28 10:14:10 +02:00
Alvise de Faveri 189fbe4651 Support: Fix the key for OpaqueExtractValue pool
Calls to `OpaqueExtractValue()` are meant to replace `extractvalue`s
found in the LLVM IR. Since the type of an `OpaqueExtractValue` is
identified by both the return type (extracted value) and the first
argument's type (aggregate operand of the `extractvalue` instruction),
we need to consider both when building the associated FunctionPool.

Previously, we were identifying each `OpaqueExtractValue` variant using
only the returned value, which was wrong. In fact, if we have two
`extractvalue` instructions that extract a value of the same type
(e.g. i32) from two different aggregate types (e.g. structA and
structB), we have to define two different `OpaqueExtractValue`: one
that returns an i32 and has a parameter of type structA, and one that
returns an i32 and has a parameter of structB. If we use only the
return type, we are not able to distinguish the two.
2022-06-01 11:05:31 +02:00
Giacomo Vercesi ab125b35b0 Fix License headers
Change company name to "rev.ng Labs Srl" in all license headers
to reflect changed company name and legal status
Add missing license headers to files that didn't have one
2022-04-19 12:17:59 +02:00
Alvise de Faveri 8230d91da7 Add RemoveExtractValues and RestoreExtractValues
* RemoveExtractValues transforms every `extractvalue` instruction
  into an opaque call. This prevents the optimization pipeline from
  moving around and optimizing `extractvalue`s, since they have a
  particular meaning in our IR
* RestoreExtractValues transforms such opaque calls back to regular
  `extractvalue`s at the end of the pipeline
2022-03-31 10:49:13 +02:00