search for: smax

Displaying 20 results from an estimated 51 matches for "smax".

Did you mean: max
2009 Jun 24
2
[LLVMdev] Handling SMax(N, N - constInt) in Scalar Evolution pass
...ted a prototype using the Scalar Evolution pass. Here are the > > pseudo-code of the implementation: > > > > const SCEV * offset = SE->getMinusSCEV(SE->getSCEV(GEP), GEPBase); > > const SCEV * bounds = SE->getSCEV(objSize); > > > > if (SE->getSMaxExpr(offset, bounds) == bounds) { > > ++safeGEPs; > > } > > > > But it turns out that SCEVSMaxExpr does not handle the case of SMax(N, > > N-2). > > Consider 8-bit integers and N = -127. N-1 equals INT_MIN and N-2 then is > equal to INT_MAX, or 127. In...
2009 Jun 24
1
[LLVMdev] Handling SMax(N, N - constInt) in Scalar Evolution pass
...en the access of p[s - 2] always stays in bound. I implemented a prototype using the Scalar Evolution pass. Here are the pseudo-code of the implementation: const SCEV * offset = SE->getMinusSCEV(SE->getSCEV(GEP), GEPBase); const SCEV * bounds = SE->getSCEV(objSize); if (SE->getSMaxExpr(offset, bounds) == bounds) { ++safeGEPs; } But it turns out that SCEVSMaxExpr does not handle the case of SMax(N, N-2). My question is, is there a plan to support something like this, or is it possible to do some refactoring to enhance the capability of Scalar Evolution? I notice that S...
2009 Jun 24
0
[LLVMdev] Handling SMax(N, N - constInt) in Scalar Evolution pass
...n bound. > > I implemented a prototype using the Scalar Evolution pass. Here are the > pseudo-code of the implementation: > > const SCEV * offset = SE->getMinusSCEV(SE->getSCEV(GEP), GEPBase); > const SCEV * bounds = SE->getSCEV(objSize); > > if (SE->getSMaxExpr(offset, bounds) == bounds) { > ++safeGEPs; > } > > But it turns out that SCEVSMaxExpr does not handle the case of SMax(N, > N-2). Consider 8-bit integers and N = -127. N-1 equals INT_MIN and N-2 then is equal to INT_MAX, or 127. In that case, the SMax would equal N-2, no...
2009 Jun 24
0
[LLVMdev] Handling SMax(N, N - constInt) in Scalar Evolution pass
Nick, It might be a little bit difficult to handle SMax correctly. But is it possible to reduce A+(-A) to 0 in SAddExpr? Haohui On Wed, 2009-06-24 at 01:05 -0500, Mai, Haohui wrote: > On Tue, 2009-06-23 at 22:55 -0700, Nick Lewycky wrote: > > Mai, Haohui wrote: > > > Hi all, > > > > > > I'm working on a projec...
2009 Jun 24
1
[LLVMdev] Handling SMax(N, N - constInt) in Scalar Evolution pass
Mai, Haohui wrote: > Nick, > > It might be a little bit difficult to handle SMax correctly. But is it > possible to reduce A+(-A) to 0 in SAddExpr? Yes, it should already do that. Here's a quick test I wrote up: $ cat x.ll define i8 @test(i8 %x) { %neg = sub i8 0, %x %sum = add i8 %x, %neg ret i8 %sum } $ llvm-as < x.ll | opt -analyze -sca...
2009 Jun 24
4
[LLVMdev] killing vicmp and vfcmp
Now that icmp and fcmp have supported returning vectors of i1 for a while, I think it's time to remove the vicmp and vfcmp instructions from LLVM. The good news is that we've never shipped a release that included them so we won't be providing auto-upgrade support. There is some existing backend support for vicmp and vfcmp that looks different from what icmp and fcmp do. If this
2005 Feb 03
1
Efficient selection and alteration of dataframe records
...eciated. Thanks for your time, Dan plotdf=data.frame( tag=1:100, pspp=c(rep("Sp1",40),rep("Sp2",30),rep("Sp3",20),rep("Sp4",5),rep("Sp5",5)), dim=runif(100)*100) plotdf[1,] abun.table=as.data.frame(table(plotdf$pspp)) #2.1 calculate Smax (count of species) Smax=length(abun.table$Freq[abun.table$Freq>0]) Smax traitdf=data.frame( tspp=c("Sp1","Sp2","Sp3","Sp4","Sp5"), width=runif(5), abun=abun.table$Freq) traitdf[1,] rm(abun.table) #3. merge plotdf and traitdf plo...
2012 Oct 30
0
[LLVMdev] Any plan to add MIN/MAX isd node?
.... Select and Compare is not associative > neither. at the IR level LLVM already has pattern matching helpers for identifying min/max idioms, here is part of a transform using this, from InstructionSimplify.cpp: // Signed variants on "max(a,b)>=a -> true". if (match(LHS, m_SMax(m_Value(A), m_Value(B))) && (A == RHS || B == RHS)) { if (A != RHS) std::swap(A, B); // smax(A, B) pred A. EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". // We analyze this as smax(A, B) pred A. P = Pred; } At the codegen level, the...
2017 Jan 20
3
[InstCombine] rL292492 affected LoopVectorizer and caused 17.30%/11.37% perf regressions on Cortex-A53/Cortex-A15 LNT machines
...body5_crit_edge ], [ 2, %for.cond.preheader ] %2 = add i64 %indvar, 2 %3 = shl i64 %indvar, 1 %4 = add i64 %3, 4 %5 = add i64 %indvar, 2 %6 = shl i64 %indvar, 1 %7 = add i64 %6, 4 %8 = add i64 %indvar, 2 %9 = mul i64 %indvar, 3 %10 = add i64 %9, 6 %11 = icmp sgt i64 %10, 8193 %smax = select i1 %11, i64 %10, i64 8193 %12 = mul i64 %indvar, -2 %13 = add i64 %12, -5 %14 = add i64 %smax, %13 %15 = add i64 %indvar, 2 %16 = udiv i64 %14, %15 %17 = add i64 %16, 1 %tobool7 = icmp eq i8 %1, 0 br i1 %tobool7, label %for.inc16, label %if.then ============================...
2012 Oct 30
1
[LLVMdev] Any plan to add MIN/MAX isd node?
...code. Select and Compare is not associative neither. at the IR level LLVM already has pattern matching helpers for identifying min/max idioms, here is part of a transform using this, from InstructionSimplify.cpp: // Signed variants on "max(a,b)>=a -> true". if (match(LHS, m_SMax(m_Value(A), m_Value(B))) && (A == RHS || B == RHS)) { if (A != RHS) std::swap(A, B); // smax(A, B) pred A. EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". // We analyze this as smax(A, B) pred A. P = Pred; } At the codegen level, the...
2012 Oct 30
2
[LLVMdev] Any plan to add MIN/MAX isd node?
Hi Duncan, To use select, usually, there is a compare before select. Presence of comparison will disable some opportunities to optimize some code. Select and Compare is not associative neither. Thanks, Yin -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Duncan Sands Sent: Tuesday, October 30, 2012
2017 Jan 22
2
[InstCombine] rL292492 affected LoopVectorizer and caused 17.30%/11.37% perf regressions on Cortex-A53/Cortex-A15 LNT machines
...7% perf regressions on Cortex-A53/Cortex-A15 LNT machines Thanks for letting me know about this problem! There's no 'shl nsw' visible in the earlier (r292487) code, so it would be better to see exactly what the IR looks like before that added transform fires. But I see a red flag: %smax = select i1 %11, i64 %10, i64 8193 The new icmp transform allowed us to create an smax, but we have this hack in InstCombiner::visitICmpInst(): // Test if the ICmpInst instruction is used exclusively by a select as // part of a minimum or maximum operation. If so, refrain from doing // any o...
2010 Feb 19
3
Date label lost while inverting y axis.
...list and I found a response: inverting the ylim parameter of the plot. I did it, the data are displayed correctly, but now the problem is that there is no more labels on the Y axis. How should I proceed to have it back? Here is my code: ******************************* sMin=min(series[,2:3]) sMax=max(series[,2:3]) plot(series[,2],dates,xlim=c(sMin,sMax),ylim=c(max(dates),min(dates)),col="green",main="",type="l",xlab="Value") ******************************* Thanks, -- Jeremie [[alternative HTML version deleted]]
2017 Jan 22
2
[InstCombine] rL292492 affected LoopVectorizer and caused 17.30%/11.37% perf regressions on Cortex-A53/Cortex-A15 LNT machines
...7% perf regressions on Cortex-A53/Cortex-A15 LNT machines Thanks for letting me know about this problem! There's no 'shl nsw' visible in the earlier (r292487) code, so it would be better to see exactly what the IR looks like before that added transform fires. But I see a red flag: %smax = select i1 %11, i64 %10, i64 8193 The new icmp transform allowed us to create an smax, but we have this hack in InstCombiner::visitICmpInst(): // Test if the ICmpInst instruction is used exclusively by a select as // part of a minimum or maximum operation. If so, refrain from doing // any o...
2019 Feb 09
2
how experimental are the llvm.experimental.vector.reduce.* functions?
I'm interested in using @llvm.experimental.vector.reduce.smax/umax to implement runtime overflow checking for vectors. Here's an example checked addition, without vectors, and then I'll follow the example with what I would do for checked addition with vectors. Frontend code (zig): export fn entry() void { var a: i32 = 1; var b: i32 = 2;...
2020 Oct 12
3
Manipulating DAGs in TableGen
...g them (e.g. >"functionName(argName=x, otherArgName=y)"). However, this is _not_ how >$names work! > >Their most prominent application is for instruction selection pattern >matching, e.g. taken at random from AMDGPU/SOPInstructions.td: > >def : GCNPat < > (i32 (smax i32:$x, (i32 (ineg i32:$x)))), > (S_ABS_I32 SReg_32:$x) >>; > >The $x is _not_ the name of the argument to smax, ineg, or S_ABS_I32. >For example, if you look at how S_ABS_I32 is defined, you'll see that >its input operand is called $src0. > >Instead, the name allows...
2017 Jan 23
2
[InstCombine] rL292492 affected LoopVectorizer and caused 17.30%/11.37% perf regressions on Cortex-A53/Cortex-A15 LNT machines
...7% perf regressions on Cortex-A53/Cortex-A15 LNT machines Thanks for letting me know about this problem! There's no 'shl nsw' visible in the earlier (r292487) code, so it would be better to see exactly what the IR looks like before that added transform fires. But I see a red flag: %smax = select i1 %11, i64 %10, i64 8193 The new icmp transform allowed us to create an smax, but we have this hack in InstCombiner::visitICmpInst(): // Test if the ICmpInst instruction is used exclusively by a select as // part of a minimum or maximum operation. If so, refrain from doing // any o...
2016 Sep 16
4
SCEV cannot compute the trip count of Simple loop
Hi Deepali, SCEV reports the backedge taken count as "((-1 * (sext i32 (3 + %x) to i64))<nsw> + ((sext i32 (3 + %x) to i64) smax (sext i32 (6 + %x) to i64)))", so symbolically it does have an answer. Ideally SCEV should be able to exploit <nsw> on (3 + %x) and (6 + %x) to fold the expression above to "3", but due to some systemic issues SCEV can't exploit <nsw> as aggressively as we should. W...
2012 Dec 05
6
[LLVMdev] max/min intrinsics
...the implementation could be simplified (and less fragile) if max and min intrinsics were recognized rather than looking for compare-select sequences. The suggestion was to change compare-selects into max and min intrinsic calls during instcombine. The intrinsics to add are: declare iN llvm.{smin,smax}.iN(iN %a, iN %b) declare iN llvm.{umin,umax}.iN(iN %a, iN %b) declare fN llvm.{fmin,fmax}.fN(fN %a, fN %b) What does the community think? Paul
2019 Feb 09
2
how experimental are the llvm.experimental.vector.reduce.* functions?
...ll return > a <X x i1> vector for overflow instead i1 when vectors are used. > > ~Craig > > > On Fri, Feb 8, 2019 at 11:03 PM Andrew Kelley via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> I'm interested in using @llvm.experimental.vector.reduce.smax/umax to >> implement runtime overflow checking for vectors. Here's an example >> checked addition, without vectors, and then I'll follow the example with >> what I would do for checked addition with vectors. >> >> Frontend code (zig): >> >> export f...