1. Nov 16, 2016
    • Ed Schouten's avatar
      Merge r280672, per bug 30839: · e9ceabd0
      Ed Schouten authored
        Add support for targeting armv6-unknown-cloudabi-eabihf.
      
        I'm in the progress of adding ARMv6 support to CloudABI. On the compiler
        side, everything seems to work properly with this tiny change applied.
      
      llvm-svn: 287093
      e9ceabd0
    • Alexey Bataev's avatar
      Merging r287025: · 268274a9
      Alexey Bataev authored
      ------------------------------------------------------------------------
      r287025 | abataev | 2016-11-15 20:57:18 +0000 (Tue, 15 Nov 2016) | 3 lines
      
      [OPENMP] Fix stack use after delete, NFC.
      
      Fixed possible use of stack variable after deletion.
      ------------------------------------------------------------------------
      
      llvm-svn: 287033
      268274a9
  2. Nov 15, 2016
    • Alexey Bataev's avatar
      Merging r283223: · f876bbe0
      Alexey Bataev authored
      r283223 | davidsh | 2016-10-04 10:41:36 -0400 (Tue, 04 Oct 2016) | 1 line
      
      [OpenMP] fix segfault when a variable referenced in reduction clause is a reference parameter
      Differential Revision: http://reviews.llvm.org/D24524
      
      llvm-svn: 286972
      f876bbe0
    • Alexey Bataev's avatar
      Merging r284229: · c78edcc2
      Alexey Bataev authored
      ------------------------------------------------------------------------
      r284229 | abataev | 2016-10-14 12:43:59 +0000 (Fri, 14 Oct 2016) | 37 lines
      
      Fix for PR30632: Name mangling issue.
      
      There was a bug in the implementation of captured statements. If it has
      a lambda expression in it and the same lambda expression is used outside
      the captured region, clang produced an error:
      ```
      error: definition with same mangled name as another definition
      ```
      Here is an example:
      ```
      struct A {
       template <typename L>
       void g(const L&) { }
      };
      
      template<typename T>
      void f() {
        {
          A().g([](){});
        }
        A().g([](){});
      }
      
      int main() {
        f<void>();
      }
      ```
      
      Error report:
      ```
      main.cpp:3:10: error: definition with same mangled name as another
      definition
          void g(const L&) { }
                   ^
      main.cpp:3:10: note: previous definition is here
      ```
      Patch fixes this bug.
      ------------------------------------------------------------------------
      
      llvm-svn: 286970
      c78edcc2
    • Alexey Bataev's avatar
      Merging r286944: · 0a72d7c5
      Alexey Bataev authored
      ------------------------------------------------------------------------
      r286944 | abataev | 2016-11-15 09:11:50 +0000 (Tue, 15 Nov 2016) | 6 lines
      
      [OPENMP] Fixed codegen for 'omp cancel' construct.
      
      If 'omp cancel' construct is used in a worksharing construct it may cause
      hanging of the software in case if reduction clause is used. Patch fixes
      this problem by avoiding extra reduction processing for branches that
      were canceled.
      ------------------------------------------------------------------------
      
      llvm-svn: 286968
      0a72d7c5
    • Alexey Bataev's avatar
      Merging r286584: · 765b7888
      Alexey Bataev authored
      ------------------------------------------------------------------------
      r286584 | abataev | 2016-11-11 12:36:20 +0000 (Fri, 11 Nov 2016) | 31 lines
      
      Fix for PR28523: unexpected compilation error.
      
      Clang emits error message for the following code:
      ```
      template <class F> void parallel_loop(F &&f) { f(0); }
      
      int main() {
        int x;
        parallel_loop([&](auto y) {
          {
            x = y;
          };
        });
      }
      ```
      
      $ clang++ --std=gnu++14 clang_test.cc -o clang_test
      clang_test.cc:9:7: error: reference to local variable 'x' declared in enclosing function 'main'
            x = y;
                  ^
      clang_test.cc:2:48: note: in instantiation of function template specialization 'main()::(anonymous class)::operator()<int>' requested here
                  template <class F> void parallel_loop(F &&f) { f(0); }
                                                                 ^
      clang_test.cc:6:3: note: in instantiation of function template specialization 'parallel_loop<(lambda at clang_test.cc:6:17)>' requested here parallel_loop([&](auto y) {
                 ^
      clang_test.cc:5:7: note: 'x' declared here
            int x;
                ^
      1 error generated.
      
      Patch fixes this issue.
      ------------------------------------------------------------------------
      
      llvm-svn: 286966
      765b7888
    • Alexey Bataev's avatar
      Merging r286129: · fe68fa6e
      Alexey Bataev authored
      ------------------------------------------------------------------------
      r286129 | abataev | 2016-11-07 18:15:02 +0000 (Mon, 07 Nov 2016) | 8 lines
      
      [OPENMP] Fixed codegen for __real/__imag expressions in atomic
      constructs.
      
      For __real/__imag unary expressions clang emits lvalue with the
      associated type from the original complex expression, but not the
      underlying builtin integer or float type. This causes crash in codegen
      for atomic constructs, if __real/__imag expression are used in atomic
        constructs.
      ------------------------------------------------------------------------
      
      llvm-svn: 286965
      fe68fa6e
    • Alexey Bataev's avatar
      Merging r284110: · 5cb5303b
      Alexey Bataev authored
      ------------------------------------------------------------------------
      r284110 | abataev | 2016-10-13 09:52:46 +0000 (Thu, 13 Oct 2016) | 9 lines
      
      Fix for PR30639: CGDebugInfo Null dereference with OpenMP array
      access, by Erich Keane
      
      OpenMP creates a variable array type with a a null size-expr. The Debug
      generation failed to due to this. This patch corrects the openmp
      implementation, updates the tests, and adds a new one for this
      condition.
      
      Differential Revision: https://reviews.llvm.org/D25373
      ------------------------------------------------------------------------
      
      llvm-svn: 286964
      5cb5303b
    • Richard Trieu's avatar
      Merging rr285370: · 63056d4c
      Richard Trieu authored
      ------------------------------------------------------------------------
      r285370 | rtrieu | 2016-10-27 17:15:24 -0700 (Thu, 27 Oct 2016) | 10 lines
      
      Fix a crash on invalid code.
      
      The diagnostic was attempting to access the QualType of a TypeDecl by calling
      TypeDecl::getTypeForDecl.  However, the Type pointer stored there is lazily
      loaded by functions in ASTContext.  In most cases, the pointer is loaded and
      this does not cause a problem.  However, when more that 50 or so unknown types
      are seen beforehand, this causes the Type to not be loaded, passing a null
      Type to the diagnostics, leading to the crash.  Using
      ASTContext::getTypeDeclType will give a proper QualType for all cases.
      
      ------------------------------------------------------------------------
      
      llvm-svn: 286923
      63056d4c
    • Richard Trieu's avatar
      Merging r282989: · f92e135e
      Richard Trieu authored
      ------------------------------------------------------------------------
      r282989 | rtrieu | 2016-09-30 17:15:24 -0700 (Fri, 30 Sep 2016) | 10 lines
      
      Fix crash when emitting error.
      
      With templated classes, is possible to not be able to determine is a member
      function is a special member function before the class is instantiated.  Only
      these special member functions can be defaulted.  In some cases, knowing
      whether a function is a special member function can't be determined until
      instantiation, so an uninstantiated function could possibly be defaulted too.
      Add a case to the error diagnostic when the function marked with a default is
      not known to be a special member function.
      
      ------------------------------------------------------------------------
      
      llvm-svn: 286922
      f92e135e
    • Richard Trieu's avatar
      Merging r281287: · 167a1146
      Richard Trieu authored
      ------------------------------------------------------------------------
      r281287 | rtrieu | 2016-09-12 18:37:01 -0700 (Mon, 12 Sep 2016) | 2 lines
      
      Handle empty message in static_asserts.
      
      ------------------------------------------------------------------------
      
      llvm-svn: 286918
      167a1146
  3. Nov 12, 2016
    • Richard Trieu's avatar
      Merging r281286: · 459d3a48
      Richard Trieu authored
      ------------------------------------------------------------------------
      r281286 | rtrieu | 2016-09-12 18:20:40 -0700 (Mon, 12 Sep 2016) | 6 lines
      
      Fix interaction between serialization and c++1z feature.
      
      In c++1z, static_assert is not required to have a StringLiteral message, where
      previously it was required.  Update the AST Reader to be able to handle a
      null StringLiteral.
      
      ------------------------------------------------------------------------
      
      llvm-svn: 286667
      459d3a48
  4. Nov 09, 2016
    • Simon Pilgrim's avatar
      [3.9.1] Merging r283070 - [X86][AVX] Ensure broadcast loads respect dependencies · 863df312
      Simon Pilgrim authored
      To allow broadcast loads of a non-zero'th vector element, lowerVectorShuffleAsBroadcast can replace a load with a new load with an adjusted address, but unfortunately we weren't ensuring that the new load respected the same dependencies.
      
      This patch adds a TokenFactor and updates all dependencies of the old load to reference the new load instead.
      
      Bug found during internal testing.
      
      Differential Revision: https://reviews.llvm.org/D25039
      
      As discussed on PR30596
      
      llvm-svn: 286251
      863df312
    • Simon Pilgrim's avatar
      [3.9.1] Merging r282613 - [X86][AVX] Add test showing that VBROADCAST loads... · cacba2ea
      Simon Pilgrim authored
      [3.9.1] Merging r282613 - [X86][AVX] Add test showing that VBROADCAST loads don't correctly respect dependencies
      
      As discussed in PR30596, this is a preliminary test update before we can merge r283070
      
      Note: This required the test to be regenerated after the merge as 3.9.1 doesn't have trunk's latest lea -> mov simplifications
      llvm-svn: 286248
      cacba2ea
    • Hans Wennborg's avatar
      Merging r283129: · e46e43f6
      Hans Wennborg authored
      ------------------------------------------------------------------------
      r283129 | hans | 2016-10-03 11:18:04 -0700 (Mon, 03 Oct 2016) | 6 lines
      
      Jump threading: avoid trying to split edge into landingpad block (PR27840)
      
      Splitting the edge is nontrivial because of the landing pad, and we would
      currently assert trying to do it.
      
      Differential Revision: https://reviews.llvm.org/D24680
      ------------------------------------------------------------------------
      
      llvm-svn: 286246
      e46e43f6
  5. Sep 30, 2016
  6. Sep 29, 2016
    • Eric Fiselier's avatar
      Merging rr280190: · c457a1b8
      Eric Fiselier authored
      ------------------------------------------------------------------------
      r280190 | rsmith | 2016-08-30 20:15:21 -0600 (Tue, 30 Aug 2016) | 12 lines
      
      PR12298 et al: don't recursively instantiate a template specialization from
      within the instantiation of that same specialization. This could previously
      happen for eagerly-instantiated function templates, variable templates,
      exception specifications, default arguments, and a handful of other cases.
      
      We still have an issue here for default template arguments that recursively
      make use of themselves and likewise for substitution into the type of a
      non-type template parameter, but in those cases we're producing a different
      entity each time, so they should instead be caught by the instantiation depth
      limit. However, currently we will typically run out of stack before we reach
      it. :(
      
      ------------------------------------------------------------------------
      
      llvm-svn: 282636
      c457a1b8
    • Matthias Braun's avatar
      Cherry pick r281957 (see http://llvm.org/PR30463) · 93b573f0
      Matthias Braun authored
      llvm-svn: 282615
      93b573f0
  7. Sep 16, 2016
  8. Sep 13, 2016
  9. Aug 25, 2016
    • Hans Wennborg's avatar
      Merging r279647: · ce25e1a7
      Hans Wennborg authored
      ------------------------------------------------------------------------
      r279647 | sanjoy | 2016-08-24 11:10:21 -0700 (Wed, 24 Aug 2016) | 5 lines
      
      [SCCP] Don't delete side-effecting instructions
      
      I'm not sure if the `!isa<CallInst>(Inst) &&
      !isa<TerminatorInst>(Inst))` bit is correct either, but this fixes the
      case we know is broken.
      ------------------------------------------------------------------------
      
      llvm-svn: 279689
      ce25e1a7
  10. Aug 23, 2016
    • Hans Wennborg's avatar
      Merging r279268: · 08064c20
      Hans Wennborg authored
      ------------------------------------------------------------------------
      r279268 | majnemer | 2016-08-19 09:37:40 -0700 (Fri, 19 Aug 2016) | 5 lines
      
      [CloneFunction] Don't remove unrelated nodes from the CGSSC
      
      CGSCC use a WeakVH to track call sites.  RAUW a call within a function
      can result in that WeakVH getting confused about whether or not the call
      site is still around.
      ------------------------------------------------------------------------
      
      llvm-svn: 279477
      08064c20
    • Hans Wennborg's avatar
      Merging r279368: · f7ff8644
      Hans Wennborg authored
      ------------------------------------------------------------------------
      r279368 | ed | 2016-08-20 03:54:51 -0700 (Sat, 20 Aug 2016) | 12 lines
      
      Add R_386_TLS_LE as a relocation having an implicit addend.
      
      TLS on i386 in non-PIE/PIC code seems broken right now, because we don't
      properly add the addend encoded in the instruction to the resulting
      offset when processing R_386_TLS_LE relocations.
      
      Extend one of the existing tests for TLS on i686 to use an addend.
      
      PR:		https://llvm.org/bugs/show_bug.cgi?id=29068
      Reviewed by:	ruiu
      Differential Revision:	https://reviews.llvm.org/D23741
      
      ------------------------------------------------------------------------
      
      llvm-svn: 279476
      f7ff8644
    • Hans Wennborg's avatar
      Merging r279369 and update the test: · 0f664e38
      Hans Wennborg authored
      ------------------------------------------------------------------------
      r279369 | mssimpso | 2016-08-20 07:10:06 -0700 (Sat, 20 Aug 2016) | 1 line
      
      [SLP] Add command line option for minimum tree size (NFC)
      ------------------------------------------------------------------------
      
      llvm-svn: 279474
      0f664e38
    • Hans Wennborg's avatar
      Merging r279352: · e7d842f6
      Hans Wennborg authored
      ------------------------------------------------------------------------
      r279352 | eugenis | 2016-08-19 17:38:55 -0700 (Fri, 19 Aug 2016) | 1 line
      
      [msan] Disable prlimit test on glibc < 2.13.
      ------------------------------------------------------------------------
      
      llvm-svn: 279471
      e7d842f6
    • Hans Wennborg's avatar
      Fix gather-root.ll SLP vectorizer test to not expose UB. · afe20942
      Hans Wennborg authored
      The undefined behaviour (signed integer overflow) is not a regression
      in itself as it was already there, but the test exposing it is a
      regression compared to rc1, i.e. the lit tests no longer run ubsan-clean.
      
      This commit fixes the test based on Matt's change in r279125 to not
      expose the undefined behaviour.
      
      llvm-svn: 279468
      afe20942
  11. Aug 19, 2016