Displaying 20 results from an estimated 600 matches similar to: "Remove zext-unfolding from InstCombine"
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
2016 Aug 04
2
Remove zext-unfolding from InstCombine
Hi Sanjay,
> Am 02.08.2016 um 21:39 schrieb Sanjay Patel <spatel at rotateright.com>:
>
> Hi Matthias -
>
> Sorry for the delayed reply. I think you're on the right path with D22864.
No problem, thank you for your answer!
> If I'm understanding it correctly, my foo() example and zext_or_icmp_icmp() will be equivalent after your patch is added to InstCombine.
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
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
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)
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
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
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
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'
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:
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,
2010 Apr 17
2
[LLVMdev] SCEV expression for ICmpInst
Hi,
i am playing the ScalarEvolution these days. i found the the ScalarEvolution
will simply return a SCEVUnknow for a ICmpInst, so i think maybe great to
add a new kind of SCEV to the ScalarEvolution framework.
for example, if i run ScalarEvolution on the bc file generate from the
following C source file:
int f(int a, int b, int c, int d) {
return (2 * a + 5 * c + 2) > (4 * d - 3*b
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
2013 Jul 05
0
[LLVMdev] [Polly] Assert in Scope construction
Hi Sergei,
On Thu, Jul 4, 2013 at 1:36 AM, Sergei Larin <slarin at codeaurora.org> wrote:
> 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
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
2015 Aug 07
3
[LLVMdev] Ideas for making llvm-config --cxxflags more useful
I’ve almost finished a patch to add back in either out of line destructors or anchor methods. We seem to use one or the one, relatively inconsistently.
What i’ve gone for is that if a class already had an inline destructor then i left it alone and added an anchor method. Otherwise I added an out of line destructor.
Now if I compile Instructions.cpp with -Wweak-vtable, the only warnings given
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
2013 Oct 31
2
[LLVMdev] The order of GVN and IndVarSimplify
This might be hard cases making bad law, but the loop:
void
f (unsigned short *x, int *l)
{
int c = *l;
int i;
for (i = 0; i < c; i++)
if (x[i])
x[i]++;
}
is converted to decrement-and-branch form by LoopStrengthReduce while:
void
f (unsigned short *x, int *l)
{
int i;
for (i = 0; i < *l; i++)
if (x[i])
x[i]++;
}
isn't.
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
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