Displaying 17 results from an estimated 17 matches for "icmp_eq".
Did you mean:
icmp_seq
2013 Jan 15
2
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
...- if (llvm::isKnownNonNull(LHSPtr) || llvm::isKnownNonNull(RHSPtr)) {
- // If both sides are different identified objects, they aren't equal
- // unless they're null.
- if (LHSPtr != RHSPtr && llvm::isIdentifiedObject(RHSPtr) &&
- Pred == CmpInst::ICMP_EQ)
+ // icmp <object*>, <object*/null>
+ if (LHS->getType()->isPointerTy() && RHS->getType()->isPointerTy()) {
+ // Ignore pointer casts, they are irrevelant for (in)equality tests.
+ Value *LHSPtr = LHS->stripPointerCasts();
+ Value *RHSPtr = RHS->str...
2012 Dec 12
0
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 1:26 PM, Joerg Sonnenberger
<joerg at britannica.bec.de> wrote:
> On Wed, Dec 12, 2012 at 11:01:01AM -0800, Dan Gohman wrote:
>> > Is that
>> > assumption violated if I explicitly cast away const and pass the result
>> > to a function with NoAlias argument?
>>
>> Not immediately, no. It means that you can't access the
2012 Dec 12
3
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 11:01:01AM -0800, Dan Gohman wrote:
> > Is that
> > assumption violated if I explicitly cast away const and pass the result
> > to a function with NoAlias argument?
>
> Not immediately, no. It means that you can't access the constant
> pointer's pointee directly within the noalias argument's scope. Access
> to that object must go
2013 Jan 16
0
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
...interCasts();
+ if (LHSPtr == RHSPtr)
+ return ConstantInt::get(ITy, CmpInst::isTrueWhenEqual(Predicate));
+ if (isa<ConstantPointerNull>(RHSPtr) && isKnownNonNull(LHSPtr)) {
+ if (ICmpInst::isEquality(Pred))
+ return ConstantInt::get(ITy, Predicate != ICmpInst::ICMP_EQ);
+ }
+ if (ICmpInst::isEquality(Pred)) {
+ // RHS is not a null pointer and the objects are different.
+ // Remove inbound GEPs and determine the object types.
+ LHSPtr = LHSPtr->stripInBoundsOffsets();
+ RHSPtr = RHSPtr->stripInBoundsOffsets();
+ // For alloca...
2017 Nov 17
4
Signed or unsigned EQ/NEQ
Hello,
In one of the loop transformations I am developing, I need to convert eq
and neq loop latch condition into less than or greater than depending on
the control flow.
The problem is that CmpInst::ICMP_EQ and CmpInst::ICMP_NE are neither
signed nor unsigned in LLVM. Also, I did not find a way to find out if the
integer operands of the CmpInst are signed or unsigned. Apparently, LLVM
does not distinguish in its type system between signed and unsigned
variables. So, I am not able to generate the appro...
2010 Feb 12
2
[LLVMdev] [PATCH] Fix off-by-one errors in the doxygen documentation
...f unordered, less than, or equal
+ FCMP_UNE = 14, ///< 1 1 1 0 True if unordered or not equal
+ FCMP_TRUE = 15, ///< 1 1 1 1 Always true (always folded)
FIRST_FCMP_PREDICATE = FCMP_FALSE,
LAST_FCMP_PREDICATE = FCMP_TRUE,
BAD_FCMP_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 th...
2010 Jul 27
1
[LLVMdev] How to use the return value of a CallInst
...turn value of a call instruction with 0. The
called function's return type is uint32. The return value is 1 or 0. But the
icmp instruction cannot be created.
CallInst *ret = CallInst::Create(ptr_func, params.begin(), params.end(),
"", bb);
Value *cmp = new ICmpInst(*bb, ICmpInst::ICMP_EQ, ret,
,ConstantInt::get(getIntegerType(32), 0) "")
The runtime error is:
/usr/local/include/llvm/Instructions.h:690:
llvm::ICmpInst::ICmpInst(llvm::BasicBlock&, llvm::CmpInst::Predicate,
llvm::Value*, llvm::Value*, const llvm::Twine&): Assertion
`getOperand(0)->getType() == ge...
2010 May 06
2
[LLVMdev] Back-edge taken count of loops
...ining a "=", 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 re...
2011 Aug 04
3
[LLVMdev] Multiple one-line bugs in LLVM
...are identical sub-expressions to the left and to the right of the '&&'
operator: CurChar != '\n' && CurChar != '\n'. The second expression should
probably be CurChar != '\n'?
----
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:505
result |= (icmp_eq ? (FoldMskICmp_Mask_AllZeroes |
FoldMskICmp_Mask_AllZeroes |
FoldMskICmp_AMask_Mixed |
FoldMskICmp_BMask_Mixed)
: (FoldMskICmp_Mask_NotAllZeroes |
FoldMskICmp_Mask_NotAllZe...
2010 May 06
0
[LLVMdev] Back-edge taken count of loops
...id 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 re...
2010 Jun 28
2
[LLVMdev] help
%0 = icmp eq i32 %y, 0
In the above instruction how can i know that the comparison is equality
comparison??
--Rajwinder Singh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100628/8d8e5cb1/attachment.html>
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
...erand(1);
+
+ ConstantInt *Con;
+ if (!((Con = dyn_cast<ConstantInt>(LHS)) || (Con = dyn_cast<ConstantInt>(RHS))))
+ return 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 emit...
2011 Aug 04
0
[LLVMdev] Multiple one-line bugs in LLVM
...> operator: CurChar != '\n'&& CurChar != '\n'. The second expression should
> probably be CurChar != '\n'?
Chris also added this code, hopefully he will comment.
>
> ----
> lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:505
> result |= (icmp_eq ? (FoldMskICmp_Mask_AllZeroes |
> FoldMskICmp_Mask_AllZeroes |
> FoldMskICmp_AMask_Mixed |
> FoldMskICmp_BMask_Mixed)
> : (FoldMskICmp_Mask_NotAllZeroes |
>...
2011 Sep 28
3
[LLVMdev] ICmpInst example?
...en get a dump() on
it. Does anyone see what I am doing wrong?
BasicBlock *bb = i->getParent();
Instruction *j = bb->end();
BasicBlock *bb_after = i->getParent()->splitBasicBlock(&*i);
bb->getTerminator()->eraseFromParent();
ICmpInst *test = new ICmpInst(j, CmpInst::ICMP_EQ, shadow, val,
"Shadow check");
BasicBlock *trueBlock = BasicBlock::Create(M.getContext(), "Shadow
Check Block: TRUE", &F);
CallInst::Create(qv_true, "", trueBlock);
BranchInst::Create(bb_after, trueBlock);
BasicBlock *falseBlock = BasicBlock::Create(M...
2016 Jul 04
2
Path condition propagation
Sure
On Mon, Jul 4, 2016, 9:40 AM Carlos Liam <carlos at aarzee.me> wrote:
> It looks like there's already something similar in PropagateEquality which
> eg X >= Y == true and replaces X < Y == false, which is somewhat similar -
> could I base an addition off of that?
>
>
> - CL
>
> On Jul 3, 2016, at 7:13 PM, Daniel Berlin <dberlin at dberlin.org>
2013 Jul 05
2
[LLVMdev] Any suggestion for "Unknown instruction type encountered" error?
...terType>(Addr->getType());
llvm::Type * ElTy = PTy -> getElementType();
if (!ElTy->isPointerTy()) {
llvm::BasicBlock *OldBB = SI.getParent();
llvm::errs() << "yes, got it \n";
llvm::ICmpInst *Cmp = new llvm::ICmpInst(&SI,
llvm::CmpInst::ICMP_EQ, Addr,
llvm::Constant::getNullValue(Addr->getType()), "");
llvm::Instruction *Iter = &SI;
OldBB->getParent()->dump();
llvm::BasicBlock *NewBB = OldBB->splitBasicBlock(Iter, "newBlock");
OldBB->getParent()->dump();
}
}...
2013 Jul 05
0
[LLVMdev] Any suggestion for "Unknown instruction type encountered" error?
...;
> llvm::Type * ElTy = PTy -> getElementType();
> if (!ElTy->isPointerTy()) {
> llvm::BasicBlock *OldBB = SI.getParent();
> llvm::errs()<< "yes, got it \n";
> llvm::ICmpInst *Cmp = new llvm::ICmpInst(&SI, llvm::CmpInst::ICMP_EQ, Addr, llvm::Constant::getNullValue(Addr->getType()),"");
>
> llvm::Instruction *Iter =&SI;
> OldBB->getParent()->dump();
> llvm::BasicBlock *NewBB = OldBB->splitBasicBlock(Iter,"newBlock");
> OldBB->getParent()-&...