similar to: [LLVMdev] How to create an IntegerType of the native word size

Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] How to create an IntegerType of the native word size"

2009 Mar 08
2
[LLVMdev] Creating Pointer Constants
Hello, I am writing a JIT compiler for a subset of the Matlab language and as a part of my implementation, I would like to be able to pass a constant pointer to a native function I'm calling. Right now, this is what I do: llvm::Constant* constInt = llvm::ConstantInt::get(llvm::Type::Int64Ty, (int64)thePointer); llvm::Value* constPtr = llvm::ConstantExpr::getIntToPtr(constInt,
2020 Jan 14
2
sizeof implementation: how to get size as a constantInt?
I'm implementing c style "sizeof()", and I did as http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt illuarstrated, and it works find, here's an example of my implementation: auto *p = builder.CreateGEP(structTy, llvm::ConstantPointerNull::get(pointerTy), constint1); auto *size =
2008 Jul 01
2
[LLVMdev] vmkit on x86_64
Hello, I'm trying to compile vmkit on a x86_64 linux box with gcc-4.1.2, but I'm running into troubles because of various problems with casts between pointers and integers. Is there anybody who succeeded in this task? Az I see, some of the problems can be fixed with an appropriate typedef/macro declaration, but in VMCore/JavaObject.cpp some lowlevel bitmanipulation is used, to mark
2008 Jul 01
0
[LLVMdev] vmkit on x86_64
Hi Zsombor, Thanks for the patch! Unfortunately I can't apply it because the llvm API has moved from BinaryOperator::create to BinaryOperator::Create. Are you using svn head? Now on the x86_64 part. There has been very little work on porting vmkit on x86_64. If you're having compilation problems, I suppose it's in the garbage collector directory (GCMmap2). If you could make the
2011 Jan 27
2
[LLVMdev] Passing command line arguments to optimization passes
Hi all, I was wondering if there's any way to pass command line arguments to LLVM optimization passes when run through the opt tool. For example, suppose I register called MyPass, then I want to run opt -load libMyPass.so -MyPass 3 < input.bc and have "3" be available to MyPass as a kind of argv argumnet through some method. Or does it take a major rewrite of the opt tool
2012 Mar 04
3
[LLVMdev] Passing arguments to opt via clang
Thanks, but I'm not sure I understand. I see no such flag in clang 2.9 nor couldn't I find any mention of it. What does it do? Harel Cain On Sun, Mar 4, 2012 at 15:03, Anton Korobeynikov <anton at korobeynikov.info>wrote: > > In the good old llvmc, the -Wo flag could be used to pass arguments to > the > > optimizer. Is there a similar mechanism anywhere for clang?
2010 Dec 05
1
[LLVMdev] Weak private linkage for Objective C
Hi all, I've been subscribed to this list on-and-off and always found it very helpful. I'm facing the problem of compiling a project in Objective C with LLVM in a Darwin environment. There is a certain Objective C protocol that appears in two .m files, and so the corresponding l_OBJC_PROTOCOL and l_OBJC_LABEL_PROTOCOL symbols appear in both .o files. The problem is that while these
2011 Jan 27
2
[LLVMdev] Passing command line arguments to optimization passes
A follow-up question: Is there a way to make different passes accept one command line option that will affect all of them? For example, I'd like to have a -optStrength parameter, that can be given to all of my passes simultaneously. Thanks a lot, Guy Arnaud Allard de Grandmaison wrote: > > Hi Harel, > > Several existing passes can take command line arguments. Have a look at
2011 Oct 27
2
[LLVMdev] Resolving sizeof's; target triples; type optimizations
Hi all, A few different though somewhat related questions here. I'm really grateful for your answers! 1. From a previous question I know that sizeof's are resolved into literals early in the front-end before IR is even emitted. It seems that they are resolved into whatever value is correct for the host machine. But if one wishes to then take the IR and emit assembly code for some other
2009 Mar 11
0
[LLVMdev] Creating Pointer Constants
On 2009-03-08, at 12:46, Nyx wrote: > I am writing a JIT compiler for a subset of the Matlab language and > as a > part of my implementation, I would like to be able to pass a constant > pointer to a native function I'm calling. > > Right now, this is what I do: > > llvm::Constant* constInt = llvm::ConstantInt::get(llvm::Type::Int64Ty, > (int64)thePointer); >
2012 Feb 20
2
[LLVMdev] Invalid relocation types for Thumb in LLVM version 2.9
Hi all, I'm trying to figure out a problem with relocation types 1 and 8 (as observed using otool -r on ARM/Thumb object files). Earlier, when I used LLVM 2.8 with llc to generate thumb (-march=thumb -mattr=+thumb2) assembly listings, then assemble those using the gcc of iPhone 4.2 SDK, there wasn't any problem. However starting with LLVM 2.9, the same toolchain emits slightly different
2011 Jan 27
0
[LLVMdev] Passing command line arguments to optimization passes
Hi Harel, Several existing passes can take command line arguments. Have a look at lib/Transforms/Scalar/LoopUnrollPass.cpp for example. Its command line arguments are defined using the cl::opt objects. Best regards, -- Arnaud de Grandmaison ________________________________ From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Harel Cain Sent: Thursday, January
2008 Jul 07
2
[LLVMdev] (GEP) Index validity
Hi all, I'm fiddling around a bit with programmatically created GEP instructions, which is failing when using i64 for any indix, except the first. The reason behind this, is that StructureType::indexValid only accepts Value* that are constant ints of width 32. I can't really see why this limitation is here. SequentialType solves this slightly differently, it allows for both 32 and 64
2009 Jul 14
3
[LLVMdev] Unexpected failures in the DejaGNU test collection
Hi all, When using "make check" with the DejaGNU test collection, I encounter two unexpected failures (they seem to be closely related). My question: are they well known, and if so what's the problem and how can I fix it? This is the error text I get: FAIL: /var/data/common/trunk/llvm/test/FrontendC/2008-05-19-AlwaysInline.c Failed with exit(1) at line 1 while running:
2011 Mar 14
2
[LLVMdev] How to load a data from the address of unsiged long type
Now I have an address that present in a unsigned long address like the following format: Value* addr = CONST(0xc0008000) But I do not know how to read the data from the above addr varaible. I tried the following three kind of code: 1. Code: Value* addr = CONST(0xc0008000); Value* data = new LoadInst(addr, "", false, bb); Error: Segmentation fault 2. Code(
2010 Dec 12
2
[LLVMdev] Optimized "opt" on Darwin fails to load dynamic libraries with passes
Hi all, This is a problem that occurs for me only on Darwin (MacOS) and not on Linux. When llvm 2.8 (or 2.9) is compiled with ENABLE_OPTIMIZED=1, the "opt" tool fails to load LLVM passes in dynamic libraries (.dylib) files, regardless of how they themselves were built. When opt is built with ENABLE_OPTIMIZED=0, all is well. Here is some informative output. Seems to me the problem is
2015 Jan 22
2
[LLVMdev] access IntegerType::getSignBit from Type *
Hi, I have a Type * which may come from an IntegerType as shown below: Type.getIntegerBitWidth() tells me numBits. But how to extract the IntegerType.getSignBit? If pType isIntegerType, I need to know if it is signed or unsigned... How to achieve this? Thx Alex llvm::Type * getRandomValid_IntegerType(llvm::LLVMContext &C) { using namespace llvm; //--- determine num of bits
2011 Oct 27
0
[LLVMdev] Resolving sizeof's; target triples; type optimizations
On Thu, Oct 27, 2011 at 7:31 AM, Harel Cain <harel.cain at gmail.com> wrote: > Hi all, > > A few different though somewhat related questions here. I'm really grateful > for your answers! > > 1. From a previous question I know that sizeof's are resolved into literals > early in the front-end before IR is even emitted. It seems that they are > resolved into
2011 Jan 28
0
[LLVMdev] Passing command line arguments to optimization passes
You could make the cl:opt object visible outside one of your passes, and use it in your other passes : in other words, it is a global variable shared between several files. Best regards, -- Arnaud de Grandmaison -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of guyadini Sent: Thursday, January 27, 2011 12:38 PM To: llvmdev at
2008 Jul 07
0
[LLVMdev] (GEP) Index validity
Hi all, I just found that TargetData also contains a similar assert, and that I forgot a "return" in my previous patch. Here's an updated patch, which allows to use any integer to index a CompositeType. It seems this enables GEP to work with any integer value as well, I tested indexing a struct with a i16 an i64 (also through llc). This should still be adressed somewhere, unless we