similar to: [LLVMdev] porting to 3.1: ConstantDataArray

Displaying 20 results from an estimated 800 matches similar to: "[LLVMdev] porting to 3.1: ConstantDataArray"

2012 Nov 16
0
[LLVMdev] porting to 3.1: ConstantDataArray
On 16 November 2012 13:55, charles quarra <charllsnotieneningunputocorreo at gmail.com> wrote: > In llvm 3.0 llvm::ConstantArray had a ::getAsCString() method that > returned the buffer as a std::string. Now it seems that 3.1 this > method dissapeared. > > I found that llvm::ConstantDataArray has a method called > getAsString(), but it returns a Constant*. In 3.1
2013 Apr 20
2
[LLVMdev] How to cast Value* to ConstantDataArray*
I extended the LLVM Kaleidoscope example to support Strings. I added a StringExprAST, which has the virtual Codegen method impl as follows: Value *StringExprAST::Codegen() { StringRef r(Val); return ConstantDataArray::getString(getGlobalContext(), r, false); } I am trying to concatenate Strings and have a ConcatExprAST with its Codegen method. Upon trying to access the data in the
2013 Apr 21
2
[LLVMdev] How to cast Value* to ConstantDataArray*
ConstantDataArray * cda = cast<ConstantDataArray>(v); throws this error: Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /Users/rcatlin1/lldb/llvm/include/llvm/Support/Casting.h, line 208 Thanks for the help. Richard Catlin On Sat, Apr 20, 2013 at 3:37 PM, Sean Silva <silvas at purdue.edu> wrote:
2013 Apr 20
0
[LLVMdev] How to cast Value* to ConstantDataArray*
On Sat, Apr 20, 2013 at 5:15 PM, Richard Catlin <richard.m.catlin at gmail.com>wrote: > I extended the LLVM Kaleidoscope example to support Strings. I added a > StringExprAST, which has the virtual Codegen method impl as follows: > > Value *StringExprAST::Codegen() { > StringRef r(Val); > return ConstantDataArray::getString(getGlobalContext(), r, false); > } >
2012 Dec 16
2
[LLVMdev] write module to .bc file
i'm afraid this question is extremely basic, but i've assumed that dumping a .bc file from a module was a trivial operation, but now, first time i have to actually do it from code, for the life of me i can't find one missing step in the process: static void WriteModule ( const Module * M, BitstreamWriter & Stream )
2013 Jun 25
4
[LLVMdev] get value
Hi Cristianno, Thank you, it works :) with an extra cast:                                     Value *v ......                                     ConstantInt* RR = (ConstantInt *)v;                                     uint64_t VV = (RR->getValue()).getLimitedValue();                                     errs()<<"\nRR  "<<VV<<"\n";
2019 Mar 09
2
Cast a function parameter to GEP
Thanks Tim, I'll try to solve my problem ASAP, if I cannot maybe I'll some other clarifications. Thanks again On Sat, Mar 9, 2019, 06:03 Tim Northover <t.p.northover at gmail.com> wrote: > Hi Alberto, > > On Sat, 9 Mar 2019 at 05:50, Alberto Barbaro via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > i8* getelementptr inbounds ([7 x i8], [7 x i8]*
2013 Jun 25
2
[LLVMdev] get value
Hello ! This may be a trivial question, but I cannot get fields from a Value type. If my Value is i32 1, how can I store 1 in a different structure (an integer) ? For the type, I have getType(). For the value, I see no method in Value.h. I tried to cast to ConstantExpr and then to get operands, or cast to ConstantDataArray and then use getAsString(), but is not working. How should I get the
2013 Mar 04
2
[LLVMdev] llvm cannot iterate a [3 x i8]
Hello everyone, I am trying to "parse" a part of LLVM IR. More exactly, from @.str = private unnamed_addr constant [3 x i8] c"DS\00", section "llvm.metadata" I want to get "DS". It is the single place in the whole bytecode from where I can get it. I have : ... Value *VV = cast<Value>(LD100->getOperand(1)->getOperand(0));
2015 May 28
1
[LLVMdev] Passing ConstantDataArray to GetElementPtrInst
Hi, I'm having a hard time finding an answer to what I assume is a very basic idea. I'm trying to produce this llvm code using the LLVM api: %myString = alloca [13 x i8], i32 13 store [13 x i8] c"Hello world.\00", [13 x i8]* %myString %tmp1 = getelementptr [13 x i8]* %myString, i32 0, i32 0 %tmp2 = call i32 (i8*, ...)* @printf( i8* %tmp1 ) nounwind A simple Hello
2018 Mar 21
1
How to read String value of GlobalVariable?
Hi I have IR Code like ... @path = private constant [6xi8] c"abcde\00" ... --- Code from Pass --- GlobalVariable * GVPath = .... // contains @path I want to convert "abcde" to StringRef. Can you help me with GlobalVariable API? GlobalVariable::getInitializer() --> Constant* // How to get exact value äbcde from here? ~mahesh -------------- next part --------------
2013 Jun 25
0
[LLVMdev] get value
Hi Alexandru, if you have a Value pointer named v, you could use the method v->getValue(). getLimitedValue(), which returns uint64_t, that can be casted as int. Hope I could help, -- Cristianno Martins PhD Student of Computer Science University of Campinas cmartins at ic.unicamp.br <cristiannomartins at hotmail.com> On Tue, Jun 25, 2013 at 4:05 AM, Alexandru Ionut Diaconescu <
2013 Jun 25
0
[LLVMdev] get value
Oops, that's true: I forgot about that XD sorry =) Glad I could help, -- Cristianno Martins PhD Student of Computer Science University of Campinas cmartins at ic.unicamp.br <cristiannomartins at hotmail.com> On Tue, Jun 25, 2013 at 4:38 AM, Alexandru Ionut Diaconescu < cyrusthevirus001x at yahoo.com> wrote: > Hi Cristianno, > > Thank you, it works :) > > with
2013 Jun 26
0
[LLVMdev] get value
Alexandru Ionut Diaconescu wrote: > Hi Cristianno, > > Thank you, it works :) > > with an extra cast: > Value *v ...... > ConstantInt* RR = (ConstantInt *)v; Please use "cast<ConstantInt>(v)" instead. See http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates . Nick > uint64_t VV = (RR->getValue()).getLimitedValue(); >
2013 Feb 27
3
[LLVMdev] llvm get annotations
Hello everyone ! I followed http://stackoverflow.com/questions/4976298/modern-equivalent-of-llvm-annotationmanagerin order to get annotations from my target bytecode. All the examples that I give in the following is related to the code from that link. I have `__attribute__((annotate("DS"))) int f=0;` into the target C++ program and the related IR code: @.str = private unnamed_addr
2012 Dec 13
2
[LLVMdev] Fwd: error while linking modules with exception handling demo code
---------- Forwarded message ---------- From: charles quarra <charllsnotieneningunputocorreo at gmail.com> Date: 2012/12/13 Subject: error while linking modules with exception handling demo code To: llvmdev at cs.uiuc.edu Hi, I am building a module X with an arithmetic function foo, a module Y with an arithmetic function foo2 that invokes foo. For the invocation be a proper one (being
2017 Sep 10
2
Performance of large llvm::ConstantDataArrays
On Sat, Sep 9, 2017 at 10:18 PM, Chris Lattner via llvm-dev < llvm-dev at lists.llvm.org> wrote: > > On Sep 7, 2017, at 11:06 PM, Chris Lovett via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > I'm running into some pretty bad performance in llc.exe when compiling > some large neural networks into code that contains some very large llvm::ConstantDataArrays,
2012 Apr 30
2
[LLVMdev] git branch release_31
Hi Anton, git-svn got confused at the branch point for the release_31: I see that the current release_31 branch has been created on r155051 as a copy of r155050 from trunk, and r155050 is actually removing an older release_31 branch: Revision 155050 Author: void Date: Wed Apr 18 16:38:33 2012 CDT (11 days, 20 hours ago) Log Message: Removing old release_31 branch for rebranching. This
2012 May 06
0
[LLVMdev] git branch release_31
FYI, I have been maintaining my own release_31 manually on github.com/chapuni. 2012/5/1 Sebastian Pop <spop at codeaurora.org>: > Hi Anton, > > git-svn got confused at the branch point for the release_31: I see > that the current release_31 branch has been created on r155051 as a > copy of r155050 from trunk, and r155050 is actually removing an older > release_31 branch:
2012 Apr 26
2
[LLVMdev] git branch release_31
Hi Anton, On Thu, Apr 26, 2012 at 4:05 PM, Anton Korobeynikov <anton at korobeynikov.info> wrote: > Sebastian, > >> I just saw that the git branch remotes/origin/release_31 has been created >> for llvm.  Unfortunately it is missing the right context: right now I can only >> see 11 patches in that branch with the last patch having no parent. >> >> Could