Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] GetElementPtrConstantExpr question"
2012 Dec 18
2
[LLVMdev] GetElementPtrConstantExpr
Because I need to convert an [4 x i8] type to i8* in the instantiation of a
GlobalVariable.
I have the follow declaration: %xxx = type { i8* } and I must emit the
following variable:
@yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's wrong.
How do I do?
2012/12/18 Óscar Fuentes <ofv at wanadoo.es>
> Alessio Giovanni Baroni <alessiogiovanni.baroni at
2012 Dec 18
2
[LLVMdev] GetElementPtrConstantExpr
Hi to all,
I need the class in object, but the file ConstantsContext,h isn't installed.
What can I do? Copy that header under include? It's an installation bug?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121218/e1130d0a/attachment.html>
2012 Dec 18
0
[LLVMdev] GetElementPtrConstantExpr
Alessio Giovanni Baroni <alessiogiovanni.baroni at gmail.com> writes:
> I need the class in object, but the file ConstantsContext,h isn't installed.
>
> What can I do? Copy that header under include? It's an installation bug?
That's an internal header, not part of the public API.
Why do you need the classes declared on that header?
2013 Aug 02
1
[LLVMdev] replacing GetElementPtrConstantExpr with GetElementPtrInst ... sometimes
Hi
During a pass, the XCore target lowers thread local global variables by turning them into global variable arrays indexed by the (max 8) thread ID.
(see XCoreLowerThreadLocal.cpp)
This works fine for instructions e.g. GetElementPtrInst
But can't be done for constants e.g. GetElementPtrConstantExpr
Thus I would like to replace GetElementPtrConstantExpr with GetElementPtrInst when it is
2012 Dec 19
2
[LLVMdev] GetElementPtrConstantExpr
Ok, now it's arising another problem. IR code that I obtain is the
following:
i8* bitcast ([5 x i8] c"hello\00" to i8*)
generated from instructions:
ConstantExpr::getBitCast (ConstantDataArray::getString (getGlobalContext
(), "hello"), PointerType::get (Type::getInt8Ty (getGlobalContext ()), 0))
but the LLC tool says: invalid cast opcode for cast from '[5 x i8]'
2012 Dec 19
0
[LLVMdev] GetElementPtrConstantExpr
On 19/12/12 10:25, Alessio Giovanni Baroni wrote:
> Ok, now it's arising another problem. IR code that I obtain is the following:
>
> i8* bitcast ([5 x i8] c"hello\00" to i8*)
You need to put your "hello" in a (constant) global variable. You can then
bitcast the address of the global to i8*. I suggest you compile some C code
that makes use of the address of a
2012 Dec 18
0
[LLVMdev] GetElementPtrConstantExpr
Alessio Giovanni Baroni <alessiogiovanni.baroni at gmail.com> writes:
> Because I need to convert an [4 x i8] type to i8* in the instantiation of a
> GlobalVariable.
> I have the follow declaration: %xxx = type { i8* } and I must emit the
> following variable:
> @yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's wrong.
>
> How do I do?
2011 Feb 01
2
[LLVMdev] Convenience methods in ConstantExpr et al
I notice that there's a lot of inconsistency in the various LLVM classes
with respect to convenience methods. Here's some examples:
For creating GEPS, IRBuilder has:
CreateGEP (2 overloads)
CreateInBoundsGEP (2 overloads)
CreateConstGEP1_32
CreateConstInBoundsGEP1_32
CreateConstGEP2_32
CreateConstInBoundsGEP2_32
CreateConstGEP1_64
CreateConstInBoundsGEP1_64
2011 Feb 10
0
[LLVMdev] ConstantExpr::replaceUsesOfWithOnConstant() function for llvm::GetElementPtrConstantExpr
Hi LLVMdev members
I found something strange in ConstantExpr::replaceUsesOfWithOnConstant() function.
in lib/VMCore/Constants.cpp file
2118 if (getOpcode() == Instruction::GetElementPtr) {
2119 SmallVector<Constant*, 8> Indices;
2120 Constant *Pointer = getOperand(0);
2121 Indices.reserve(getNumOperands()-1);
2122 if (Pointer == From) Pointer = To;
2123
2124 for
2011 Feb 02
0
[LLVMdev] Convenience methods in ConstantExpr et al
On Mon, Jan 31, 2011 at 10:57 PM, Talin <viridia at gmail.com> wrote:
> I notice that there's a lot of inconsistency in the various LLVM classes
> with respect to convenience methods. Here's some examples:
>
> For creating GEPS, IRBuilder has:
>
> CreateGEP (2 overloads)
> CreateInBoundsGEP (2 overloads)
> CreateConstGEP1_32
>
2011 Feb 02
2
[LLVMdev] Convenience methods in ConstantExpr et al
Talin wrote:
> On Mon, Jan 31, 2011 at 10:57 PM, Talin <viridia at gmail.com
> <mailto:viridia at gmail.com>> wrote:
>
> I notice that there's a lot of inconsistency in the various LLVM
> classes with respect to convenience methods. Here's some examples:
>
> For creating GEPS, IRBuilder has:
>
> CreateGEP (2 overloads)
>
2009 Apr 30
2
[LLVMdev] Pulling line number/file/path information from DbgStopPointInst instructions
Hmm... if I do a print() on the result of getFileName(), I get
i8 * getelementptr ([9 x i8]* @.str, i32 0, i32 0)
back, but if I try to dyn_cast this to GetElementPtrInst it fails
(returning null), so presumably I'm seeing a
GetElementPtrConstantExpr... so how can I get at that constant i8
array without casting to a GetElementPtrInst, and with
GetElementPtrConstantExpr being
2014 Nov 22
3
[LLVMdev] How to get the indices in an getelementptr Value?
On Sat, Nov 22, 2014 at 11:09 AM, Sanjoy Das <sanjoy at playingwithpointers.com
> wrote:
> Hi Qiuping,
>
> If I'm reading the IR correctly, what you have is a
> GetElementPtrConstantExpr [1]. It subclasses from llvm::Constant.
>
If you want the same code to handle GetElementPtrConstantExpr *and*
GetElementPtrInst, you can use GEPOperator.
>
> Thanks,
> --
2012 Jan 22
2
[LLVMdev] CreateGlobalStringPtr giving linker errors
Hi,
I am trying to use some LLVM API in my C++ code, and I end up getting
linker errors. I am working on Apple MacOSX Lion. Using g++ for the
compile. It is the CreateGlobalStringPtr which is throwing the error. This
is LLVM 3.0.
Here's the codeI am trying to use some LLVM API in my C++ code, and I end
up getting linker errors. I am working on Apple MacOSX Lion. Using g++ for
the compile. It
2013 Aug 19
4
[LLVMdev] Generating GetElementPtr inlined in a function argument list programmatically
Hello LLVMDev List,
It's my first time sending a message to the List - I have been working on a tool for my research project using LLVM. Thanks for your awesome work!
I have come across some bytecode like the following with an GetElementPtr instruction in brackets:
Bytecode:%3 = call i32 @_Z4funcPKc(i8* getelementptr inbounds ([5 x i8]* @.str2, i32 0, i32 0))
C++ code:func("bleh");
2012 Jan 27
3
[LLVMdev] How to get the string value?
Thanks Duncan,
Yes, it is a ConstantExpr! Thank you!
Now trying to find a clue in ConstantExpr's functions to get that string :-)
Regards,
Welson
On Thu, Jan 26, 2012 at 9:04 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Welson Sun,
>
> > Hi, if I have some LLVM code like this:
> >
> > @.str = private unnamed_addr constant [7 x i8]
2011 Jun 24
2
[LLVMdev] inefficiencies in ConstantUniqueMap ?
Hi,
Consider ConstantUniqueMap::getOrCreate() (in lib/VMCore/ConstantsContext.h):
/// getOrCreate - Return the specified constant from the map, creating it if
/// necessary.
ConstantClass *getOrCreate(const TypeClass *Ty, ValRefType V) {
MapKey Lookup(Ty, V);
ConstantClass* Result = 0;
...
For array (or struct or vector) constants, typically:
ValType = vector<Constant*>
2012 Jan 22
0
[LLVMdev] CreateGlobalStringPtr giving linker errors
Probably your g++ compiles x86_64 binary by default, but i686 dylib is supplied?
Try:
g++ -m32 e.cpp /Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/libllvmgcc.dylib
- D.
2012/1/22 Arpan Sen <arpansen at gmail.com>:
> Hi,
>
> I am trying to use some LLVM API in my C++ code, and I end up getting linker
> errors. I am
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]*
2008 Jun 17
4
[LLVMdev] Transforming ConstantExprs to Instructions
Hi,
I've been struggling with constantexprs for a bit. I'm working on a pass that
transforms global variables to local variables, and in particular the
GetElementPtrConstantExpr is a bit troublesome. For my transformation to
properly work, a global value should only be used by Instructions, not by
ConstantExprs.
I was thinking to add a ConstantExpr::replaceWithInstr() virtual method,