search for: cmp2

Displaying 20 results from an estimated 38 matches for "cmp2".

Did you mean: cmp
2012 Nov 26
2
[LLVMdev] RFC: change BoundsChecking.cpp to use address-based tests
...ments) %memobj = bitcast i8* %mem to i64* %ptr = getelementptr inbounds i64* %memobj, i64 %index %4 = load i64* %ptr, align 8 Currently, the IR for bounds checking this load looks like this: %size = mul i64 8, %elements %offset = mul i64 %index, 8 %objsize = sub i64 %size, %offset %cmp2 = icmp ult i64 %size, %offset %cmp3 = icmp ult i64 %objsize, 8 %cmp1 = icmp slt i64 %offset, 0 %9 = or i1 %cmp2, %cmp3 %11 = or i1 %cmp1, %9 br i1 %11, label %trap, label %12 ┆ ┆ │ │ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┢━━━━━━━┪╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶...
2014 Sep 19
2
[LLVMdev] poison and select
Today I ran into another aspect of the poison problem... Basically, SimplifyCFG wants to take expr1 && expr2 and flatten it into x = expr1 y = expr2 x&y This isn't safe when expr2 might execute UB. The consequence is that no LLVM shift instruction is safe to speculatively execute, nor is any nsw/nuw/exact variant, unless the operands can be proven to be in
2012 Nov 26
0
[LLVMdev] RFC: change BoundsChecking.cpp to use address-based tests
...4* > %ptr = getelementptr inbounds i64* %memobj, i64 %index > %4 = load i64* %ptr, align 8 > > Currently, the IR for bounds checking this load looks like this: > > %size = mul i64 8, %elements > %offset = mul i64 %index, 8 > %objsize = sub i64 %size, %offset > > %cmp2 = icmp ult i64 %size, %offset > %cmp3 = icmp ult i64 %objsize, 8 > %cmp1 = icmp slt i64 %offset, 0 > > %9 = or i1 %cmp2, %cmp3 > %11 = or i1 %cmp1, %9 > br i1 %11, label %trap, label %12 > > ┆ ┆ > │ │ > ╴╴╴╴...
2017 Aug 02
3
[InstCombine] Simplification sometimes only transforms but doesn't simplify instruction, causing side effect in other pass
...) local_unnamed_addr { entry: %t1 = load i16, i16* %arrayidx, align 2 %conv.i = zext i16 %t1 to i32 %and.i = and i32 %conv.i, 255 %and7.i = and i32 %conv.i, 1792 %t3 = zext i32 %and7.i to i64 %t4 = load i64, i64* @a, align 8 %add.i = add i64 %t4, %t3 %cmp1 = icmp eq i64 %add.i, 1 %cmp2 = icmp ult i32 %and.i, 101 %bool = and i1 %cmp1, %cmp2 br i1 %bool, label %if.then, label %if.else, !prof !0 if.then: ; preds = %entry %r1 = trunc i64 %add.i to i32 br label %return if.else: ; preds = %entry...
2017 Aug 02
3
[InstCombine] Simplification sometimes only transforms but doesn't simplify instruction, causing side effect in other pass
...align 2 >> %conv.i = zext i16 %t1 to i32 >> %and.i = and i32 %conv.i, 255 >> %and7.i = and i32 %conv.i, 1792 >> %t3 = zext i32 %and7.i to i64 >> %t4 = load i64, i64* @a, align 8 >> %add.i = add i64 %t4, %t3 >> %cmp1 = icmp eq i64 %add.i, 1 >> %cmp2 = icmp ult i32 %and.i, 101 >> %bool = and i1 %cmp1, %cmp2 >> br i1 %bool, label %if.then, label %if.else, !prof !0 >> >> if.then: ; preds = %entry >> %r1 = trunc i64 %add.i to i32 >> br label %return >> >>...
2016 Jan 28
2
Find the instructions where a particular value is defined
...8 br i1 %cmp, label %if.then, label %if.else 60 if.then: ; preds = %entry 61 store i32 10, i32* %b, align 4 62 br label %if.end.4 63 64 if.else: ; preds = %entry 65 %1 = load i32, i32* %a, align 4 66 %cmp2 = icmp slt i32 %1, 10 67 br i1 %cmp2, label %if.then.3, label %if.end 68 69 if.then.3: ; preds = %if.else 70 store i32 5, i32* %b, align 4 71 br label %if.end 72 73 if.end: ; preds = %if.then.3, %if.else...
2017 Feb 06
2
Adding Extended-SSA to LLVM
...an makes sense to me. > > Regarding phis, what about diamonds, e.g.: > > > define i32 @f(i32 %x) { > br .., label %bb0, label %bb1 > bb0: > %cmp = icmp sge i32 %x, 0 ; x > 0 > br i1 %cmp, label %bb2, label %bb3 > bb1: > %x2 = add nsw nuw %x, 1 > %cmp2 = icmp sge i32 %x2, 2 ; x+1 > 2 / x > 1 > br i1 %cmp2, label %bb2, label %bb3 > bb2: > %x3 = phi i32 [ %x, %bb0 ], [ %x2, %bb1 ] > ; CVP says: %x3 is > 0 > ... > br label %bb3 > bb3: > ... > } > > CVP can infer that %x > 0 because the un...
2013 Jan 25
0
[LLVMdev] llvm alloca dependencies
...am running my pass with opt ? It is still one thing that I don't understand. If the memory accesses will be eliminated, and I have the following situation: %i = alloca i32, align 4 %j = alloca i32, align 4 ..... %2 = load i32* %i, align 4 %3 = load i32* %j, align 4 %add = add nsw i32 %2, %3 %cmp2 = icmp sgt i32 %add, 2 How can I check that %cmp2 is dependent on both allocas? Sorry if the question was asked without any testing with optimizations enabled. Basically, my plan is : if (Inst->getOpcode()==Instruction::Load) { LoadInst *LD10 = cast<LoadInst>(Inst);...
2012 Dec 04
2
[LLVMdev] RFC: change BoundsChecking.cpp to use address-based tests
...ds i64* %memobj, i64 %index >> %4 = load i64* %ptr, align 8 >> >> Currently, the IR for bounds checking this load looks like this: >> >> %size = mul i64 8, %elements >> %offset = mul i64 %index, 8 >> %objsize = sub i64 %size, %offset >> >> %cmp2 = icmp ult i64 %size, %offset >> %cmp3 = icmp ult i64 %objsize, 8 >> %cmp1 = icmp slt i64 %offset, 0 >> >> %9 = or i1 %cmp2, %cmp3 >> %11 = or i1 %cmp1, %9 >> br i1 %11, label %trap, label %12 >> >> ┆ ┆ >>...
2013 Nov 08
1
[LLVMdev] loop vectorizer and storing to uniform addresses
...4 %2, %3 br i1 %cmp, label %for.body, label %for.end8 for.body: ; preds = %for.cond store i64 0, i64* %q, align 8 br label %for.cond1 for.cond1: ; preds = %for.inc, %for.body %4 = load i64* %q, align 8 %cmp2 = icmp slt i64 %4, 4 br i1 %cmp2, label %for.body3, label %for.end for.body3: ; preds = %for.cond1 %5 = load i64* %i, align 8 %mul = mul nsw i64 %5, 4 %6 = load i64* %q, align 8 %add = add nsw i64 %mul, %6 %7 = load float** %A.addr, align 8...
2013 Jan 25
2
[LLVMdev] llvm alloca dependencies
Hi Alexandru, On 25/01/13 10:23, Alexandru Ionut Diaconescu wrote: > Thank you a lot for your response. I will try to use your approach with chasing > back along def-use chains to find instructions that define the registers used in > the load. Can you tell me please what class/methods/existing path are good for > this? I assume that I must have a method with arguments like the
2017 Aug 02
2
[InstCombine] Simplification sometimes only transforms but doesn't simplify instruction, causing side effect in other pass
...y: > %t1 = load i16, i16* %arrayidx, align 2 > %conv.i = zext i16 %t1 to i32 > %and.i = and i32 %conv.i, 255 > %and7.i = and i32 %conv.i, 1792 > %t3 = zext i32 %and7.i to i64 > %t4 = load i64, i64* @a, align 8 > %add.i = add i64 %t4, %t3 > %cmp1 = icmp eq i64 %add.i, 1 > %cmp2 = icmp ult i32 %and.i, 101 > %bool = and i1 %cmp1, %cmp2 > br i1 %bool, label %if.then, label %if.else, !prof !0 > > if.then: ; preds = %entry > %r1 = trunc i64 %add.i to i32 > br label %return > > if.else:...
2014 Nov 14
2
[LLVMdev] poison and select
...dependence thing is that it is a runtime, exact, property of a program. So "select %c, %a, %b" is dynamic-dependent on "%a" only in executions where "%c" is true. In the example in previous email, for example, %add = add nsw i32 %a, 1 %cmp1 = icmp eq i32 %a, 0 %cmp2 = icmp slt i32 %add, 0 %and = and i1 %cmp1, %cmp2 %and is *not* `dynamic-dependent` on %cmp2 in the runs in which %cmp1 is false. Another more complex example, involving conversion of br-PHI to a select: %a = maybe poison br i1 %a, label %left, label %right left: %l = 42 br label %mer...
2013 Apr 23
2
[LLVMdev] 'loop invariant code motion' and 'Reassociate Expression'
...r i1 %cmp, label %while.body, label %while.cond29.preheader [...] for.cond.for.end_crit_edge: ; preds = %for.body %split = phi i32 [ %inc, %for.body ] br label %for.end LICM hoisting to while.cond.outer: %add = add i32 %next.0.ph, 1 LICM hoisting to while.cond.outer: %cmp2 = icmp eq i32 %next.0.ph, 0 LICM hoisting to while.cond.outer: %cmp343 = icmp ult i32 0, %next.0.ph LICM hoisting to while.cond.outer: %add740 = or i32 %next.0.ph, 1 *** IR Dump After Loop Invariant Code Motion *** while.cond: ; preds = %while.cond.outer, %...
2013 Nov 08
0
[LLVMdev] loop vectorizer and storing to uniform addresses
On 7 November 2013 17:18, Frank Winter <fwinter at jlab.org> wrote: > LV: We don't allow storing to uniform addresses > This is triggering because it didn't recognize as a reduction variable during the canVectorizeInstrs() but did recognize that sum[q] is loop invariant in canVectorizeMemory(). I'm guessing the nested loop was unrolled because of the low trip-count, and
2016 Jan 28
2
Find the instructions where a particular value is defined
Sorry, I should ask the following: finds all the instructions of a function where a particular variable is defined? Lets consider the following code snippet: 1. void foo(){ 2. int a, b; 3. if(a > 10) 4. b = 10; 5. if(a<10) 6. b = 5; 7. cout << b; 8. } I would like to know the instructions where variable b can be be defined, i.e, in this case, the instructions 4 and 6. On Wed,
2013 Apr 23
0
[LLVMdev] 'loop invariant code motion' and 'Reassociate Expression'
...%while.cond29.preheader > [...] > > for.cond.for.end_crit_edge: ; preds = %for.body > %split = phi i32 [ %inc, %for.body ] > br label %for.end > LICM hoisting to while.cond.outer: %add = add i32 %next.0.ph, 1 > LICM hoisting to while.cond.outer: %cmp2 = icmp eq i32 %next.0.ph, 0 > LICM hoisting to while.cond.outer: %cmp343 = icmp ult i32 0, %next.0.ph > LICM hoisting to while.cond.outer: %add740 = or i32 %next.0.ph, 1 > *** IR Dump After Loop Invariant Code Motion *** > while.cond: ; preds =...
2013 Apr 25
2
[LLVMdev] 'loop invariant code motion' and 'Reassociate Expression'
...; >> for.cond.for.end_crit_edge: ; preds = %for.body > >> %split = phi i32 [ %inc, %for.body ] > >> br label %for.end > >> LICM hoisting to while.cond.outer: %add = add i32 %next.0.ph, 1 > >> LICM hoisting to while.cond.outer: %cmp2 = icmp eq i32 %next.0.ph, 0 > >> LICM hoisting to while.cond.outer: %cmp343 = icmp ult i32 0, % next.0.ph > >> LICM hoisting to while.cond.outer: %add740 = or i32 %next.0.ph, 1 > >> *** IR Dump After Loop Invariant Code Motion *** > >> while.cond:...
2013 Nov 08
3
[LLVMdev] loop vectorizer and storing to uniform addresses
I am trying my luck on this global reduction kernel: float foo( int start , int end , float * A ) { float sum[4] = {0.,0.,0.,0.}; for (int i = start ; i < end ; ++i ) { for (int q = 0 ; q < 4 ; ++q ) sum[q] += A[i*4+q]; } return sum[0]+sum[1]+sum[2]+sum[3]; } LV: Checking a loop in "foo" LV: Found a loop: for.cond1 LV: Found an induction variable. LV: We
2013 Apr 25
0
[LLVMdev] 'loop invariant code motion' and 'Reassociate Expression'
...for.end_crit_edge: ; preds = %for.body > > >> %split = phi i32 [ %inc, %for.body ] > > >> br label %for.end > > >> LICM hoisting to while.cond.outer: %add = add i32 %next.0.ph, 1 > > >> LICM hoisting to while.cond.outer: %cmp2 = icmp eq i32 %next.0.ph, 0 > > >> LICM hoisting to while.cond.outer: %cmp343 = icmp ult i32 0, %next.0.ph > > >> LICM hoisting to while.cond.outer: %add740 = or i32 %next.0.ph, 1 > > >> *** IR Dump After Loop Invariant Code Motion *** > > >> whil...