[llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
Compile the following functions with "-O3 -target amd64"
(see <https://godbolt.org/z/5xqYhH>):

__int128 div(__int128 foo, __int128 bar)
{
    return foo / bar;
}

On the left the generated code; on the right the expected,
properly optimised code:

div: # @div
    push  rbp         |
    mov   rbp, rsp    |
    call  __divti3    |    jmp   __divti3
    pop   rbp         |
    ret               |


__int128 mod(__int128 foo, __int128 bar)
{
    return foo % bar;
}

mod: # @mod
    push  rbp         |
    mov   rbp, rsp    |
    call  __modti3    |    jmp   __modti3
    pop   rbp         |
    ret               |


__int128 mul(__int128 foo, __int128 bar)
{
    return foo * bar;
}

mul: # @mul
    push  rbp
    mov   rbp, rsp
    mov   r8, rdx
    mov   rax, rdx
    mul   rdi
    imul  rsi, r8
    add   rdx, rsi
    imul  rcx, rdi
    add   rdx, rcx
    pop   rbp
    ret

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
Hi,

On Sat, 1 Dec 2018 at 17:37, Stefan Kanthak via llvm-dev
<[hidden email]> wrote:
> Compile the following functions with "-O3 -target amd64"

You've been advised before, but you really need to start reporting
these as bugs[*] if you actually care about them. llvm-dev is
basically a black-hole as far as bugs go: if no-one takes enough of an
interest to either fix or file a bug within a day or two, the issue
will be completely forgotten. The list is intended for discussion of
issues and future designs, not reporting them.

It seems you got lucky and someone did file at least one report from
one of these threads; you should expect that to become less frequent.
People are willing to assume the best of new contributors, but by the
time you reach a dozen threads without actually engaging with the
community's procedures that goodwill starts to look a bit threadbare.

Cheers.

Tim.

[*] https://llvm.org/docs/Contributing.html
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
"Tim Northover" <[hidden email]> wrote:

> Hi,
>
> On Sat, 1 Dec 2018 at 17:37, Stefan Kanthak via llvm-dev
> <[hidden email]> wrote:
>> Compile the following functions with "-O3 -target amd64"
>
> You've been advised before, but you really need to start reporting
> these as bugs[*] if you actually care about them.

These ain't my bugs, these are LLVM's bugs.
I don't use LLVM, I just dared to write some posts which pinpoint
deficiencies and bugs in it. You should see this as COURTESY.
The least I expect from any software developer, and especially a
"foundation", is to take action on bug reports, INDEPENDENT how they
are reported.

> llvm-dev is
> basically a black-hole as far as bugs go: if no-one takes enough of an
> interest to either fix or file a bug within a day or two, the issue
> will be completely forgotten. The list is intended for discussion of
> issues and future designs, not reporting them.

That's clearly LLVM's problem.

> It seems you got lucky and someone did file at least one report from
> one of these threads;

You got that backwards: YOU are lucky that I took the time to report
these bugs!

> you should expect that to become less frequent.
> People are willing to assume the best of new contributors, but by the
> time you reach a dozen threads without actually engaging with the
> community's procedures that goodwill starts to look a bit threadbare.
>
> Cheers.
>
> Tim.
>
> [*] https://llvm.org/docs/Contributing.html

| If you are working with LLVM and run into a bug, we definitely want
| to know about it.

I DONT WORK WITH LLVM.
I was just curious whether it shows bugs and deficiencies I saw in
two other C compilers, and documented them.
You and your users suffer from these bugs and deficiencies, not me.

regards
Stefan
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
Hi Stefan,

On Dec 3, 2018, at 06:10, Stefan Kanthak via llvm-dev <[hidden email]> wrote:

"Tim Northover" <[hidden email]> wrote:

Hi,

On Sat, 1 Dec 2018 at 17:37, Stefan Kanthak via llvm-dev
<[hidden email]> wrote:
Compile the following functions with "-O3 -target amd64"

You've been advised before, but you really need to start reporting
these as bugs[*] if you actually care about them.

These ain't my bugs, these are LLVM's bugs.

FWIW, I think you're misunderstanding Tim's intent there. He's not saying they're your bugs, he's just saying they need to be reported in the correct place.

I don't use LLVM, I just dared to write some posts which pinpoint
deficiencies and bugs in it. You should see this as COURTESY.
The least I expect from any software developer, and especially a
"foundation", is to take action on bug reports, INDEPENDENT how they
are reported.

llvm-dev is
basically a black-hole as far as bugs go: if no-one takes enough of an
interest to either fix or file a bug within a day or two, the issue
will be completely forgotten. The list is intended for discussion of
issues and future designs, not reporting them.

That's clearly LLVM's problem.

It seems you got lucky and someone did file at least one report from
one of these threads;

You got that backwards: YOU are lucky that I took the time to report
these bugs!

you should expect that to become less frequent.
People are willing to assume the best of new contributors, but by the
time you reach a dozen threads without actually engaging with the
community's procedures that goodwill starts to look a bit threadbare.

Cheers.

Tim.

[*] https://llvm.org/docs/Contributing.html

| If you are working with LLVM and run into a bug, we definitely want
| to know about it.

The sentence following that one provides instructions on how to report bugs:
Please let us know and follow the instructions in How to submit an LLVM bug report to create a bug report.

Those instructions say:
Once you have a reduced test-case, go to the LLVM Bug Tracking System and fill out the form with the necessary details (note that you don’t need to pick a category, just use the “new-bugs” category if you’re not sure).
You already seem to have reduced test cases (Thanks) so they just need to be reported to the bug tracker.

Unfortunately, it's a bit harder to create an account with the bug tracker than it ought to be as there's been trouble with spam. [hidden email] can set you up with an account.

I DONT WORK WITH LLVM.
I was just curious whether it shows bugs and deficiencies I saw in
two other C compilers, and documented them.
You and your users suffer from these bugs and deficiencies, not me.

regards
Stefan
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev

On Dec 4, 2018, at 15:11, Stefan Kanthak <[hidden email]> wrote:

"Daniel Sanders" <[hidden email]> wrote:

Hi Stefan,

On Dec 3, 2018, at 06:10, Stefan Kanthak via llvm-dev <[hidden email]> wrote:

"Tim Northover" <[hidden email]> wrote:

Hi,

On Sat, 1 Dec 2018 at 17:37, Stefan Kanthak via llvm-dev
<[hidden email]> wrote:
Compile the following functions with "-O3 -target amd64"

You've been advised before, but you really need to start reporting
these as bugs[*] if you actually care about them.

These ain't my bugs, these are LLVM's bugs.

FWIW, I think you're misunderstanding Tim's intent there.

No, I understand his intent. I just doesn't align with my intent,
including the hoops he/LLVM wants me to jump through.

He's not saying they're your bugs, he's just saying they need
to be reported in the correct place.

Go ahead, report them there!

I'm afraid I don't have the time to do that. I have my own work to attend to.

[...]

[*] https://llvm.org/docs/Contributing.html

| If you are working with LLVM and run into a bug, we definitely want
| to know about it.

The sentence following that one provides instructions on how
to report bugs:

What follows does CLEARLY not apply here and for me: I don't work
with LLVM, I don't use it!

It applies to everyone who wishes to report bugs.

[...]

You already seem to have reduced test cases (Thanks) so they just
need to be reported to the bug tracker.

Go ahead, report them there!

regards
Stefan


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
On Tue, Dec 4, 2018 at 3:58 PM Daniel Sanders via llvm-dev <[hidden email]> wrote:
On Dec 4, 2018, at 15:11, Stefan Kanthak <[hidden email]> wrote:
No, I understand his intent. I just doesn't align with my intent,
including the hoops he/LLVM wants me to jump through.

He's not saying they're your bugs, he's just saying they need
to be reported in the correct place.

Go ahead, report them there!

I'm afraid I don't have the time to do that. I have my own work to attend to.

How uncharitable of you. Mr Kanthak's time is more valuable than anyone else's. 


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
Fwiw, getting a bugzilla account is pretty annoying and is a definite hurdle in getting people to file bug reports.

Even though I don’t work on the optimizer, I would probably file all of these bugs on behalf of Stefan just because that’s the kind of guy i am, but then I remember the antagonistic and condescending tone of all the emails and change my mind.
On Tue, Dec 4, 2018 at 5:16 PM Bruce Hoult via llvm-dev <[hidden email]> wrote:
On Tue, Dec 4, 2018 at 3:58 PM Daniel Sanders via llvm-dev <[hidden email]> wrote:
On Dec 4, 2018, at 15:11, Stefan Kanthak <[hidden email]> wrote:
No, I understand his intent. I just doesn't align with my intent,
including the hoops he/LLVM wants me to jump through.

He's not saying they're your bugs, he's just saying they need
to be reported in the correct place.

Go ahead, report them there!

I'm afraid I don't have the time to do that. I have my own work to attend to.

How uncharitable of you. Mr Kanthak's time is more valuable than anyone else's. 

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
In reply to this post by Alberto Barbaro via llvm-dev


These ain't my bugs, these are LLVM's bugs.
I don't use LLVM, I just dared to write some posts which pinpoint
deficiencies and bugs in it. You should see this as COURTESY.
The least I expect from any software developer, and especially a
"foundation", is to take action on bug reports, INDEPENDENT how they
are reported.

I happen to agree with you here, but please understand that it goes both ways.  The least I expect from any software developer is to communicate in a professional manner.  Once that starts happening, you may start seeing some action taken on these bugs (such as me filing all these bug reports for yoy)


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
In reply to this post by Alberto Barbaro via llvm-dev

On Dec 4, 2018, at 17:32, Zachary Turner <[hidden email]> wrote:

Fwiw, getting a bugzilla account is pretty annoying and is a definite hurdle in getting people to file bug reports.

I completely agree. If bugzilla can't hold back the bot-generated spam without also being a barrier to occasional reporters then we ought to be looking at alternatives. Hopefully, that will be the next priority after the repository migration.

While we're on the subject: It would be neat if godbolt.org could submit bugs directly to our bug tracker. Especially, if that process could run bugpoint too. That way, occasional reporters wouldn't need an account at all.

Even though I don’t work on the optimizer, I would probably file all of these bugs on behalf of Stefan just because that’s the kind of guy i am, but then I remember the antagonistic and condescending tone of all the emails and change my mind.
On Tue, Dec 4, 2018 at 5:16 PM Bruce Hoult via llvm-dev <[hidden email]> wrote:
On Tue, Dec 4, 2018 at 3:58 PM Daniel Sanders via llvm-dev <[hidden email]> wrote:
On Dec 4, 2018, at 15:11, Stefan Kanthak <[hidden email]> wrote:
No, I understand his intent. I just doesn't align with my intent,
including the hoops he/LLVM wants me to jump through.

He's not saying they're your bugs, he's just saying they need
to be reported in the correct place.

Go ahead, report them there!

I'm afraid I don't have the time to do that. I have my own work to attend to.

How uncharitable of you. Mr Kanthak's time is more valuable than anyone else's. 

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
In reply to this post by Alberto Barbaro via llvm-dev
"Bruce Hoult" <[hidden email]> wrote:

> On Tue, Dec 4, 2018 at 3:58 PM Daniel Sanders via llvm-dev <
> [hidden email]> wrote:
>
>> On Dec 4, 2018, at 15:11, Stefan Kanthak <[hidden email]> wrote:
>> No, I understand his intent. I just doesn't align with my intent,
>> including the hoops he/LLVM wants me to jump through.
>>
>> He's not saying they're your bugs, he's just saying they need
>> to be reported in the correct place.
>>
>>
>> Go ahead, report them there!
>>
>>
>> I'm afraid I don't have the time to do that. I have my own work to attend
>> to.
>>
>
> How uncharitable of you.

I second that!

> Mr Kanthak's time is more valuable than anyone else's.

Nice argument.
Did you come up with this brilliant idea completely on your own?

May I but add another, completely bizarre argument to the discussion:
besides Daniel and me, and even you who wastes his surely precious time
with so very constructive comments, there may be one, two or even three
OTHER people, let's call them "users" of LLVM instead of victims, whose
DEFINITIVELY more valuable time (be it real or CPU) is wasted waiting
for their programs to complete due to the unoptimised code produced by
LLVM, or due to the unoptimised routines shipped with compiler-rt, or
even both, while the web site <https://compiler-rt.llvm.org/> blatantly
lies them in their face stating

| The builtins library provides optimized implementations of this and
| other low-level routines, either in target-independent C form, or as
| a heavily-optimized assembly.

which some of these implementations are clearly NOT!
Now accumulate this time over your user base; don't forget to include
the end users, whose time and resources are wasted running not properly
optimised code generated by or shipped with LLVM.

Speaking of waste: I recommend to dump the executable Windows installer.
It fails here, on properly secured Windows installations, miserably.
And if it would NOT fail, it allows escalation of privilege (CWE-377,
CWE-379, CAPEC-29).

Besides that, I consider dumping several identical files clang*.exe or
*lld*.exe with 40MB size instead of creating hardlinks another waste of
your users resources.

stay tuned
Stefan Kanthak
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Where's the optimiser gone? (part 5.a): missed tail calls, and more...

Alberto Barbaro via llvm-dev
On Dec 5, 2018, at 3:01 AM, Stefan Kanthak via llvm-dev <[hidden email]> wrote:
> May I but add another, completely bizarre argument to the discussion:
> besides Daniel and me, and even you who wastes his surely precious time
> with so very constructive comments, there may be one, two or even three
> OTHER people, let's call them "users" of LLVM instead of victims, whose
> DEFINITIVELY more valuable time (be it real or CPU) is wasted waiting
> for their programs to complete due to the unoptimised code produced by
> LLVM, or due to the unoptimised routines shipped with compiler-rt, or
> even both, while the web site <https://compiler-rt.llvm.org/> blatantly
> lies them in their face stating

Hi Stefan,

I personally appreciate the fact that you are prodding and probing LLVM, finding deficiencies, and I think it is great that you are willing to contribute your insights to the community.  I would personally also really appreciate it if you would take guidance from the community and log bugs (it isn’t that hard!) so we can properly track this.  Not doing so is becoming borderline spam on this mailing list given the volume of posts.  I think your work here is very valuable and so I’d really like to capture it to allow it to make a lasting impact on LLVM.

That said, regardless of what your decision on that is (I can understand if it isn’t worth your time), your tone above is not productive or constructive, and the LLVM community expects cordial communication with a baseline of a respectful tone.  I request that you be considerate of the fact that you are speaking on a public LLVM community list, and therefore are expected to remain in line with the community expectations.

Thanks.  Please feel free to contact me offline if you have questions or concerns,

-Chris

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev