similar to: [LLVMdev] Sizeof a type?

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Sizeof a type?"

2013 Jan 20
0
[LLVMdev] Sizeof a type?
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Rick Mann > Subject: [LLVMdev] Sizeof a type? > Is there a way to get the sizeof a type? Look at the methods of the DataLayout class. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you
2013 Jan 20
0
[LLVMdev] Sizeof a type?
Hi Rick, On 20/01/13 06:23, Rick Mann wrote: > Is there a way to get the sizeof a type? Say I've created a struct type without any explicit attribtues, and I want to call malloc() to allocate space for it. Can I get the size as an llvm::Constant* (or other llvm::Value*) given an llvm::StructType* or other llvm::Type*? if you have DataLayout available, use the getTypeAllocSize method. If
2013 Jan 20
1
[LLVMdev] Sizeof a type?
On Jan 20, 2013, at 3:21 , Duncan Sands <baldrick at free.fr> wrote: > if you have DataLayout available, use the getTypeAllocSize method. If you don't > have information about the target then you can use ConstantExpr::getSizeOf. The > advantage of DataLayout is that it returns a number (eg: 8) while getSizeOf > returns a mysterious expression (the optimizers will simplify
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 =
2016 Jun 02
4
[GSoC 2016] Parameters of a target architecture
Dear LLVM contributors, I work on the "Improvement of vectorization process in Polly". At the moment I'm trying to implement tiling, interchanging and unrolling of specific loops based on the following algorithm for the analytical modeling [1]. It requires information about the following parameters of a target architecture: 1. Size of double-precision floating-point number. 2.
2013 Nov 15
4
[LLVMdev] Limit loop vectorizer to SSE
Something like: index 6db7f68..68564cb 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1208,6 +1208,8 @@ void InnerLoopVectorizer::vectorizeMemoryInstruction(Instr Type *DataTy = VectorType::get(ScalarDataTy, VF); Value *Ptr = LI ? LI->getPointerOperand() : SI->getPointerOperand(); unsigned Alignment = LI ?
2013 Jan 20
2
[LLVMdev] Inconsistent label syntax in LLVM assembly
Hi all, i'm writing a TXL (http://www.txl.ca) grammar and a revamp of bison/flex grammar for LLVM. I've noticed an inconsistency regarding label naming conventions. For instance, the following is a segment of legit LLVM assembly (human-readable) IR: br i1 %38, label %17, label %39 ; <label>:39 ; preds = %._crit_edge ret void
2013 Nov 15
0
[LLVMdev] Limit loop vectorizer to SSE
----- Original Message ----- > From: "Arnold Schwaighofer" <aschwaighofer at apple.com> > To: "Joshua Klontz" <josh.klontz at gmail.com> > Cc: "LLVM Dev" <llvmdev at cs.uiuc.edu> > Sent: Friday, November 15, 2013 4:05:53 PM > Subject: Re: [LLVMdev] Limit loop vectorizer to SSE > > > Something like: > > index
2013 Nov 15
2
[LLVMdev] Limit loop vectorizer to SSE
Yes, I was just about to send out: DL->getABITypeAlignment(ScalarDataTy); The question is: “… ABI alignment for the target …" is that getPrefTypeAlignment or getABITypeAlignment I would have thought the latter. On Nov 15, 2013, at 4:12 PM, Hal Finkel <hfinkel at anl.gov> wrote: > ----- Original Message ----- >> From: "Arnold Schwaighofer"
2009 Jun 18
1
[LLVMdev] Explicitly Freeing Allocas
I went ahead and implemented the allocation based on the maximum size of all structs seen so far... The problem is, the TargetData object from ExecutionEngine gives me a size of 12 for a struct containing a pointer and an i64 (on a 32-bit machine). However, the generated code seems to assume an alignment of 8, and tries to read the i64 value at offset 8, which obviously reads an invalid value.
2008 Apr 21
2
[LLVMdev] newbie question for type comparison
Hi, I want to extract all instruction of the form "alloca %struct.S", where $struct.S is defined as a struct %struct.S = type { i32, i32 } I'm using the following loop: for(inst_iterator i = inst_begin(F), e = inst_end(F); i!= e; i++) { AllocaInst* ai; if( (ai = dyn_cast<AllocaInst>(&*i))){ if(ai->getOperand(0)->getType()->getTypeID() ==
2008 Apr 21
0
[LLVMdev] newbie question for type comparison
Lu Zhao wrote: > Hi, > > I want to extract all instruction of the form "alloca %struct.S", where > $struct.S is defined as a struct > > %struct.S = type { i32, i32 } > > I'm using the following loop: > > for(inst_iterator i = inst_begin(F), e = inst_end(F); i!= e; i++) > { > AllocaInst* ai; > if( (ai =
2012 Nov 11
4
[LLVMdev] IR sizeof?
Is there a way to get the size of a type in the IR assembly code? I know the size must be known since alloca and getelementptr both implicitly use it, but I don't see any way to get access to the size directly. I know my final compiler will have to get the size itself, but I'm just doing some simple tests directly in assembly now and am hoping there is an easy way to get the size of a
2012 Sep 19
3
[LLVMdev] newbie question on getelementptr
Hi All, I'm new to LLVM and I'm having a coding problem. I'm creating a GlobalVariable that contains a StructType that contains a Function. The function returns i32 and takes two i32's. Here is my code: GlobalVariable* retrieved = module->getGlobalVariable("myGV"); ... Constant* result = ConstantExpr::getGetElementPtr(retrieved, indices); How do I get my Function
2010 Oct 20
4
[LLVMdev] Source to source translation.
Hello, I'm trying to do a source to source translation from C++ code to C++ code. I want the output to contains some automatically inserted annotations, and the rest of the code exactly the same as it was before the processing. Is this possible with llvm? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2008 Apr 21
3
[LLVMdev] newbie question for type comparison
Hi John, Thank you a lot. That clarifies some my confusions. What I want to do is to use both methods, get ALL struct allocation and a SPECIFIC struct allocation, at different situations. Here, I've got a couple of more questions. 1. For getting ALL struct allocation, when I use if( (AI = dyn_cast<AllocaInst>(&*i)))
2013 Nov 15
0
[LLVMdev] Limit loop vectorizer to SSE
Nadav, I believe aligned accesses to unaligned pointers is precisely the issue. Consider the function `add_u8S` before[1] and after[2] the loop vectorizer pass. There is no alignment assumption associated with %kernel_data prior to vectorization. I can't tell if it's the loop vectorizer or the codegen at fault, but the alignment assumption seems to sneak in somewhere. v/r, Josh [1]
2010 Oct 21
0
[LLVMdev] Re : Source to source translation.
Hello Carlos, I don't think so. LLVM is not a source-to-source translator, but an optimizing compiler based on a portable, typed, assembly-like intermediate representation. One of the primary goals of LLVM is to generate optimized object code on a variety of platforms. Even if you do not use any optimizations, your C++ code would still need to be lowered to LLVM, which makes it very hard
2009 Nov 04
0
[LLVMdev] DeadStoreElimination: do better without TargetData
Re-posting with better-looking code. Hans Wennborg wrote: > The attached patch makes DeadStoreElimination able to remove stores in > store-store dependencies when the operand types are equal, even if there > is no TargetData available. > > / Hans > > > ------------------------------------------------------------------------ > >
2009 Nov 04
2
[LLVMdev] DeadStoreElimination: do better without TargetData
The attached patch makes DeadStoreElimination able to remove stores in store-store dependencies when the operand types are equal, even if there is no TargetData available. / Hans -------------- next part -------------- A non-text attachment was scrubbed... Name: DeadStoreElimination.patch Type: text/x-patch Size: 812 bytes Desc: not available URL: