Announcement

Collapse
No announcement yet.

LLVM Clang 14 Lands An "Amazing" Performance Optimization

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    I must be missing some language rule, since unless the variable (or the ptr) is volatile or atomic, I thought that a C or C++ compiler usually might move the store-to-memory out of the loop as well. (In the example given in the Twitter post.)

    EDIT: And I'd think that on the other hand, if either var or ptr are volatile or atomic, the load can't be moved out of the loop either.

    For easier reference, this is the example given:

    Code:
    loop {
        var = *ptr;
        if (var) break;
        *ptr= var + 1;
    }

    EDIT 2: Taking the example literally, I'd think an optmizing compiler might unroll the loop, discover it will terminate in the second iteration the latest, and replace it with:
    Code:
    var = *ptr;
    if (!var) *ptr = 1;
    (no loop)
    ...and if both ptr and *ptr are not volatile or atomic, do all that without having to "prove" anything.
    Last edited by indepe; 06 December 2021, 07:19 PM.

    Comment


    • #12
      Originally posted by caligula View Post
      The license is non-copyleft (BSD and Apache), which is morally superior, at least. When you're a better person, you don't need to force people to contribute back (RMS style freedom). As a result the code will also be of higher quality.
      Free Software, Open Source, copyleft, GPL, LGPL, MPL, GPL v3+, licenses, software licenses, licensing


      What are you attempting to be a joke. OpenOffice under Apache 2.0 vs LibreOffice under Mozilla Public License you should have a serous look at. Yes Mozilla Public License is a copyleft license. Yes libreoffice has end up as the higher quality code and more paid full time developers.

      This is not the only example of this. BSD and Apache licenses on a lot of projects end up losing out to the forks that go under other copyleft licenses.

      Legal departments in many companies are more willing to sign off for their staff working on copyleft projects sharing their work out side the company than BSD or Apache ones. So yes non-copyleft might be able to claim to be more morally superior but the problem here is most companies we need to pay developer time are not morally superior. Also not all markets are filled with the same mix of companies either.

      So depending on the companies who will use your code base and work on your code base serous-ally alters if you should use a copyleft license or not. Some areas like office suites and server kernels being copyleft has proven to be advantage.

      Yes having a non copyleft code base in a market where the parties who will pay coders to work on the code are not morally superior but are morally inferior so will keep all their alterations in house will result the code base not developing.

      Yes there are other markets where the companies are in the morally superior camp where they will give back without license requirement to BSD/Apache projects.

      The horrible part here is a company can be morally superior in one market and morally inferior in another market this makes it very tricky at times to work out what the right license should be..

      The choice between if a project should be copyleft or not is a very hard choice. The wrong choice could be the very reason the project fails to develop. Yes it very important to remember the world is filled with morally inferior people. Attempting to act morally superior is a good way to get laughed at as what you are attempting todo fails.

      Interesting point here markets were large numbers people are willing to use commercial software without paying licenses they should are the markets in most cases you are better off using copyleft. Yes morally inferior people problem. This is a true one size does not fit all.

      Comment


      • #13
        Yay, any improvement for LLVM means OpenBSD and FreeBSD get faster and that is a good thing because they are my favorite operating systems.

        Comment


        • #14
          Originally posted by intelfx View Post

          It's not. Nice trolling though, I even fell for it.
          What do you mean? I just checked LLVM seems to be Apache 2.0 Licensed.

          Comment


          • #15
            Originally posted by oiaohm View Post

            Legal departments in many companies are more willing to sign off for their staff working on copyleft projects sharing their work out side the company than BSD or Apache ones. So yes non-copyleft might be able to claim to be more morally superior but the problem here is most companies we need to pay developer time are not morally superior. Also not all markets are filled with the same mix of companies either.
            Uh I don't know what world you are living in but where I have worked the recommendation from legal for all open source work is Apache (sometimes BSD/MIT), not GPL2/GPL3. GPL is much more legally complicated than Apache for a company.

            GPL might be the default for companies that work on already preexisting GPL software (i.e. redhat with Linux) but as far as I can tell, when we are dealing with big companies they almost always pick Apache/MIT/BSD (usually preferring Apache due to its patent clause). There are exceptions even wrt to Redhat, i.e. pipewire (the new audio/video stack being developed there) is MIT licensed https://github.com/PipeWire/pipewire
            Last edited by mdedetrich; 07 December 2021, 04:43 AM.

            Comment


            • #16
              Originally posted by mdedetrich View Post

              Uh I don't know what world you are living in but where I have worked the recommendation from legal for all open source work is Apache (sometimes BSD/MIT), not GPL2/GPL3. GPL is much more legally complicated than Apache for a company.

              GPL might be the default for companies that work on already preexisting GPL software (i.e. redhat with Linux) but as far as I can tell, when we are dealing with big companies they almost always pick Apache/MIT/BSD (usually preferring Apache due to its patent clause). There are exceptions even wrt to Redhat, i.e. pipewire (the new audio/video stack being developed there) is MIT licensed https://github.com/PipeWire/pipewire
              Yeah, I think it's common sense to assume that companies that were open source from the start will tend to prefer GPL, the rest - Apache/MIT/BSD.

              Comment


              • #17
                Originally posted by cl333r View Post

                Yeah, I think it's common sense to assume that companies that were open source from the start will tend to prefer GPL, the rest - Apache/MIT/BSD.
                But I would argue that even this is a stretch, note that I am making a distinguishment between companies (i.e. Redhat) and organizations/communities (i.e. Linux). I mean back then, it was actually even worse for companies doing open source (Redhat was a massive standout).

                Comment


                • #18
                  Originally posted by mdedetrich View Post
                  Uh I don't know what world you are living in but where I have worked the recommendation from legal for all open source work is Apache (sometimes BSD/MIT), not GPL2/GPL3. GPL is much more legally complicated than Apache for a company.
                  Willing is most likely the wrong word. It should will share source code.

                  Legal departments in many companies are more willing to sign off for their staff working on copyleft projects sharing their work out side the company than BSD or Apache ones.

                  Please read this line more carefully. This was not saying that you get recommend to use from legal. This is about the ability to share the work outside the company so work cooperatively.

                  Yes a legal department from a morally inferior company will be saying license all your work as Apache/BSD/MIT with the pure plan of some point in the future pulling that code back in extend it internally and beating the living heck out their competition by having advantage. Of course this does not always go to plan as another morally inferior company can beat them to the punch line. Copyleft licenses most of them kill of this behavour.

                  Originally posted by mdedetrich View Post
                  GPL might be the default for companies that work on already preexisting GPL software (i.e. redhat with Linux) but as far as I can tell, when we are dealing with big companies they almost always pick Apache/MIT/BSD (usually preferring Apache due to its patent clause). There are exceptions even wrt to Redhat, i.e. pipewire (the new audio/video stack being developed there) is MIT licensed https://github.com/PipeWire/pipewire
                  Reality here Redhat before IBM commonly licenses stuff as MIT license and has done from day one. But if Redhat has another company that is morally inferior and starts using a project without giving back Redhat before IBM would re-license as GPL or LGPL because of the morally inferiors actions of not working cooperatively.

                  IBM has also been the same where they will use a MIT license until they have problems from someone in the market of that product being morally inferior.

                  Originally posted by cl333r View Post
                  Yeah, I think it's common sense to assume that companies that were open source from the start will tend to prefer GPL, the rest - Apache/MIT/BSD.
                  This is wrong. Take wine project it starts as bsd like license then moves X11 license then moved to LGPL yes this is mentioned in their history https://wiki.winehq.org/Wine_History. Most open source companies start with BSD/MIT/X11 and Apache licenses once burnt by morally inferior company taking their work extending it and starting up in direct competition and end up moving to a copyleft license.

                  The tendency of long term open source companies to develop a preference for copyleft licenses are a direct effect of the morally inferior companies actions in the majority of cases.

                  Why Redhat uses MIT licenses sometimes and why that user LGPL and GPL licenses others is explained by understand what market that software is going into and what kind of companies are in that market. Remember Redhat if they see a morally inferiors causing too many problems they can simply re-license to LGPL a MIT project.

                  Also in market where there are not morally inferiors looking to ruin you using MIT/BSD ....non copyleft can be a good way to get simply past legal departments. Of course once everyone has made the project part of their core workflow then change to LGPL. Yes Redhat and others have done this stunt over 100 times over the last decade perfectly successfully. Do I class this as morally questionable yes I do but it does work. So there are multi levels of bait and switch games in play.

                  Morally inferiors who will take other peoples work extend that work hidden from the public and use that extended work as closed source compete with the original project is the biggest driving force of the usage of copyleft licenses.

                  Yes it really hard at times to tell if you are working in a morally superior company or a morally inferior company or a company that will be morally superior/morally inferior on a case by case base. Yes the advice you can be getting from the legal departments of all these types companies can be absolutely identical at first.

                  Choosing right license for your project is not simple. Because humans running companies are not simple and humans are not all the same level of morality.

                  mdedetrich and cl333r; I have being around open source for over 20 years and I have watched all these different behaviours happen and I have no reason to believe they will magically stop any time soon. So all I can say is we have to except that we have morally inferiors in the open source world and this does have side effects on licensing that creates bias in the copyleft direction for long term open source companies. This is just how the world is and most likely always will be as long as companies/humans are around wanting to make profit by defeating their competitors..

                  Some ways you could say new people to open source start out optimistic and go morally idealist licenses only to be progressively burnt by the morally inferiors and one day that optimistic world view disappears replaced from a view that copyleft licences are a good idea so they don't have to put up with as many morally inferiors..

                  Comment


                  • #19
                    Originally posted by mdedetrich View Post

                    But I would argue that even this is a stretch, note that I am making a distinguishment between companies (i.e. Redhat) and organizations/communities (i.e. Linux). I mean back then, it was actually even worse for companies doing open source (Redhat was a massive standout).
                    What do you mean by "worse"? Legally? Financially? Choice wise not enough software?

                    Comment


                    • #20
                      Originally posted by oiaohm View Post
                      .
                      a) if you want to be taken seriously write less blabber.
                      b) bother not skipping words like "tend"
                      c) Your example doesn't prove or disprove what I said because of b)

                      Comment

                      Working...
                      X