Displaying 20 results from an estimated 200 matches similar to: "[LLVMdev] Passing ConstantDataArray to GetElementPtrInst"
2012 Dec 02
3
[LLVMdev] GetElementPtrInst question
Hi all,
How can I create an llvm::GetElementPtrInst in which the pointer and
the index are in registers previously loaded with llvm::LoadInst ? I
mean, the generated instruction will be like this:
%1 = getelementptr i8* %myreg1, i32 %myreg2
here, %myreg1 and %myreg2 are previously created by load instructions
(llvm::LoadInst).
Please, let me know if there is an example of something similar.
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);
> }
>
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:
2012 Nov 16
2
[LLVMdev] porting to 3.1: ConstantDataArray
Hi,
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*.
What is the safe way to retrieve the pointer of the Constant array as
a C string?
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
2019 Nov 20
2
Get the address of ConstantDataArray
Hi all,
I have a global array declared as: table = internal constant [8 x [256 x
i32]] ...
At the moment I'm able to get the reference to table using Constant* g_var
= cast<GlobalVariable>(I.getOperand(0))->getInitializer(); ( please
consider I to be a GetElementPtrInst object ).
Now I would like to understand how to get the address of table[2][3], for
instance, considering that I
2000 Jan 06
1
bsd-snprintf.c and NeXT.
I'm wonder if anyone happens to have a simplier (slower) version of
bsd-snprintf.c. It seems NeXT 3.3 (unsure about 4.2) is missing
mprotect().
If I could get something to replace that for a while and fix some of
theses utmp in login.c issues I may have a rough port NeXT to black
hardware.=)
Thanks
1999 Dec 10
0
snprintf from postgresql
/*
* Copyright (c) 1983, 1995, 1996 Eric P. Allman
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of
2012 Dec 02
0
[LLVMdev] GetElementPtrInst question
Hi,
You'd use an IRBuilder, like you did to create your LoadInsts.
IRBuilder<> IRB(BB);
IRB.CreateGEP(myreg1, myreg2);
I assume because you asked this question, something went wrong when using the above method. What was it? :)
Cheers,
James
________________________________________
From: llvmdev-bounces at cs.uiuc.edu [llvmdev-bounces at cs.uiuc.edu] On Behalf Of Eduardo [erocha.ssa
2012 Dec 02
1
[LLVMdev] GetElementPtrInst question
Hi James,
Thanks for your quick reply.
> I assume because you asked this question, something went wrong when using the above method. What was it? :)
No, I am not using this method. I was trying to create a
llvm::GetElementPtrInst . I didn't create IRBuilder. I am writing a
ModulePass that insert new instruction to an existing Module.
Besides, how can you get a reference to myreg1 ?
2012 Sep 05
1
[LLVMdev] Calling a function with a pointer to a global char array as argument
Hello;
Thanks to Eli for the pointer to the ConstantDataArray::getString()
fucntion. Now I am trying to declare a global char array with the content
"hi" and call a function "print" (which takes a char pointer and return an
insteger.
I am doing the following in the code -
Function Creation:
PointerType* array =
PointerType::get(IntegerType::getInt8Ty(getGlobalContext())
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,
2017 Sep 08
5
Performance of large llvm::ConstantDataArrays
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, some are { size=102,760,448 }. There's a
small about of actual code for processing the network, but the assembly is
mostly global data.
I'm finding that llc.exe memory spikes up around 30 gigabytes and the job
takes 20-30
2017 Oct 13
2
Why does GEP allow src and destination type to have different address spaces?
The GEP constructor does not assert that the source and destination types
match. Of course, this is incorrect and causes random failures somewhere
down the line.
Could I add general sanity checks to the GEP constructor?
In general, is an Instruction allowed to be in an inconsistent state? If
so, is there some well known method to "verify" whether an instruction is
consistent or not?
2003 Nov 21
1
[LLVMdev] GetElementPtrInst Again!
On Fri, 2003-11-21 at 14:35, Chris Lattner wrote:
> On Fri, 21 Nov 2003, Reid Spencer wrote:
> > When I set up the call, I get the following from that pesky :) verifier:
>
> Ah, but it's so helpful! :)
It is actually. It is ensuring that my compiler is correct which is one
of the hardest things to do!
> > So, in LLVM are arrays and pointers not equivalent as in
2012 Feb 14
1
[LLVMdev] How to get the array size of GetElementPtrInst->getPointerOperand() ?
If I dump the Value of GetElementPtrInst->getPointerOperand(), I got this:
%a = alloca [10 x i32], align 16
Obviously, there should be a way to get the dimension and element type via
the "Value" returned from GetElementPtrInst->getPointerOperand(), but how?
What kind of "Value" is this?
Thanks!
Welson
-------------- next part --------------
An HTML attachment was
2012 Apr 17
0
[LLVMdev] Issue with GetElementPtrInst in Instruction Combining pass
Hi Pankaj, your best bet is to send the entire bitcode before and after
instcombine runs.
Ciao, Duncan.
2003 Nov 21
0
[LLVMdev] GetElementPtrInst Again!
On Fri, 21 Nov 2003, Reid Spencer wrote:
> I'm trying to set up a call to printf in stacker and have managed to
> confuse myself. Perhaps you can shed some light.
:)
> I've declared printf as a function taking a pointer to SByteTy with var
> args and returning SIntTy:
Sounds good.
> When I set up the call, I get the following from that pesky :) verifier:
Ah, but
2003 Nov 21
2
[LLVMdev] GetElementPtrInst Again!
I'm trying to set up a call to printf in stacker and have managed to
confuse myself. Perhaps you can shed some light.
I've declared printf as a function taking a pointer to SByteTy with var
args and returning SIntTy:
> // Create a function for output (int printf(format,...))
> std::vector<Type*> params;
> params.push_back( PointerType::get( Type::SByteTy ) );