Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Pointer Constant?"
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,
2011 May 12
3
[LLVMdev] Vtables for non c++ languages
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 single-dispatch functions?
Thanks,
Timothy
--
“One of the main causes of the fall of the Roman Empire was
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
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...
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
4
[LLVMdev] NVPTX CUDA_ERROR_NO_BINARY_FOR_GPU
I'm building this with llvm-c, and accessing these intrinsics via calling
the intrinsic as if it were a function.
class F_SREG<string OpStr, NVPTXRegClass regclassOut, Intrinsic IntOp> :
NVPTXInst<(outs regclassOut:$dst), (ins),
OpStr,
[(set regclassOut:$dst, (IntOp))]>;
def INT_PTX_SREG_TID_X : F_SREG<"mov.u32 \t$dst, %tid.x;",
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
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
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
2009 Jan 19
6
[LLVMdev] Load from abs address generated bad code on LLVM 2.4
This is x86_64. I have a problem where an absolute memory load
define i32 @foo() {
entry:
%0 = load i32* inttoptr (i64 12704196 to i32*) ; <i32> [#uses=1]
ret i32 %0
}
generates incorrect code on LLVM 2.4:
0x7ffff6d54010: mov 0xc1d9c4(%rip),%eax # 0x7ffff79719da
0x7ffff6d54016: retq
should be
0x7ffff6d54010: mov 0xc1d9c4, %eax
0x7ffff6d54016: retq
2006 Aug 22
1
[LLVMdev] Porting LLVM to irix.
Greetings!
As part of a compiler project I am working on, I am interested in
porting LLVM to Irix/MIPS. I figure I could start by working with the
bytecode to C translation part of LLVM. However, when I run configure,
llvm is saying that it does not recognize the host I am working with.
Are there any documents about how to port to a new OS/Instruction set?
Thanks,
Timothy
--
"... one of
2009 Jan 19
1
[LLVMdev] Load from abs address generated bad code on LLVM 2.4
Andrew Haley <aph at redhat.com> writes:
> Óscar Fuentes wrote:
>> The following message is a courtesy copy of an article
>> that has been posted to gmane.comp.compilers.llvm.devel as well.
>>
>> Andrew Haley <aph at redhat.com> writes:
>>
>>> This is x86_64. I have a problem where an absolute memory load
>>>
>>> define
2006 Aug 22
1
[LLVMdev] Bug with AutoConfig.sh
Maybe I'm not doing something right here, but there is a rather simple
bug in the Autoconfig.sh script. It currently checks for the version
numbers in aclocal and libtool. However it only accepts a certain
value, instead of that version and all newer versions. Is there a
reason for this? Or is this a bug?
Timothy
--
"... one of the main causes of the fall of the Roman Empire was that,
2009 Jan 21
0
[LLVMdev] Load from abs address generated bad code on LLVM 2.4
Óscar Fuentes wrote:
> Andrew Haley <aph at redhat.com> writes:
>
>> Óscar Fuentes wrote:
>>> The following message is a courtesy copy of an article
>>> that has been posted to gmane.comp.compilers.llvm.devel as well.
>>>
>>> Andrew Haley <aph at redhat.com> writes:
>>>
>>>> This is x86_64. I have a problem where an
2008 Dec 16
2
[LLVMdev] OpenCL Frontend
There seems to be some interest these days in OpenCL. However for some
projects, a issue they face to adopting OpenCL is requirements of
maintaining two source trees: one for normal C code (for use on
systems without OpenCL support or poor OpenCL performance) and another
for OpenCL.
I am interested in using LLVM to create a OpenCL frontend for
multicore CPUs. Now that the spec is out, we have a
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
2008 Dec 16
0
[LLVMdev] OpenCL Frontend
On Tuesday 16 December 2008 12:21:24 Timothy Baldridge wrote:
> There seems to be some interest these days in OpenCL. However for some
> projects, a issue they face to adopting OpenCL is requirements of
> maintaining two source trees: one for normal C code (for use on
> systems without OpenCL support or poor OpenCL performance) and another
> for OpenCL.
>
> I am interested in
2009 Jun 11
2
[LLVMdev] Access a specific address in the JIT compiler
Hi,
I am using the JIT compiler to execute code that must interface with
the running process.
I would like to access some specific addresses.
The solution I found is to create a global variable for each address I
want to reference, and pass it as a mapping to the ExecutionEngine
with addGlobalMapping.
Is that how I should do this?
Is there no way to just reference the addresses with constants?