search for: cmp1

Displaying 20 results from an estimated 73 matches for "cmp1".

Did you mean: cmp
2016 May 19
4
GEP index canonicalization
...fy to promote an index variable to pointer size. However that introduces truncations, which can't be optimized away by simple peephole optimizations in the backend anymore. Does it make sense to add a target hook for this? -Manuel Example: define void @foo(i32 %n, i32* %a) { entry: %cmp1 = icmp slt i32 0, %n br i1 %cmp1, label %for.body, label %for.end for.body: ; preds = %for.body, %entry %i = phi i32 [ %inc, %for.body ], [ 0, %entry ] %ptr = getelementptr inbounds i32, i32* %a, i32 %i store i32 %i, i32* %ptr, align 4 %inc =...
2015 Feb 08
11
[LLVMdev] RFC: Proposal to Remove Poison
...possible for %load's undef to be either true or false, %cmp must be equivalent to undef as well. This is completely consistent with the above rules. The following program is a little more interesting: define i1 @g() { %mem = alloca i1 %load = load i1* %mem %cmp0 = icmp eq i1 %load, 0 %cmp1 = icmp eq i1 %load, 1 %and = xor i1 %cmp0, %cmp1 ret i1 %and } The intent of this program is to compare a memory location against all possible values the location might have. If we ran LLVM's InstCombine pass then %and would have been replaced with the "expected" result of true....
2012 Mar 29
1
[LLVMdev] Problem recognizing nested select operations
...i8*, ...)* @__isoc99_scanf(i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i32* %a) nounwind %0 = load i32* %a, align 4, !tbaa !0 %cmp = icmp sgt i32 %0, 255 br i1 %cmp, label %cond.end4, label %cond.false cond.false: ; preds = %entry %cmp1 = icmp slt i32 %0, 0 %cond = select i1 %cmp1, i32 0, i32 %0 br label %cond.end4 cond.end4: ; preds = %cond.false, %entry %cond5 = phi i32 [ 255, %entry ], [ %cond, %cond.false ] store i32 %cond5, i32* %a, align 4, !tbaa !0 %call6 = call i32 (i...
2012 Nov 26
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 ┆ ┆ │ │ ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┢━━━━━━━┪╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶ ↑ ┃ ┃ ↑ ↑ ·...
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
...64* %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
...ncompressAllTagsv(i16* %arrayidx) 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:...
2019 Jan 29
3
Finding label of basic block where a conditional branch merges
...== NULL || y == NULL) {     do {        // ...     } while (0); } This yields the following IR: br i1 %cmp, label %if.then, label %lor.lhs.false, !dbg !31 lor.lhs.false:                                    ; preds = %entry   %1 = load %struct.s1*, %struct.s1** %s1.addr, align 8, !dbg !32   %cmp1 = icmp eq %struct.s1* %1, null, !dbg !33   br i1 %cmp1, label %if.then, label %if.end, !dbg !34 if.then:                                          ; preds = %lor.lhs.false, %entry   br label %do.body, !dbg !35, !llvm.loop !37 do.body:                                          ; preds = %if.then...
2014 Nov 04
10
[LLVMdev] lifetime.start/end clarification
...hi i8* [ %.pre, %if.else.label_crit_edge ], [ %0, %if.then ] call void @_Z3barR1X(%struct.X* dereferenceable(33) %x) call void @llvm.lifetime.end(i64 33, i8* %.pre-phi) br label %if.end3 if.else: ; preds = %entry tail call void @_Z3bazv() %cmp1 = icmp eq i32 %i, 0 br i1 %cmp1, label %if.else.label_crit_edge, label %if.end3 if.else.label_crit_edge: ; preds = %if.else %.pre = getelementptr inbounds %struct.X* %x, i64 0, i32 0, i64 0 br label %label if.end3: ;...
2016 Mar 03
3
Failure to turn a div by power of 2 into a single shift
I'd missed the fact that j wasn't just being decremented. This isn't as easy as I said. Philip On 03/03/2016 02:36 PM, Philip Reames via llvm-dev wrote: > SCEV should be able to easily prove that j is positive here. I'm not > sure where the right place to use that information would be in this > case. Sanjoy, can you comment? > > Philip > > On 03/03/2016
2017 Aug 02
3
[InstCombine] Simplification sometimes only transforms but doesn't simplify instruction, causing side effect in other pass
...t;> %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 >&...
2013 Oct 01
3
[LLVMdev] ScalarEvolution::createNodeForPHI
...verybody, I'm working on some improvements on trip count computation with ScalarEvolution analysis. Considering the following test ;----------------------------------------------------------------------------; define void @foo(i32 %a, i32 %b, i32 %s) #0 { entry: %cmp = icmp sgt i32 %s, 0 %cmp15 = icmp sgt i32 %a, %b %or.cond = and i1 %cmp, %cmp15 br i1 %or.cond, label %for.body, label %if.end for.body: %i.06 = phi i32 [ %sub, %for.body ], [ %a, %entry ] tail call void @f(i32 %i.06) #2 %sub = sub nsw i32 %i.06, %s %cmp1 = icmp sgt i32 %sub, %b br i1 %cmp1, label %for.body,...
2020 Jun 10
2
LoopStrengthReduction generates false code
...; preds = %while.body, %entry %lsr.iv = phi i32 [ %lsr.iv.next, %while.body ], [ 0, %entry ] %uglygep = getelementptr i8, i8* bitcast ([10 x i32]* @buffer to i8*), i32 %lsr.iv %uglygep1 = bitcast i8* %uglygep to i32* %0 = load i32, i32* %uglygep1, align 4, !tbaa !2 %cmp1 = icmp ne i32 %0, -559038737 %cmp11 = icmp eq i32 %lsr.iv, 0 %cmp = or i1 %cmp11, %cmp1 %lsr.iv.next = add nuw i32 %lsr.iv, 8 br i1 %cmp, label %while.body, label %while.end ; Exit blocks while.end: ; preds = %while.body store volatile i32 %0, i32*...
2013 Nov 19
3
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...t; +; CHECK: ret void >>>> + >>>> +entry: >>>> + %cmp = icmp slt i32 %x, 0 >>>> + br i1 %cmp, label %if.then, label %if.end3 >>>> + >>>> +if.then: ; preds = %entry >>>> + %cmp1 = icmp slt i32 %y, 0 >>>> + br i1 %cmp1, label %if.then2, label %if.end >>>> + >>>> +if.then2: ; preds = %if.then >>>> + call void @callee() >>>> + br label %if.end >>>> + >>>...
2017 Jul 06
2
Dataflow analysis regression in 3.7
On Thu, Jul 6, 2017 at 7:00 AM, Davide Italiano <davide at freebsd.org> wrote: > On Wed, Jul 5, 2017 at 3:59 PM, Johan Engelen via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Hi all, > > I just found an optimization regression regarding simple > > dataflow/constprop analysis: > > https://godbolt.org/g/Uz8P7t > > > > This code >
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...t;>>> + >>>>> +entry: >>>>> + %cmp = icmp slt i32 %x, 0 >>>>> + br i1 %cmp, label %if.then, label %if.end3 >>>>> + >>>>> +if.then: ; preds = %entry >>>>> + %cmp1 = icmp slt i32 %y, 0 >>>>> + br i1 %cmp1, label %if.then2, label %if.end >>>>> + >>>>> +if.then2: ; preds = %if.then >>>>> + call void @callee() >>>>> + br label %if.end >>&gt...
2013 Oct 02
0
[LLVMdev] ScalarEvolution::createNodeForPHI
...rovements on trip count computation with ScalarEvolution > analysis. > Considering the following test > > ;----------------------------------------------------------------------------; > define void @foo(i32 %a, i32 %b, i32 %s) #0 { > entry: > %cmp = icmp sgt i32 %s, 0 > %cmp15 = icmp sgt i32 %a, %b > %or.cond = and i1 %cmp, %cmp15 > br i1 %or.cond, label %for.body, label %if.end > > for.body: > %i.06 = phi i32 [ %sub, %for.body ], [ %a, %entry ] > tail call void @f(i32 %i.06) #2 > %sub = sub nsw i32 %i.06, %s > %cmp1 = icmp sgt i32 %sub, %...
2012 Dec 04
2
[LLVMdev] RFC: change BoundsChecking.cpp to use address-based tests
...ently, 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 >> >> ┆ ┆ >> │ │ >> ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┢━━━━━━━┪╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶ &gt...
2013 Aug 15
0
[LLVMdev] BranchInst comparison
How could BranchInst be used to insert new branch between two basic blocks to get result like this example: br label %if.else br label %if.then br i1 %cmp1, label %if.then, label %if.else Thanks for your help On 14 August 2013 21:36, Eli Friedman <eli.friedman at gmail.com> wrote: > Your question isn't clear; please restate what specifically isn't working. > > -Eli > > On Wed, Aug 14, 2013 at 11:57 AM, Rasha Omar <r...
2013 Nov 19
3
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
...;>>>> +entry: >>>>>> + %cmp = icmp slt i32 %x, 0 >>>>>> + br i1 %cmp, label %if.then, label %if.end3 >>>>>> + >>>>>> +if.then: ; preds = %entry >>>>>> + %cmp1 = icmp slt i32 %y, 0 >>>>>> + br i1 %cmp1, label %if.then2, label %if.end >>>>>> + >>>>>> +if.then2: ; preds = %if.then >>>>>> + call void @callee() >>>>>> + br label...