Displaying 20 results from an estimated 200 matches similar to: "[LLVMdev] SCEV expression for ICmpInst"
2010 Apr 17
1
[LLVMdev] SCEV expression for ICmpInst
Be careful about oversimplifying signed integer comparisons -- integer arithmetic can easily overflow, so you cannot transform A > B to A - B > 0. The compare instructions in most processors do not simply subtract and test the most significant bit; they compute what the sign of the difference would be in extended precision.
On Apr 17, 2010, at 1:00 PM, llvmdev-request at cs.uiuc.edu wrote:
2017 Dec 14
2
[RFC] Add TargetTransformInfo::isAllocaPtrValueNonZero and let ValueTracking depend on TargetTransformInfo
Some optimizations depend on whether alloca instruction always has non-zero value. Currently, this checking is done by isKnownNonZero() in ValueTracking, and it assumes alloca in address space 0 always has non-zero value but alloca in non-zero address spaces does not always have non-zero value.
However, this assumption is incorrect for certain targets. For example, amdgcn---amdgiz target has
2006 Mar 14
8
The RoR equivalent of out.write() in JSP?
All,
In JSP, I can output strings in the Web page by either
<%= foo %> //foo is a string or returns a string
or
<% out.write("test") %> //write directly to the output stream.
What is the method of "writing to the output stream" in RoR? Basically,
what is the equivalent of out.write()?
I have an if then statement that I want to put around a call to
h
2017 Dec 14
3
[RFC] Add TargetTransformInfo::isAllocaPtrValueNonZero and let ValueTracking depend on TargetTransformInfo
Hal,
Thanks for your suggestion. I think that makes sense.
Currently, non-zero alloca address space is already represented by data layout, e.g., the last component of the data layout of amdgcn---amdgiz target is -A5, which means alloca is in address space 5. How about adding a letter z to -A5 to indicate alloca may have zero value? i.e. -A5 means alloca is in address space 5 and always has
2013 Jan 10
1
[LLVMdev] LLVM Instruction to ICmpInst conversion
Hello !
I want some piece of advice regarding a LLVM pass. My particular problem is:
There is a method
bool patternDC::runOnFunction(Function &F) {
...
if ( CC->operEquiv(icmpInstrArray[i], icmpInstrArray[j]) ) {...}
...
}
having the array elements of type Instruction* :
http://llvm.org/doxygen/classllvm_1_1Instruction.html
The called method is
bool
2011 Oct 12
2
[LLVMdev] insert ICmpInst/BranchIns in Pass?
In a pass I would like to insert a ICmpInst/BranchInst pair to check
if 2 GlobalVariables are equal or not. If they are not I would like to
call a function. I've tried splitting the current block and then
inserting before the existing instructions, but for some reason this
seems to ruin the iterator(i). What is the correct way todo something
like this?
void checkShadowPtr(Module &M,
2011 Sep 28
0
[LLVMdev] ICmpInst example?
On Tue, Sep 27, 2011 at 7:28 PM, ret val <retval386 at gmail.com> wrote:
> I'm trying to come up with a simple example of using ICmpInst in a
> Pass. On each of the branches(true, false) I'd like to call a separate
> function and then resume(to the code that was already there).
>
> In this example i is a inst_iterator to Instruction the Pass is
> currently on. Now
2011 Sep 28
3
[LLVMdev] ICmpInst example?
I'm trying to come up with a simple example of using ICmpInst in a
Pass. On each of the branches(true, false) I'd like to call a separate
function and then resume(to the code that was already there).
In this example i is a inst_iterator to Instruction the Pass is
currently on. Now it segfaults opt before I can even get a dump() on
it. Does anyone see what I am doing wrong?
BasicBlock
2011 Oct 12
0
[LLVMdev] insert ICmpInst/BranchIns in Pass?
On Tue, Oct 11, 2011 at 7:22 PM, ret val <retval386 at gmail.com> wrote:
> In a pass I would like to insert a ICmpInst/BranchInst pair to check
> if 2 GlobalVariables are equal or not. If they are not I would like to
> call a function. I've tried splitting the current block and then
> inserting before the existing instructions, but for some reason this
> seems to ruin the
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
This addition converts strlen() calls to strnlen() when the result is
compared to a constant. For example, the following:
strlen(s) < 5
Becomes:
strnlen(s, 5) < 5
That way, we don't have to walk through the entire string. There is the
added overhead of maintaining a counter when using strnlen(), but I
thought I'd start with the general case. It may make sense to only use
this
2016 Jul 21
2
Remove zext-unfolding from InstCombine
Hi all,
I have a question regarding a transformation that is carried out in InstCombine, which has been introduced by r48715. It unfolds expressions of the form `zext(or(icmp, (icmp)))` to `or(zext(icmp), zext(icmp)))` to expose pairs of `zext(icmp)`. In a subsequent iteration these `zext(icmp)` pairs could then (possibly) be optimized by another optimization (which has already been there before
2012 Apr 09
0
[LLVMdev] new methods for ScalarEvolutions
Working on a dependence test, I wrote some code that looked like this:
const SCEV *delta = ...;
bool deltaMaybeZero = !SE->isKnownNonZero(delta);
bool deltaMaybePositive = !SE->isKnownNonPositive(delta);
bool deltaMaybeNegative = !SE->isKnownNonNegative(delta);
I'm really happy with the power of the SCEVs, letting me answer these
questions, but I'm unhappy with how
2010 Jul 27
1
[LLVMdev] How to use the return value of a CallInst
Hi all:
I am trying to compare the return 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)
2013 Jan 15
2
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 01:59:55PM -0800, Dan Gohman wrote:
> The bug here isn't in clang's use of noalias or in BasicAliasAnalysis'
> implementation of noalias; it's in the code that's optimizing the
> icmp.
Let's come back to this. The attached patch decouples InstSimplify from
the alias analysis and provides the conservative logic for when pointers
are not
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
2015 Aug 06
2
[LLVMdev] Ideas for making llvm-config --cxxflags more useful
[Ooops, sent to the old list address by mistake]
On 30 Jul 2015, at 21:04, tom at stellard.net wrote:
>
> For flags like -fno-rtti (are there others?) that are required in some cases
> (I think -fno-rtti is required only if you sub-class LLVM objects), I would propose
> adding a separate flag like --uses-rtti. This would give users more fine-grained
> control over which flags
2016 Jul 27
2
Remove zext-unfolding from InstCombine
Hi Sanjay,
thank you a lot for your answer. I understand that in your examples it is desirable that `foo` and `goo` are canonicalized to the same IR, i.e., something like `@goo`. However, I still have a few open questions, but please correct me in case I'm thinking in the wrong direction.
> Am 21.07.2016 um 18:51 schrieb Sanjay Patel <spatel at rotateright.com>:
>
> I've
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 Jul 03
2
[LLVMdev] [Polly] Assert in Scope construction
Should have changed the subject line...
---
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
The Linux Foundation
> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Sergei Larin
> Sent: Wednesday, July 03, 2013 12:29 PM
> To: 'Tobias Grosser'
> Cc: 'llvmdev'
2015 Aug 07
2
[LLVMdev] Ideas for making llvm-config --cxxflags more useful
On Fri, Aug 7, 2015 at 10:22 AM, Hans Wennborg via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> On Thu, Aug 6, 2015 at 12:04 PM, David Chisnall via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > [Ooops, sent to the old list address by mistake]
> >
> > On 30 Jul 2015, at 21:04, tom at stellard.net wrote:
> >>
> >> For flags like