similar to: Proper way to lower all ConstantExprs?

Displaying 20 results from an estimated 5000 matches similar to: "Proper way to lower all ConstantExprs?"

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 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,
2015 Jan 26
0
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
Inline George > On Jan 26, 2015, at 1:05 PM, Daniel Berlin <dberlin at dberlin.org> wrote: > > George, given that, can you just build constexpr handling (it's not as easy as you think) as a separate funciton and have it use it in the right places? Will do. :) > FWIW, my current list of CFLAA issues is: > > 1. Unknown values (results from ptrtoint, incoming
2004 Jun 17
2
[LLVMdev] Getelementptr woes
Hello, I'm having problems with the following LLVM instruction %tmp.0.i = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([11 x sbyte]* %.str_1, long 0, ...... The first argument in function call, sbyte* getelementptr ([11 x sbyte]* %.str_1..... appears to be ConstantExpression*, and my backend does not support ConstantExpression yet. I probable can implement
2015 Jan 26
2
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
George, given that, can you just build constexpr handling (it's not as easy as you think) as a separate funciton and have it use it in the right places? FWIW, my current list of CFLAA issues is: 1. Unknown values (results from ptrtoint, incoming pointers, etc) are not treated as unknown. These should be done through graph edge (so that they can be one way, otherwise, you will unify
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*>
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
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
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
2017 Aug 17
3
Inst->replaceAllUsesWith and uses in ConstantExpr
I see. Is there a pre-existing way to do this in LLVM? Cheers, ~Siddharth. On Thu, 17 Aug 2017 at 02:12 Craig Topper <craig.topper at gmail.com> wrote: > ConstantExprs are immutable, they can't be changed once they are created. > And a ConstantExpr can reference other ConstantExprs. So replacing all uses > of a Value in a ConstantExpr would require creating a new immutable
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 (
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: Can you give a few more details about what you are doing? Are you running the verifier before writing out bytecode? Is your code operating as a pass? Can you send a dump of the generated LLVM code? > Constant *C = (Constant*)
2012 Dec 17
2
[LLVMdev] target specific ways to extend ConstantExpr
I am looking for a way to allow ConstantExpr to express target specific operations, which will be used in global initializers. The recommended way to extend LLVM IR is using intrinsic functions. But this does not work for ConstantExpr, which the global initializer uses. Should we make ConstantExpr to support some kind of side-effect free intrinsic function calls? If we want to work on such a
2017 Aug 16
2
Inst->replaceAllUsesWith and uses in ConstantExpr
Hello all, >From what I have observed, using `Inst->replaceAllUsesWith` does not replace uses of the `Inst` in `ConstantExpr`s. Is there some way to have a universal replaceAllUsesWith? Thanks, ~Siddharth. -- Sending this from my phone, please excuse any typos! -------------- next part -------------- An HTML attachment was scrubbed... URL:
2012 Dec 17
0
[LLVMdev] target specific ways to extend ConstantExpr
On Dec 17, 2012, at 11:26 AM, Yuan Lin <yulin at nvidia.com> wrote: > I am looking for a way to allow ConstantExpr to express target specific operations, which will be used in global initializers. > > The recommended way to extend LLVM IR is using intrinsic functions. But this does not work for ConstantExpr, which the global initializer uses. > > Should we make
2011 Apr 14
2
[LLVMdev] llvm instrinsic (memcpy/memset/memmov)and ConstantExpression with cast
Hi All, I have a question on ConstantExpressions and llvm intrinsic memcpy/memset/memmove. I am using llvm-2.8 release. In one of the C programs that I am compiling using clang frontend, the call to memcpy instrinsic looks like the following call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp2, i8* bitcast (%struct.ta* @tret to i8*), i64 4, i32 4, i1 false), !dbg !19 The second argument to memcpy is
2015 Jan 30
2
[LLVMdev] question about enabling cfl-aa and collecting a57 numbers
I'm not exactly thrilled about the size of this diff -- I'll happily break it up into more manageable bits later today, because some of it is test fixes, another bit is a minor bug fix, etc. Important bit (WRT ConstantExpr): moved the loop body from buildGraphFrom into a new function. The body has a few tweaks to call constexprToEdges on all ConstantExprs that we encounter.
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
2013 Aug 01
0
[LLVMdev] Lower ConstantExprs into instructions
Hello, I found an out-of-date ConstantExpressionsLower pass in llvm-1.5, it was removed in later versions. Is there any existing similar pass which converts all constant expressions into instructions for recent releases (e.g. 3.1 or above) ? Thanks Yulei