James Courtier-Dutton via llvm-dev
2020-Apr-14 20:05 UTC
[llvm-dev] Various Intermediate Representations. IR
Hi, I am looking for an IR that is similar to LLVM IR, with its SSA form, module->function->block->instruction etc. But, I wish a much reduced type model. I wish only three types: 1) An Integer of various bit-widths. 2) A pointer, but a pointer that does not need to point to a known type. A sort of "pointer to unknown type". 3) Floats of various varieties. For example, if we were using a pointer to step through an array of 32bit integers. We would use: pointer = pointer + 4; (I.e. step over 4 octets at a time) Is anyone aware of such an IR, or is there some way for trick LLVM IR into only using the above 2 types? IR already does (1) and (3). It does not seem to be able to do (2). Kind Regards James
Michael Kruse via llvm-dev
2020-Apr-14 20:23 UTC
[llvm-dev] Various Intermediate Representations. IR
Currently, LLVM often uses the *i8 type (pointer to char) to represent a pointer to some not-specified type. We are also working on replacing the pointer-to-type pointer types by a single pointer type without a specific pointee-type. Look for "opaque pointer" on llvm-dev and the repository commits. Michael Am Di., 14. Apr. 2020 um 15:06 Uhr schrieb James Courtier-Dutton via llvm-dev <llvm-dev at lists.llvm.org>:> > Hi, > > I am looking for an IR that is similar to LLVM IR, with its SSA form, > module->function->block->instruction etc. > But, I wish a much reduced type model. > I wish only three types: > 1) An Integer of various bit-widths. > 2) A pointer, but a pointer that does not need to point to a known > type. A sort of "pointer to unknown type". > 3) Floats of various varieties. > > For example, if we were using a pointer to step through an array of > 32bit integers. > We would use: pointer = pointer + 4; (I.e. step over 4 octets at a time) > > Is anyone aware of such an IR, or is there some way for trick LLVM IR > into only using the above 2 types? > IR already does (1) and (3). It does not seem to be able to do (2). > > Kind Regards > > James > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Johannes Doerfert via llvm-dev
2020-Apr-14 20:24 UTC
[llvm-dev] Various Intermediate Representations. IR
People are actually working on 2) (for a while now). Progress was made but I'm unsure where we are. If you search for "llvm opaque pointers" you find the original LLVM-Dev talk, mailing list discussions, and various patch reviews. I guess one way of achieving what you need is to accelerate the transition in LLVM-IR ;) Cheers, Johannes On 4/14/20 3:05 PM, James Courtier-Dutton via llvm-dev wrote: > Hi, > > I am looking for an IR that is similar to LLVM IR, with its SSA form, > module->function->block->instruction etc. > But, I wish a much reduced type model. > I wish only three types: > 1) An Integer of various bit-widths. > 2) A pointer, but a pointer that does not need to point to a known > type. A sort of "pointer to unknown type". > 3) Floats of various varieties. > > For example, if we were using a pointer to step through an array of > 32bit integers. > We would use: pointer = pointer + 4; (I.e. step over 4 octets at a time) > > Is anyone aware of such an IR, or is there some way for trick LLVM IR > into only using the above 2 types? > IR already does (1) and (3). It does not seem to be able to do (2). > > Kind Regards > > James > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
James Courtier-Dutton via llvm-dev
2020-Apr-15 10:16 UTC
[llvm-dev] Various Intermediate Representations. IR
On Tue, 14 Apr 2020 at 21:24, Michael Kruse <llvmdev at meinersbur.de> wrote:> > Currently, LLVM often uses the *i8 type (pointer to char) to represent > a pointer to some not-specified type. We are also working on replacing > the pointer-to-type pointer types by a single pointer type without a > specific pointee-type. Look for "opaque pointer" on llvm-dev and the > repository commits. >Hi Michael, Thank you for your reply. Does the LLVM IRBuilder currently allow adding an opaque pointer to a LLVM .bc file? Even if it does not compile, just being able to add it, would be helpful. I could then run my own experimental passes against it. Does using opaque pointers, adversely affect alias analysis? Kind Regards James