Displaying 20 results from an estimated 200 matches similar to: "[LLVMdev] m_Not Pattern Question"
2008 Nov 09
0
[LLVMdev] m_Not Pattern Question
Bill Wendling wrote:
> I have a question about the pattern matching stuff that's used in the
> Instruction Combiner. If I have code like this:
>
> if (match(B, m_Select(m_Value(), m_ConstantInt(0),
> m_ConstantInt(-1)))) {
> if (match(C, m_Not(m_Value(B))))
> return SelectInst::Create(cast<User>(B)->getOperand(0), D, A);
>
> and we
2005 Oct 05
1
[LLVMdev] Cast instructions
The following situation comes up a lot in what I'm doing. I want to
check if a value is a certain kind of instruction. The test also needs
to succeed if the value is a *cast* of the instruction (or a cast of a
cast, etc.) I.e., I need to "see through" any intervening casts to get
to the "real" value. It's trivial to write a function that does this,
but does
2017 Jul 13
2
failing to optimize boolean ops on cmps
We have several optimizations in InstCombine for bitwise logic ops
(and/or/xor) that fail to handle compare patterns with the equivalent
bitwise logic. Example:
define i8 @or_and_not(i8 %a, i8 %b) {
%nota = xor i8 %a, -1
%and = and i8 %nota, %b
%res = or i8 %and, %a
ret i8 %res
}
define i1 @or_and_cmp_not(i32 %a, i32 %b, i1 %c) {
%cmp = icmp sgt i32 %a, %b
%cmp_inv = icmp sle i32 %a,
2017 Mar 30
2
InstructionSimplify: adding a hook for shufflevector instructions
Thanks, Sanjay, that makes sense. The opportunity for improving instcombining splat sounds promising.
Another question about shuffle simplification. This is a testcase from test/Transforms/InstCombine/vec_shuffle.ll:
define <4 x i32> @test10(<4 x i32> %tmp5) nounwind {
%tmp6 = shufflevector <4 x i32> %tmp5, <4 x i32> undef, <4 x i32> <i32 1, i32 undef, i32
2010 Jan 05
0
[LLVMdev] [llvm-commits] [llvm] r92458 - in /llvm/trunk: lib/Target/README.txt lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/or.ll
Hi Bill-
For what it's worth, a simple truth table proves Chris correct.
Alastair
On 5 Jan 2010, at 02:46, Bill Wendling wrote:
> On Jan 3, 2010, at 10:04 PM, Chris Lattner wrote:
>
>> Author: lattner
>> Date: Mon Jan 4 00:03:59 2010
>> New Revision: 92458
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=92458&view=rev
>> Log:
>>
2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
Hi Roman,
Thanks for your good idea. I think it can solve the abs issue very well. I
can continue with my work now^-^.
But if it is not abs and there is no select,
%res = OP i32 %b, %a
%sub = sub i32 0, %b
%res2 = OP i32 %sub, %a
theoretically, we can still do the following transform for the above
pattern:
%res2 = OP i32 %sub, %a ==> %res2 = sub i32 0, %res
Not sure whether we can do it
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
2014 Aug 13
2
[LLVMdev] Efficient Pattern matching in Instruction Combine
Thanks Sean for the reference.
I will go through it and see if i can implement it for generic boolean
expression minimization.
Regards,
Suyog
On Wed, Aug 13, 2014 at 2:30 AM, Sean Silva <chisophugis at gmail.com> wrote:
> Re-adding the mailing list (remember to hit "reply all")
>
>
> On Tue, Aug 12, 2014 at 9:36 AM, suyog sarda <sardask01 at gmail.com> wrote:
2016 Jul 20
2
Hitting assertion failure related to vectorization + instcombine
Hi folks,
I'm hitting the below assertion failure when compiling this small piece of C code (repro.c, attached).
My command line is:
bin/clang --target=aarch64-linux-gnu -c -O2 repro.c
clang is built from top of trunk as of this morning. It only happens at -O2, and it doesn't happen with the default target (x86_64). I tried to reproduce using just 'llc -O2' but didn't
2016 Jul 20
2
Hitting assertion failure related to vectorization + instcombine
Thanks for notifying me. Yes, this was a recent change. Taking a look now.
On Wed, Jul 20, 2016 at 1:49 PM, Michael Kuperstein <mkuper at google.com>
wrote:
> +Sanjay, who touched this last. :-)
>
> On Wed, Jul 20, 2016 at 12:44 PM, Ismail Badawi (ibadawi) via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Hi folks,
>>
>> I'm hitting the
2017 Mar 30
2
InstructionSimplify: adding a hook for shufflevector instructions
As Sanjay noted in D31426<https://reviews.llvm.org/D31426#712701>, InstructionSimplify is missing the following simplification:
This function:
define <4 x i32> @splat_operand(<4 x i32> %x) {
%splat = shufflevector <4 x i32> %x, <4 x i32> undef, <4 x i32> zeroinitializer
%shuf = shufflevector <4 x i32> %splat, <4 x i32> undef, <4 x i32>
2016 Jul 22
2
Hitting assertion failure related to vectorization + instcombine
Sanjay: let me know if this is something that will apply to 3.9.
Thanks,
Hans
On Wed, Jul 20, 2016 at 5:59 PM, Sanjay Patel via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Quick update - the bug existed before I refactored that chunk in
> InstSimplify with:
> https://reviews.llvm.org/rL275911
>
> In fact, as discussed in https://reviews.llvm.org/D22537 - because we have a
2016 Jul 25
2
Hitting assertion failure related to vectorization + instcombine
Sure. David, what do you think about merging this to 3.9?
Sanjay: are you saying I'd just apply that diff to
InstructionSimplify.cpp, not InstCombineSelect.cpp?
On Fri, Jul 22, 2016 at 7:08 AM, Sanjay Patel <spatel at rotateright.com> wrote:
> Hi Hans -
>
> Yes, I think this is a good patch for 3.9 (cc'ing David Majnemer as code
> owner). The functional change was
2015 Apr 06
2
[LLVMdev] inconsistent wording in the LangRef regarding "shl nsw"
The LangRef says this for left shifts:
"If the nsw keyword is present, then the shift produces a poison value
if it shifts out any bits that disagree with the resultant sign bit."
... (1)
followed by
"As such, NUW/NSW have the same semantics as they would if the shift
were expressed as a mul instruction with the same nsw/nuw bits in (mul
%op1, (shl 1, %op2))." ... (2)
But
2016 Jul 27
0
Hitting assertion failure related to vectorization + instcombine
David, Sanjay: ping?
On Mon, Jul 25, 2016 at 11:07 AM, Hans Wennborg <hans at chromium.org> wrote:
> Sure. David, what do you think about merging this to 3.9?
>
> Sanjay: are you saying I'd just apply that diff to
> InstructionSimplify.cpp, not InstCombineSelect.cpp?
>
> On Fri, Jul 22, 2016 at 7:08 AM, Sanjay Patel <spatel at rotateright.com> wrote:
>> Hi
2016 Jul 28
1
Hitting assertion failure related to vectorization + instcombine
LGTM
On Wednesday, July 27, 2016, Hans Wennborg <hans at chromium.org> wrote:
> David, Sanjay: ping?
>
> On Mon, Jul 25, 2016 at 11:07 AM, Hans Wennborg <hans at chromium.org
> <javascript:;>> wrote:
> > Sure. David, what do you think about merging this to 3.9?
> >
> > Sanjay: are you saying I'd just apply that diff to
> >
2008 Jul 21
2
sftp needs a long time for sending a filelist
Hello all
Im using sftp 1:4.7p1-8ubuntu1.2
in a batchjob
Ive noticed that sftp needs a long time for sending a filelist.
The timespan increases exponential if many files are on the
remoteserver.
for example "ls -la *.txt" needs 10 seconds for 2000 files
but needs 50 seconds for 4000 files.
For 150.000 Files i have to wait 15 minutes for example
but the
2017 Jul 13
2
failing to optimize boolean ops on cmps
This can't be an instsimplify though? The values we want in these cases do
not exist already:
%res = or i8 %b, %a
%res = or i1 %cmp, %c
On Thu, Jul 13, 2017 at 5:10 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
>
>
> On Thu, Jul 13, 2017 at 2:12 PM, Sanjay Patel <spatel at rotateright.com>
> wrote:
>
>> We have several optimizations in InstCombine
2008 May 17
0
[LLVMdev] More info, was Help needed after hiatus
On Sat, May 17, 2008 at 11:34 AM, Richard Pennington <rich at pennware.com> wrote:
> If I run the optimizer (opt) on this code snippet with -std-compile-opts
> the optimizer hangs.
>
>
> ; ModuleID = 'test.ubc'
> target datalayout =
>
2008 May 17
2
[LLVMdev] More info, was Help needed after hiatus
Hi,
I know my last question was very vague (i.e. "It stopped working, what
went wrong?"), so here is a little more concrete example:
If I run the optimizer (opt) on this code snippet with -std-compile-opts
the optimizer hangs.
; ModuleID = 'test.ubc'
target datalayout =