Displaying 20 results from an estimated 500 matches similar to: "How to add optimizations to InstCombine correctly?"
2017 Sep 13
3
How to add optimizations to InstCombine correctly?
There is in fact a transform out there somewhere that reverses yours.
define i64 @foo(i64 %a) {
%b = shl i64 %a, 5
%c = add i64 %b, %a
ret i64 %c
}
becomes
define i64 @foo(i64 %a) {
%c = mul i64 %a, 33
ret i64 %c
}
~Craig
On Wed, Sep 13, 2017 at 10:11 AM, Craig Topper <craig.topper at gmail.com>
wrote:
> Your code seems fine. InstCombine can infinite loop if some other
2017 Sep 14
3
How to add optimizations to InstCombine correctly?
Hi Craig,
thanks for digging into this. So InstCombine is the wrong place for
fixing PR34474. Can you give me a hint where such an optimization should
go into CodeGen? I am not really familiar with stuff that happens after
the MidLevel.
Cheers,
Michael
Am 13.09.2017 um 19:21 schrieb Craig Topper:
> And that is less instructions. So from InstCombine's perspective the
> multiply is
2017 Sep 16
2
How to add optimizations to InstCombine correctly?
This conversation has (partially) moved on to D37896 now, but if possible I was hoping that we could perform this in DAGCombiner and remove the various target specific combines that we still have.
At least ARM/AARCH64 and X86 have cases that can hopefully be generalised and removed, but there will probably be a few legality/perf issues that will occur.
Simon.
> On 14 Sep 2017, at 06:23,
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
I am currently improving the D37896 to include the suggestions from
Chad. However, running the lit checks for the x86 backend I observe some
changes in the generated MC, e.g.:
llvm/test/CodeGen/X86/lea-3.ll:13:10: error: expected string not found
in input
; CHECK: leal ([[A0]],[[A0]],2), %eax
^
<stdin>:10:2: note: scanning from here
orq %rdi, %rax
^
<stdin>:10:2:
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
Hi Sanjay,
thanks for enlighten me on terms of tests. I assume I have to run the test-suite benchmarks to check for regressions? Is there a guide to get the metrics from the benchmarks?
Cheers,
Michael
BTW the beginner tag for bugs was really a good idea to get started with contributing to llvm.
On Tue, Sep 19, 2017 at 3:58 PM +0200, "Sanjay Patel" <spatel at
2017 Sep 19
5
How to add optimizations to InstCombine correctly?
For the tests that are changing, you should see if those changes are
improvements, regressions, or neutral. This is unfortunately not always
obvious for x86 asm, so feel free to just post those diffs in an updated
version of the patch at D37896.
If the test files have auto-generated assertions (look for this string on
the first line of the test file: "NOTE: Assertions have been autogenerated
2019 Oct 05
4
should base R have a piping operator ?
Hi John,
Thanks, but the Bizzaro pipe comes with many flaws though :
* It's not a single operator
* It has a different precedence
* It cannot be used in a subcall
* The variable assigned to must be on the right
* It doesn't trigger indentation when going to the line
* It creates/overwrite a `.` variable in the worksace.
And it doesn't deal gracefully with some lazy evaluation edge
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
2013 Apr 24
5
[LLVMdev] Optimize away sqrt in simple cases?
> This is not true. The mathematically correct result for sqrt might not be a representable value in floating point, so rounding may occur between the two steps. In that case, pow2(sqrt(x)) != x.
>
> --Owen
I think what Christoph is saying is that x will always be at least as
accurate as pow2(sqrt(x)), so it's only unsafe in so far as one's code
is actually depending on an
2019 Oct 05
0
should base R have a piping operator ?
Hello,
R is a functional language, pipes are not. There are even higher order
functions such as [1] and [2].
Besides, packages are part of R, R couldn't live without them. I find
pipes a good idea but I also find it better not to have them as part of
base R. If you want to use them, load a package, if you don't, don't.
This simple.
As for your example, compose, there is a
2012 Apr 19
2
[LLVMdev] Tablegen to match a literal in an instruction
I am trying to make some modifications to our code generator that will produce better code, but require adding new patterns.
What I am trying to do is take a register/register pattern and change it to a register/immediate.
So for example, I have this pattern:
class ILFormat<ILOpCode op, dag outs, dag ins, string asmstr, list<dag> pattern>
: Instruction {
let Namespace =
2012 Apr 19
3
[LLVMdev] Tablegen to match a literal in an instruction
I'm not at the machine that has the changes, but it was failing at index 0.
Micah
From: Owen Anderson [mailto:resistor at mac.com]
Sent: Thursday, April 19, 2012 3:35 PM
To: Villmow, Micah
Cc: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Tablegen to match a literal in an instruction
Micah,
I don't see anything wrong with this offhand. Have you tried getting the debug output
2013 Apr 24
0
[LLVMdev] Optimize away sqrt in simple cases?
On Apr 23, 2013, at 7:15 PM, Stephen Lin <swlin at post.harvard.edu> wrote:
>> This is not true. The mathematically correct result for sqrt might not be a representable value in floating point, so rounding may occur between the two steps. In that case, pow2(sqrt(x)) != x.
>
> I think what Christoph is saying is that x will always be at least as
> accurate as pow2(sqrt(x)),
2012 Apr 19
0
[LLVMdev] Tablegen to match a literal in an instruction
Micah,
I don't see anything wrong with this offhand. Have you tried getting the debug output from llc -debug, and matching it up with the state machine in your DAGISel.inc to see at what step the auto-generated matcher is failing to match your and-with-immediate?
-Owen
On Apr 19, 2012, at 3:07 PM, "Villmow, Micah" <Micah.Villmow at amd.com> wrote:
> I am trying to make
2015 Aug 20
2
[RFC] Improving integer divide optimization (related to D12082)
> On Aug 19, 2015, at 3:48 PM, escha via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
>
>> On Aug 19, 2015, at 1:45 PM, Steve King via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>>
>> In the targets I know, shifts are
>> cheaper than divides in both speed and size.
>
> From what I remember, udiv by
2014 Oct 16
2
Re: CF Card wear optimalisation for ext4
* Andreas Dilger <adilger@dilger.ca> hat geschrieben:
> The "lifetime writes" value has not been around forever, so if the
> filesystem was originally created and populated on an older kernel
> (e.g. using ext3) it would not contain a record of those writes.
It was created as stable ext4 in the first place. So only if there was a
stable ext4 release which didn't
2002 Mar 13
2
MASS Library
Hi,
I was just trying out an example on Page 247 of the MASS (Modern Applied
Statistics with S-plus) book and saw the function "negexp.ival".
It says it is supplied in the MASS library, however when I load the
library in R and typed:
negexp.ival
it says:
Error: Object "negexp.ival" not found
Does it mean it only appears in the MASS library for S-plus?
2012 Apr 19
0
[LLVMdev] Tablegen to match a literal in an instruction
Right, it's failing when it tries to materialize a move of a constant into a register. But it's only trying to do that because it previously failed to fold the constant into the AND. What you need to do is step through the path it takes when matching the AND node, and try to figure out why it ends up selecting the register-register version rather than the register-immediate version.
2015 Aug 19
3
[RFC] Improving integer divide optimization (related to D12082)
Hello LLVM, A recent commit creates the isIntDivCheap() target query.
http://reviews.llvm.org/D12082
The current approach has a couple shortcomings.
First, when targets decide divide is cheap, the DAGCombiner ignores
obvious power-of-2 optimizations. In the targets I know, shifts are
cheaper than divides in both speed and size. The target cannot see
the value in the isIntDivCheap() call, so
2015 Aug 20
3
[RFC] Improving integer divide optimization (related to D12082)
> On Aug 20, 2015, at 9:46 AM, Steve King <steve at metrokings.com> wrote:
>
> On Wed, Aug 19, 2015 at 10:58 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:
>>
>> Isn’t the problem the fact that the patch makes it harder for a target to
>> get the generic code to reach its custom hook?
>> Now the "cheap pow2 sdiv” is merged with the generic