Announcement

Collapse
No announcement yet.

LLVM 6.0 Released With C++14 Default, Intel/AMD Scheduling Improvements

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

  • LLVM 6.0 Released With C++14 Default, Intel/AMD Scheduling Improvements

    Phoronix: LLVM 6.0 Released With C++14 Default, Intel/AMD Scheduling Improvements

    Today marks the long-awaited release of LLVM 6.0 as the slightly late half-year update to this open-source compiler stack and its sub-projects like Clang, LLD, etc...

    http://www.phoronix.com/scan.php?pag...M-6.0-Released

  • #2
    Can someone explain what "scheduler" means in the context of LLVM ? To me, a scheduler is a piece of code in the kernel responsible for.. well scheduling tasks/commands.

    Comment


    • #3
      I guess it's like with other projects and the official announcement only refers to what has already been on the servers for some days?
      https://llvm.org/svn/llvm-project/ll...ASE_600/final/

      Comment


      • #4
        Originally posted by Elyotna View Post
        Can someone explain what "scheduler" means in the context of LLVM ? To me, a scheduler is a piece of code in the kernel responsible for.. well scheduling tasks/commands.
        A model of how to best schedule instructions in the instruction stream to keep most of a cpu's functional units occupied at the same time, taking into account instruction dependencies, execution times and side-effects (flags, ...)

        Comment


        • #5
          Originally posted by mlau View Post

          A model of how to best schedule instructions in the instruction stream to keep most of a cpu's functional units occupied at the same time, taking into account instruction dependencies, execution times and side-effects (flags, ...)
          As an example, say your code generates 4 assembly instructions: A-B-C-D.
          A, B and C take 1 CPU cycle while D takes three cycles.
          In the default order, your code takes 6 CPU cycles.
          But if D works on a register that is not used by the other instructions, then it can be "scheduled" first in the instruction stream, like that: D-A-B-C, without changing the code behaviour. But now your code takes 3 CPU cycles, since D is run "in parallel" to A-B-C.

          I guess the schedulers are specific to CPUs since, even if the instructions are the same (i.e. x86), the number of cycles for one instruction might change from one CPU to another, and thus demands a different scheduling.

          And to add some noise on top of that, out-of-order CPUs also have a hardcoded scheduler... (see https://en.wikipedia.org/wiki/Out-of-order_execution)
          Last edited by Creak; 08 March 2018, 10:07 AM.

          Comment


          • #6
            Hopefully they will be stricter with their C++14 implementation now. It has so far been allowing all kinds of C++17 things in that shouldn't compile in C++14 mode.

            Comment


            • #7
              Originally posted by carewolf View Post
              Hopefully they will be stricter with their C++14 implementation now. It has so far been allowing all kinds of C++17 things in that shouldn't compile in C++14 mode.
              <joke>
              Microsoft contributes to Clang, so it makes sense that it's beginning to be iffy on standards. You know, just like decades old Visual Studio problem where you can use data members and functions of a parent class that has unresolved template arguments. Or you can (decades old Visual Studio bug) use class-scoped types whose class has unresolved template parameters without qualifying the declaration with typename.

              It's always fun to develop on Visual Studio and unknowingly get away with murder. Then you take it to GCC and find all the standards violations (and lots of them!).
              </joke>

              OK, sort-of a joke, because the examples I gave are very real, see code examples below. So, all you have to do is develop your million-lines-of-code project with Visual Studio and find yourself stuck with fixing mistakes Visual Studio permits you to make if you want to move to a different platform. And these are all easy mistakes to make! Thanks Microsoft!

              Code:
              // Example Visual Studio bug from as far back as VS 2008 (and probably further back!)
              template<typename T>
              class A {
              public:
                int x;
                void MicrosoftIsLame() { }
              };
              
              template<typename T>
              class B : public A<T> {
              public:
                typedef A<T> Super;
                // using Super::x; // Uncomment for GCC, Clang, and probably every other C++ compiler
                // using Super::MicrosoftIsLame; // Ditto
                B() {
                  x = 5; // Visual Studio says it's OK
                  MicrosoftIsLame(); // Visual Studio says it's OK
              
                  // Alternatively
                  // this->x = 5;
                  // this->MicrosoftIsLame();
                }
              };
              Code:
              // Example Visual Studio bug as far back as VS 2008 (and probably further back!)
              template<typename T>
              void DoSomething() {
                std::vector<T> v(5, T());
                std::vector<T>::iterator itr = std::max_element(v.begin(), v.end()); // Visual Studio says this is OK
              
                // Uncomment below for GCC, Clang and probably every other C++ compiler
                // typename std::vector<T>::iterator itr = std::max_element(v.begin(), v.end());
              }
              And there are many other innocent mistakes Visual Studio allows you to make. But if you want to use C math macros or POSIX function names? No!! Macros are bad! But it's OK that <windows.h> #defines min() and max() macros and angers everyone... but using M_PI is bad!!! You also need to be spammed with warnings because hypothetically those POSIX names are reserved in ISO C++ (I'm sure, for example, ISO C++ committee will decide that strdup() needs to be part of C++ standard and do something completely different). Or standard C functions like fopen() are declared as unsafe and you should use Microsoft-only fopen_s() or what have you. Use C functions and get spammed with warnings about using C functions. Microsoft is so awesome at C++ and compilers.

              Comment

              Working...
              X