Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] Transforming ConstantExprs to Instructions"
2008 Jun 17
0
[LLVMdev] Transforming ConstantExprs to Instructions
On Tue, Jun 17, 2008 at 8:50 AM, Matthijs Kooijman <matthijs at stdin.nl> wrote:
> 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
2008 Jun 17
0
[LLVMdev] Transforming ConstantExprs to Instructions
On Tue, 17 Jun 2008, Matthijs Kooijman wrote:
> 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.
Ok, this
2008 Jun 18
3
[LLVMdev] Transforming ConstantExprs to Instructions
Hi Chris,
> > [ Snip replacing constantexprs with instructions ]
> Ok, this is not possible in general though, global variable initializers
> have to be constants, not instructions.
Yeah, so if not all uses can be replaced, my pass will just have to skip the
variable.
> Is it possible to design the pass to work with both? The general approach
> is to make stuff handle
2008 Jun 19
0
[LLVMdev] Transforming ConstantExprs to Instructions
On Jun 18, 2008, at 1:36 AM, Matthijs Kooijman wrote:
>> Is it possible to design the pass to work with both? The general
>> approach
>> is to make stuff handle "User"s instead of Instructions. It is
>> much more
>> compile time efficient to just handle the two forms rather than
>> converting
>> them back and forth.
> With both I
2008 Jun 24
2
[LLVMdev] Removal of ConstantExprs
Hi All,
I'm having a bit of trouble with ConstantExprs currently. In particular, a
global variable A is bitcasted and used in the initializer of another global
variable B (as a struct element).
B is unused, so it gets whacked and its initializer gets set to NULL. This
succesfully reduces the usecount of the bitcast to 0, but the bitcast itself
does not get removed then. This means that
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 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)
>
2008 Jun 24
0
[LLVMdev] Removal of ConstantExprs
On Tue, 24 Jun 2008, Matthijs Kooijman wrote:
> I'm having a bit of trouble with ConstantExprs currently. In particular, a
> global variable A is bitcasted and used in the initializer of another global
> variable B (as a struct element).
>
> B is unused, so it gets whacked and its initializer gets set to NULL. This
> succesfully reduces the usecount of the bitcast to 0, but
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
>
2014 Sep 19
2
[LLVMdev] More careful treatment of floating point exceptions
Hi Sanjay,
Thanks, I saw this flag and it's definitely should be considered, but
it appeared to me to be static characteristic of target platform. I'm
not sure how appropriate it would be to change its value from a front-end.
It says "Has", while optional flag would rather say "Uses" meaning that
implementation cares about floating point exceptions.
Regards,
Sergey
2008 Jun 19
1
[LLVMdev] Transforming ConstantExprs to Instructions
On Wed, Jun 18, 2008 at 10:19 PM, Chris Lattner <sabre at nondot.org> wrote:
> What do you mean? A constantexpr gep can be used as the size of an
> alloca.
A constantexpr as an argument to an alloca is legal, but a
constantexpr can't use an alloca.
Suppose you have a global struct, and you load the third member. The
IL for this is something like "load i32* getelementptr (
2016 Sep 24
2
RFC: ConstantData should not have use-lists
> On 2016-Sep-24, at 15:16, Mehdi Amini <mehdi.amini at apple.com> wrote:
>
>>
>> On Sep 24, 2016, at 3:06 PM, Duncan P. N. Exon Smith via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>
>> r261464 added a type called ConstantData to the Value hierarchy. This
>> is a parent type for constants with no operands, such as i32 0 and null.
>>
2008 Jun 24
1
[LLVMdev] Removal of ConstantExprs
> We can't "garbage collect" ConstantExprs at arbitrary points: they may
> exist in maps, in local variables etc. There is no good way to know they
> are dead.
Ah, makes sense.
> > Also, in this case I'm using a bitcast of A, but what if this was a bitcast of
> > a gep of a A? In this case, removeDeadConstantUsers on A would not remove
> > anything,
2018 May 31
1
Proper way to lower all ConstantExprs?
Hi:
For my own Transform passes I need to lower all ConstantExpressions into Instructions in order to conveniently analyze the use-def def-use chains and operand comparisons. Could anyone possibly kindly share some insights on if there is any standard way to do this without crafting my own implementation and if not, should we add this feature into LLVM upstream?
Zhang
2004 Jun 17
0
[LLVMdev] generating instructions with embedded ConstantExprs from within LLVM
On Thu, 17 Jun 2004, Patrick Meredith wrote:
> How is this done? Everything logical I have tried has failed, here was
> one attempt:
>
> Constant *C = (Constant*) ConstantArray::get(inst2string(I)); //fucnction defined elsewhere
>
> //generates a correct Global string
> GlobalVariable *str = new GlobalVariable(C->getType(), true,
>
2004 Jun 17
4
[LLVMdev] generating instructions with embedded ConstantExprs from within LLVM
How is this done? Everything logical I have tried has failed, here was one attempt:
Constant *C = (Constant*) ConstantArray::get(inst2string(I)); //fucnction defined elsewhere
//generates a correct Global string
GlobalVariable *str = new GlobalVariable(C->getType(), true,
GlobalValue::InternalLinkage,
C, mkStrName( strNumber++ ), &M);
std::vector<Value*>
2007 May 11
2
[LLVMdev] identifing mallocs with constant sizes
I am writing some code to identify malloc instructions with constant
request sizes and to determine the request size if it is constant. I
have two questions.
1) If a malloc is for an array allocation and the array size is a
ConstantExpr, how can I obtain the value of the ConstantExpr?
2) I am using the following logic to determine if the malloc is for a
constant request size and to
2019 Dec 19
2
Moving to ORCv2 - Where are my global constructors and destructors?
Heyho,
Recently I tried out the ORCv2 JIT, especially the LLJIT. I gotta say, that I really like the new interface and the way you use it! However there is one thing I'm missing. I wrote a small bit code file, which should force having a global constructor.
int wuff();
__declspec(noinline) int miau()
{
printf("Huhuhu");
return wuff();
}
const int x = miau();
When I
2017 Aug 17
2
Inst->replaceAllUsesWith and uses in ConstantExpr
Whoops, sorry, I meant "value->replaceAllUsesWith".
Should I create a new post with an updated title?
Thanks
Siddharth
On Thu 17 Aug, 2017, 01:05 Tim Northover <t.p.northover at gmail.com> wrote:
> On 16 August 2017 at 15:39, (IIIT) Siddharth Bhat via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > From what I have observed, using
2020 Sep 30
2
Creating a global variable for a struct array
Let me clarify my question.
I have a struct array h1 as follows:
dhash h1[10];
I want to get a Constant* to variable h1. It looks like I can use ConstantStruct::get(StructType*, ArrayRef<Constant *>) to do this.
My question is how to get the second argument of type ArrayRef<Constant *> from the above variable h1.
Thanks,
Chaitra
________________________________
From: Tim Northover