Displaying 9 results from an estimated 9 matches for "icmp_sgt".
2018 May 16
0
ScalarEvolution questions
...sImpliedCond” is not helping for below case, may be I’m missing something:
SCEV1: (1 + (-1 * (sext i32 %n.addr.058 to i64)))<nsw>
SCEV2: 0
Extra-Condition: (n.addr.058 > 7)
In this case expecting result as SCEV1.
This is how using “isImpliedCond”:
Result = SE->isImpliedCond(ICmpInst::ICMP_SGT, B, A, ICmpInst::ICMP_SGT, Var, Const);
Inputs:
A: (1 + (-1 * (sext i32 %n.addr.058 to i64)))<nsw>
B: 0
Var: %n.addr.058
Const: 7
In this case "isImpliedCond" simply returns false.
Thanks,
Ashutosh
-----Original Message-----
From: Nema, Ashutosh
Sent: Thursday, May 10, 2018 10:1...
2018 May 16
1
ScalarEvolution questions
...w case, may be I’m missing something:
>
> SCEV1: (1 + (-1 * (sext i32 %n.addr.058 to i64)))<nsw>
> SCEV2: 0
> Extra-Condition: (n.addr.058 > 7)
> In this case expecting result as SCEV1.
>
> This is how using “isImpliedCond”:
> Result = SE->isImpliedCond(ICmpInst::ICMP_SGT, B, A, ICmpInst::ICMP_SGT, Var, Const);
> Inputs:
> A: (1 + (-1 * (sext i32 %n.addr.058 to i64)))<nsw>
> B: 0
> Var: %n.addr.058
> Const: 7
>
> In this case "isImpliedCond" simply returns false.
In this case isImpliedCond is probably just being imprecise. We c...
2018 May 10
2
ScalarEvolution questions
Thanks Sanjoy, I'll look into this.
-----Original Message-----
From: Sanjoy Das [mailto:sanjoy at playingwithpointers.com]
Sent: Thursday, May 10, 2018 8:07 AM
To: Nema, Ashutosh <Ashutosh.Nema at amd.com>
Cc: llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] ScalarEvolution questions
Hi Ashutosh,
On Wed, May 9, 2018 at 3:28 AM, Nema, Ashutosh via llvm-dev <llvm-dev at
2010 May 06
2
[LLVMdev] Back-edge taken count of loops
...uot;, such as:
void scop_func(long A[], long n) {
long i;
for (i = 1; i<= n; i++)
A[i] = 1;
}
after have a look at the code that computing the back-edge taken count, i
found that ScalarEvolution could only compute back-edge taken count if the
exit condition is ICMP_NE/ICMP_EQ/ICMP_SLT/ICMP_SGT/ICMP_ULT/ICMP_UGT
(ignoring "ComputeBackedgeTakenCountExhaustively"), and the function
"SimplifyICmpOperands" will try to convert other conditions to the
conditions listed above, by doing something like "i <= n" to "i < n+1", but
it refuse to do that un...
2010 Feb 12
2
[LLVMdev] [PATCH] Fix off-by-one errors in the doxygen documentation
...PREDICATE = FCMP_TRUE + 1,
- ICMP_EQ = 32, /// equal
- ICMP_NE = 33, /// not equal
- ICMP_UGT = 34, /// unsigned greater than
- ICMP_UGE = 35, /// unsigned greater or equal
- ICMP_ULT = 36, /// unsigned less than
- ICMP_ULE = 37, /// unsigned less or equal
- ICMP_SGT = 38, /// signed greater than
- ICMP_SGE = 39, /// signed greater or equal
- ICMP_SLT = 40, /// signed less than
- ICMP_SLE = 41, /// signed less or equal
+ ICMP_EQ = 32, ///< equal
+ ICMP_NE = 33, ///< not equal
+ ICMP_UGT = 34, ///< unsigned great...
2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
...m_CombineAnd(
m_c_BinOp(m_CombineAnd(m_Sub(m_Zero(), m_Deferred
(A)),
m_Value(Sub)),
m_Deferred(B)),
m_Value(Mul2)))) &&
Pred == ICmpInst::Predicate::ICMP_SGT) {
}
> Could you guys give some comment? Is there any better idea for this
transform?
>
> Thanks.
>
> BRS//
> Chen Zheng
> Power Compiler Backend Developer
Roman.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.l...
2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
Hi,
There is an opportunity in instCombine for following instruction pattern:
%mul = mul nsw i32 %b, %a
%cmp = icmp sgt i32 %mul, -1
%sub = sub i32 0, %a
%mul2 = mul nsw i32 %sub, %b
%cond = select i1 %cmp, i32 %mul, i32 %mul2
Source code for above pattern:
return (a*b) >=0 ? (a*b) : -a*b;
Currently, llvm(-O3) can not recognize this as abs(a*b).
I initially think we could do this in
2010 May 06
0
[LLVMdev] Back-edge taken count of loops
...A[], long n) {
> long i;
>
> for (i = 1; i<= n; i++)
> A[i] = 1;
> }
>
> after have a look at the code that computing the back-edge taken count, i found that ScalarEvolution could only compute back-edge taken count if the exit condition is ICMP_NE/ICMP_EQ/ICMP_SLT/ICMP_SGT/ICMP_ULT/ICMP_UGT (ignoring "ComputeBackedgeTakenCountExhaustively"), and the function "SimplifyICmpOperands" will try to convert other conditions to the conditions listed above, by doing something like "i <= n" to "i < n+1", but it refuse to do that un...
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
...rn nullptr;
+ uint64_t con_val = Con->getZExtValue();
+
+ if (RHS == CI)
+ IC->swapOperands();
+
+ switch (IC->getPredicate()) {
+ case ICmpInst::ICMP_EQ:
+ case ICmpInst::ICMP_NE:
+ case ICmpInst::ICMP_UGT:
+ case ICmpInst::ICMP_UGE:
+ case ICmpInst::ICMP_ULE:
+ case ICmpInst::ICMP_SGT:
+ case ICmpInst::ICMP_SGE:
+ case ICmpInst::ICMP_SLE:
+ // XXX: check for wrapping
+ if (con_val == UINT64_MAX)
+ return nullptr;
+ return emitStrNLen(Src, ConstantInt::get(SizeType, con_val + 1),
+ B, DL, TLI);
+ case ICmpInst::ICMP_ULT:
+ case ICmpInst::ICMP_SLT:
+ retu...