search for: breakconstantgep

Displaying 17 results from an estimated 17 matches for "breakconstantgep".

Did you mean: breakconstantgeps
2011 Aug 28
0
[LLVMdev] How to break/iterate over nested instructions.
Dear Manish, First, in answer to your original question: yes, there is a pass that will convert constant expression GEPs used within LLVM instructions into GEP instructions. SAFECode has a pass called BreakConstantGEPs in safecode/trunk/lib/ArrayBoundChecks/BreakConstantGEPs.cpp (http://llvm.org/viewvc/llvm-project/safecode/trunk/lib/ArrayBoundChecks/BreakConstantGEPs.cpp?view=log). It works with LLVM 2.7; updating it to LLVM mainline should be trivial. Second, to reiterate what others have said, you need t...
2011 Aug 27
4
[LLVMdev] How to break/iterate over nested instructions.
Hi Duncan, Why to break? I wish to analyse all the operands of getelemetptr instructions. For which I iterate over the code and get the instruction of interest by getopcode == getelementptr. But the getelementptrs in this form as in my last mail are getting away from my pass. So i wish to break it. I have a work around if breaking is not possible, but I think it may be a common requirement by
2011 Jan 23
1
[LLVMdev] Pointers in Load and Store
...FECode, is responsible for > inserting array bounds checks and indirect function call checks.  In > particular, you want to look at the addGetElementPtrChecks() method. > > As for Constant Expression GEPs, you want to look at the BreakConstGEP pass, > located in lib/ArrayBoundsChecks/BreakConstantGEPs.cpp. > > The BreakConstantGEP pass is run first.  All it does is find instructions > that use constant expression GEPs and replaces the Constant Expression GEP > with a GEP instruction.  All of the other SAFECode passes that worry about > array bounds checks (i.e., the static array...
2012 Sep 24
2
[LLVMdev] [cfe-dev] SPIR provisional specification is now available in the Khronos website
> > For the record, I just workarounded it in pocl by borrowing the > BreakConstantGEPs code from SAFECode. But for SPIR specs, IMHO, this should > be reconsidered. Yes, I agree. On 24 September 2012 15:08, Pekka Jääskeläinen <pekka.jaaskelainen at tut.fi>wrote: > Well, > > To be honest I'm not very comfortable with the whole constant GEP > idea. It's...
2011 Jan 22
0
[LLVMdev] Pointers in Load and Store
...hich, in mainline SAFECode, is responsible for inserting array bounds checks and indirect function call checks. In particular, you want to look at the addGetElementPtrChecks() method. As for Constant Expression GEPs, you want to look at the BreakConstGEP pass, located in lib/ArrayBoundsChecks/BreakConstantGEPs.cpp. The BreakConstantGEP pass is run first. All it does is find instructions that use constant expression GEPs and replaces the Constant Expression GEP with a GEP instruction. All of the other SAFECode passes that worry about array bounds checks (i.e., the static array bounds checking pass...
2013 Sep 28
1
[LLVMdev] Promote constant expressions to registers
Hello, Is there a way to generate LLVM IR without constant expressions by promoting constant expressions to registers? e.g.: %tmp1 = tail call i8* @foo(i8* bitcast (i32* @x to i8*), i8* %tmp, i64 4) #1 would be converted to: %tmp1 = bitcast i32* @x to i8* %tmp2 = tail call i8* @foo(i8* %tmp1, i8* %tmp, i64 4) #1 I find quite inconvenient and redundant to maintain constant expressions when
2012 Sep 26
0
[LLVMdev] [cfe-dev] SPIR provisional specification is now available in the Khronos website
Micah, Boaz, Do you guys have any ideas about how to fix this issue? Cheers, James On 24 September 2012 16:04, James Molloy <james at jamesmolloy.co.uk> wrote: > For the record, I just workarounded it in pocl by borrowing the >> BreakConstantGEPs code from SAFECode. But for SPIR specs, IMHO, this >> should >> be reconsidered. > > > Yes, I agree. > > On 24 September 2012 15:08, Pekka Jääskeläinen <pekka.jaaskelainen at tut.fi>wrote: > >> Well, >> >> To be honest I'm not very comforta...
2011 Aug 19
1
[LLVMdev] Break operands into multiple instructions
Hi All, I am creating an instrumentation pass using LLVM libraries. I am using clang++ (version 2.9) to compile cpp code into LLVM bit code. When I generate the llvm bit code using clang++ using -O3, I get many instances of instructions that look like the following. br i1 icmp ne (i8* bitcast (i32 (i32)* @pthread_cancel to i8*), i8* null), label %bb23, label %bb25 Here three LLVM instructions
2016 Apr 27
3
ArrayBoundChecks in SafeCode-llvm37
Hi, I am wondering if anyone could run ArrayBoundChecks located in SafeCode-llvm37 (https://github.com/jtcriswell/safecode-llvm37) on llvm-3.8? Thanks. Syed -- Rafi
2011 Jan 22
2
[LLVMdev] Pointers in Load and Store
John, I have looked at the SAFECode and thought following sould work if (isa<Constant>(I.getOperand(0))) { Out << "*** operand 0 is a constant ******"; if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) { Out << "********operand is an instruction ****"; if (GetElementPtrInst *gepI =
2011 Oct 21
0
[LLVMdev] Replacing uses within a function
...hieve this? I find it would be better to force > all instructions (like the GEP above) to be directly place on the > function, and not as operands of other instructions, unless there is a > good& known reason not to. There's a few options. First, you could use something like the BreakConstantGEP pass from SAFECode to convert constant expression GEPs into GEP instructions. Then your old approach will work properly. However, the speed of the code may suffer because GEP constant expressions are replaced with constant values during code generation while GEP instructions most likely will...
2012 Sep 24
0
[LLVMdev] [cfe-dev] SPIR provisional specification is now available in the Khronos website
...clear ;) Anyways, me bringing it up was meant as an example of what can happen if one (mis)uses the C function static variable semantics for something that really is a thread local variable (in usual thread parallel implementations). For the record, I just workarounded it in pocl by borrowing the BreakConstantGEPs code from SAFECode. But for SPIR specs, IMHO, this should be reconsidered. On 09/24/2012 05:00 PM, James Molloy wrote: > Hi, > > Sorry, With a prod from Silviu (cc'd) I now understand - I was interpreting > your use of "constant GEP" as "GEP with constant operand&qu...
2015 Oct 16
3
Break nested instructions?
Is there any pass that breaks an expression out of an instruction's operand into its own instruction, so that such nested instructions become explicit and are thus easier to work with in? e.g Following|call|instruction contains a|GEP|instruction as its first operand. Is there any pass which allows me to break up this: | %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4
2011 Oct 21
2
[LLVMdev] Replacing uses within a function
Hi all, I am trying to replace all uses of a value1 *inside of a given function* to use value2. My strategy was to iterate all the basic blocks, again iterating all the instructions in each basic block, and using replaceUsesOfWith(value1, value2) for every instruction. This used to work all right, but now I am finding some problems. There are instructions like this: store i32 0, i32*
2012 Sep 24
2
[LLVMdev] [cfe-dev] SPIR provisional specification is now available in the Khronos website
Hi, Sorry, With a prod from Silviu (cc'd) I now understand - I was interpreting your use of "constant GEP" as "GEP with constant operand" as opposed to "ConstantGEP node" which of course can only take a Constant* operand, not a Value* operand. I now fully see the problem and realise that my solution is also prone to that problem :) Cheers, James On 24
2012 Sep 26
2
[LLVMdev] [cfe-dev] SPIR provisional specification is now available in the Khronos website
...in the Khronos website Micah, Boaz, Do you guys have any ideas about how to fix this issue? Cheers, James On 24 September 2012 16:04, James Molloy <james at jamesmolloy.co.uk<mailto:james at jamesmolloy.co.uk>> wrote: For the record, I just workarounded it in pocl by borrowing the BreakConstantGEPs code from SAFECode. But for SPIR specs, IMHO, this should be reconsidered. Yes, I agree. On 24 September 2012 15:08, Pekka Jääskeläinen <pekka.jaaskelainen at tut.fi<mailto:pekka.jaaskelainen at tut.fi>> wrote: Well, To be honest I'm not very comfortable with the whole constant...
2013 Jul 10
2
[LLVMdev] lower-lever IR (A-normal form)
Hi, i would like to ask you, if i can get a lower-level representation than the llvm IR.For example, having the following instruction in the llvm IR, call void @llvm.memcpy.i32(i8* %19, i8* getelementptr inbounds ([2 x [2 x [3 x i8]]]* @main.s, i32 0, i32 0, i32 0, i32 0), i32 12, i32 1) i would like to get something like this (in A-normal form (without nested instructions):%temp = i8*