similar to: [LLVMdev] Vtables for non c++ languages

Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] Vtables for non c++ languages"

2011 May 12
0
[LLVMdev] Vtables for non c++ languages
On Wed, May 11, 2011 at 8:54 PM, Timothy Baldridge <tbaldridge at gmail.com>wrote: > I'm working on implementing a simple functional language in LLVM. It's > statically typed, but I'd like to a have some simple multimethods involved. > Does LLVM have some intrinsics for handling something like C++ vtables? Or > do I need to implement my own way of handling
2011 Jul 01
3
[LLVMdev] Pointer Constant?
I'm writing a JIT for my toy language, and I'm confused by one thing. How do I, with IR Builder, Insert a pointer constant? For the first version of my jit, I really only need LLVM to pass around opaque types and then pass those variables to C functions that return other opaque types. So for instance, I have a Int object that wraps the GNU GMP routines. A want to be able to tell IRBuilder
2011 May 12
2
[LLVMdev] Pre-built LLVM shared libs for Windows?
I'd like to do some simple C# -> LLVM C API bindings for windows. Is there a place I can get pre-built LLVM .dlls for windows? Thanks Timothy -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -------------- next part -------------- An HTML attachment was scrubbed...
2011 Jul 02
0
[LLVMdev] Pointer Constant?
1. Create an extern global variable of the type being pointed to. Use ExecutionEngine::addGlobalMapping to map that extern global variable to the pointer. Then your IR code can refer to the extern global variable and get the pointer. 2. Convert the pointer to an int. Create an int constant in IR. Then add an inttoptr instruction, and your IR has the pointer constant. Last I checked, though,
2014 Jan 17
2
[LLVMdev] Invalid RegNum error
I'm writing a compiler using LLVM, and suddenly today I started to get this error, when emitting to a .s file. Assertion failed: (I != M+Size && I->FromReg == RegNum && "Invalid RegNum"), function getLLVMRegNum, file MCRegisterInfo.cpp, line 78. I'm emitting using x86_64-apple-darwin. Any thoughts about what could be causing this? LLVM validation does not
2011 Jun 28
2
[LLVMdev] Box removal
In the creation of dynamic languages we often have to box values together. For instance, take the following expression: IntObj c = sqrt((a*a)+(b*b)); Here, most likely, a bytecode interpreter would execute this as "mul_ints", "add_ints", "sqrt", etc. Inside these primitive functions we would have to unwrap our IntObj types, add the values, allocate a new object and
2017 May 29
2
Dumping the Vtable
Hi, Can someone help me with how to dump the vtable and the vptr addresses within it? Thanks, Dami -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170529/5dc7e058/attachment.html>
2013 Mar 05
2
[LLVMdev] Bad Instruction 4 with fastcc
On OSX I thought I'd try to optimize my compiler a bit by switching some of the calling conventions from CCallingConv to FastCC. The compiler ran fine, but when I executed the code, I got "Bad Instruction 4". I'm seeing some other mentions on this mailing list of issues like this on OSX (I'm using 10.8). Is there anything I need to change to enable fastcc with my compiler? I
2017 Jan 25
4
RFC: Emitting empty invariant group for vtable loads
Hi Piotr, I think makes sense. Modulo bitcasts, the invariant is identified by a particular pointer SSA value. Given that you can't sensibly have two nonequivalent invariants associated with the same pointer SSA value simultaneously, there's no need to also identify the invariant with a metadata string as well. When we need a new "identifier" for the pointed-to value, we
2017 Jan 26
2
[cfe-dev] RFC: Emitting empty invariant group for vtable loads
2017-01-26 3:28 GMT+01:00 Richard Smith <richard at metafoo.co.uk>: > On 25 January 2017 at 15:03, Hal Finkel via cfe-dev < > cfe-dev at lists.llvm.org> wrote: > >> Hi Piotr, >> >> I think makes sense. Modulo bitcasts, the invariant is identified by a >> particular pointer SSA value. Given that you can't sensibly have two >> nonequivalent
2017 Jan 28
2
[cfe-dev] RFC: Emitting empty invariant group for vtable loads
2017-01-26 15:41 GMT+01:00 Hal Finkel <hfinkel at anl.gov>: > > On 01/26/2017 06:44 AM, Piotr Padlewski wrote: > > > > 2017-01-26 3:28 GMT+01:00 Richard Smith <richard at metafoo.co.uk>: > >> On 25 January 2017 at 15:03, Hal Finkel via cfe-dev < >> cfe-dev at lists.llvm.org> wrote: >> >>> Hi Piotr, >>> >>> I think
2017 Jan 31
0
[cfe-dev] RFC: Emitting empty invariant group for vtable loads
On 01/28/2017 10:36 AM, Piotr Padlewski wrote: > > > 2017-01-26 15:41 GMT+01:00 Hal Finkel <hfinkel at anl.gov > <mailto:hfinkel at anl.gov>>: > > > On 01/26/2017 06:44 AM, Piotr Padlewski wrote: >> >> >> 2017-01-26 3:28 GMT+01:00 Richard Smith <richard at metafoo.co.uk >> <mailto:richard at metafoo.co.uk>>: >>
2012 Dec 26
1
[LLVMdev] Proper values for LLVMCreateTargetMachine
I can't seem to get LLVMCreateTargetMachine to work on my box (MBP i7 OS X 10.8). What should the values of triple, cpu and features be? I'm just looking for a way to get this up and going for now, I don't need specific optimizations. No matter what I send the function, I always get nil back. I'm giving it LLVMGetFirstTarget as the target value. Thanks for the help, Timothy
2013 Jan 22
1
[LLVMdev] Compiling to NVPTX
I'm in the process of writing a library and giving a talk about writing compilers using LLVM (llvm-c) and Clojure. As part of my talk I'd like to give an example of a program running on CUDA. Are there any papers, tutorials, examples, on writing a custom frontend for NVPTX? For instance, I'm trying to figure out how to get access to "global" variables like blockidx. I know
2017 Jun 19
2
[CFI] Manually linking classes that have no inheritance link
As you noted the class links are actually of the whitelisting kind and not of the blacklisting kind. Doing this with an attribute is pretty interesting and sounds like a better fit to me. I think this could look something like: __attribute__((compatible_vtable_layout("JSComponentMath", "JSComponentImage"))) class ProxyClass{ public: ... } Would this be more admissible? On
2012 Mar 19
5
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
Hello, While instrumenting LLVM IR in ThreadSanitizer (race detector), I need to distinguish between a store to vtable pointer (vptr) and any other regular store. This special treatment should be limited to class DTORs, so I should also know when a function is a DTOR. Rationale: need to distinguish benign and harmful races on vptr (
2013 Mar 01
1
[LLVMdev] NVPTX CUDA_ERROR_NO_BINARY_FOR_GPU
The identifier INT_PTX_SREG_TID_X is the name of an instruction as the back-end sees it, and has very little to do with the name you should use in your IR. Your best bet is to look at the include/llvm/IR/IntrinsicsNVVM.td file and see the definitions for each intrinsic. Then, the name mapping is just: int_foo_bar -> llvm.foo.bar() int_ prefix becomes llvm., and all underscores turn into
2013 Mar 01
0
[LLVMdev] NVPTX CUDA_ERROR_NO_BINARY_FOR_GPU
Hi Timothy, I'm not sure what you mean by this working for other intrinsics, but in this case, I think you want the intrinsic name llvm.nvvm.read.ptx.sreg.tid.x. For me, this looks like: %x = call i32 @llvm.nvvm.read.ptx.sreg.tid.x() Pete On Fri, Mar 1, 2013 at 11:51 AM, Timothy Baldridge <tbaldridge at gmail.com> wrote: > I'm building this with llvm-c, and accessing these
2017 Mar 31
2
Dereferenceable load semantics & LICM
Hi all, I have a question about dereferenceable metadata on load instruction. I have a patch (https://reviews.llvm.org/D31539) for LICM that hoists loads with !invariant.group. The motivation example is devirtualization: struct A { virtual void foo(); }; int bar(); void indirect(A &a) { while(bar()) a.foo(); } With -O2 -fstrict-vtable-pointers we get: define void
2012 Mar 19
0
[LLVMdev] recognizing DTORs and vptr updates in LLVM.
On Mar 19, 2012, at 2:52 PM, Kostya Serebryany wrote: > Hello, > > While instrumenting LLVM IR in ThreadSanitizer (race detector), I need to distinguish between a store to vtable pointer (vptr) and any other regular store. > This special treatment should be limited to class DTORs, so I should also know when a function is a DTOR. > Rationale: need to distinguish benign and