1. Sep 27, 2016
    • Davide Italiano's avatar
      [CodeGen] Switch test as FreeBSD will support .init_array soon. · f5d77f4a
      Davide Italiano authored
      llvm-svn: 282450
      f5d77f4a
    • Eric Fiselier's avatar
      Expect DLL builds on Windows by default and require a custom __config for static · 54644216
      Eric Fiselier authored
      builds.
      
      On Windows the __declspec(dllimport) and __declspec(dllexport) attributes
      require linking to a DLL, not a static library. Previously these annotations
      were disabled by default unless _LIBCPP_DLL was defined. However the DLL
      configuration is probably the more common one, so it should be supported by
      default.
      
      This patch enables import/export attributes by default and adds a
      _LIBCPP_DISABLE_DLL_IMPORT_EXPORT macro which can be used to disable this
      behavior. If libc++ is built as a static library on Windows then a custom __config
      header will be generated that predefines this macro.
      
      This patch is based off work by Shoaib Meenai.
      
      llvm-svn: 282449
      54644216
    • Daniel Jasper's avatar
      [clang-format] Don't allow newline after uppercase Obj-C block return types · e31388ae
      Daniel Jasper authored
      Fixes the following:
        BOOL (^aaa)(void) = ^BOOL {
        };
      
      The first BOOL's token was getting set to TT_FunctionAnnotationRParen
      incorrectly, which was causing an unexpected newline after (^aaa). This
      was introduced in r245846.
      
      Patch by Kent Sutherland, thank you!
      
      llvm-svn: 282448
      e31388ae
    • Saleem Abdulrasool's avatar
      headers: add missing Windows ARM Interlocked intrinsics · eae64f8a
      Saleem Abdulrasool authored
      On ARM, there are multiple versions of each of the intrinsics, with
      acquire/relaxed/release barrier semantics.
      
      The newly added ones are provided as inline functions here instead of builtins,
      since they should only be available on certain archs (arm/aarch64).
      
      This is necessary in order to compile C++ code for ARM in MSVC mode.
      
      Patch by Martin Storsjö!
      
      llvm-svn: 282447
      eae64f8a
    • Oleg Ranevskyy's avatar
      [libc++] Fix typos causing compilation errors when _LIBCPP_DEBUG_LEVEL >= 2 · eef9b35c
      Oleg Ranevskyy authored
      Summary: This patch fixes a couple of typos that cause compilation errors when application includes <unordered_map> and enables the libc++'s debugging capabilities.
      
      Reviewers: EricWF
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D24883
      
      llvm-svn: 282446
      eef9b35c
    • Enrico Granata's avatar
      Fix an issue where LLDB would not accept the --description-verbosity option to... · 543a26e9
      Enrico Granata authored
      Fix an issue where LLDB would not accept the --description-verbosity option to 'po' without an argument after the StringRef refactoring
      
      Fixes rdar://28480275
      
      llvm-svn: 282445
      543a26e9
    • Rafael Espindola's avatar
      Non alloca sections should not keep other sections live. · 2b9008e5
      Rafael Espindola authored
      This matches the gold behaviour and is important to prevent debug info
      from effectively disabling gc.
      
      llvm-svn: 282444
      2b9008e5
    • Richard Smith's avatar
      3b66056a
    • Derek Schuff's avatar
      [WebAssembly] Use the frame pointer instead of the stack pointer · 92d300eb
      Derek Schuff authored
      When we have dynamic allocas we have a frame pointer, and
      when we're lowering frame indexes we should make sure we use it.
      
      Patch by Jacob Gravelle
      
      Differential Revision: https://reviews.llvm.org/D24889
      
      llvm-svn: 282442
      92d300eb
    • Kevin Enderby's avatar
      Next set of additional error checks for invalid Mach-O files for the · 90986e6c
      Kevin Enderby authored
      other load commands that use the Mach::linkedit_data_command type
      but not used in llvm libObject code but used in llvm tool code.
      
      This includes LC_FUNCTION_STARTS, LC_SEGMENT_SPLIT_INFO
      and LC_DYLIB_CODE_SIGN_DRS load commands.
      
      llvm-svn: 282441
      90986e6c
    • Aditya Kumar's avatar
      Move computation past early return · 0a48b37c
      Aditya Kumar authored
      Reviewers:
              rafael
              spatel
      
      Differential Revision: https://reviews.llvm.org/D24843
      
      llvm-svn: 282440
      0a48b37c
    • Eric Fiselier's avatar
      [libc++] Extension: Make `move` and `forward` constexpr in C++11. · c24e6dd3
      Eric Fiselier authored
      Summary:
      `std::move` and `std::forward` were not marked constexpr in C++11.  This can be very damaging because it makes otherwise constant expressions non-constant. For example:
      
      ```
      #include <utility>
      template <class T>
      struct Foo {
        constexpr Foo(T&& tx) :  t(std::move(tx)) {}
        T t;
      };
      [[clang::require_constant_initialization]] Foo<int> f(42); // Foo should be constant initialized but C++11 move is not constexpr. As a result `f` is an unsafe global.
      ```
      
      This patch applies `constexpr` to `move` and `forward` as an extension in C++11. Normally the library is not allowed to add `constexpr` because it may be observable to the user. In particular adding constexpr may cause valid code to stop compiling. However these problems only happen in more complex situations, like making `__invoke(...)` constexpr. `forward` and `move` are simply enough that applying `constexpr` is safe. 
      
      Note that libstdc++ has offered this extension since at least 4.8.1.
      
      Most of the changes in this patch are simply test cleanups or additions. The main changes in the tests are:
      
      * Fold all `forward_N.fail.cpp` tests into a single `forward.fail.cpp` test using -verify.
      * Delete most `move_only_N.fail.cpp` tests because they weren't actually testing anything.
      * Fold `move_copy.pass.cpp` and `move_only.pass.cpp` into a single `move.pass.cpp` test.
      * Add return type and noexcept tests for `forward` and `move`.
      
      
      
      
      Reviewers: rsmith, mclow.lists, EricWF
      
      Subscribers: K-ballo, loladiro
      
      Differential Revision: https://reviews.llvm.org/D24637
      
      llvm-svn: 282439
      c24e6dd3
    • Matthias Braun's avatar
      Fix test on windows · fedd367d
      Matthias Braun authored
      llvm-svn: 282438
      fedd367d
    • Piotr Padlewski's avatar
      [thinlto] Basic thinlto fdo heuristic · d9830eb7
      Piotr Padlewski authored
      Summary:
      This patch improves thinlto importer
      by importing 3x larger functions that are called from hot block.
      
      I compared performance with the trunk on spec, and there
      were about 2% on povray and 3.33% on milc. These results seems
      to be consistant and match the results Teresa got with her simple
      heuristic. Some benchmarks got slower but I think they are just
      noisy (mcf, xalancbmki, omnetpp)- running the benchmarks again with
      more iterations to confirm. Geomean of all benchmarks including the noisy ones
      were about +0.02%.
      
      I see much better improvement on google branch with Easwaran patch
      for pgo callsite inlining (the inliner actually inline those big functions)
      Over all I see +0.5% improvement, and I get +8.65% on povray.
      So I guess we will see much bigger change when Easwaran patch will land
      (it depends on new pass manager), but it is still worth putting this to trunk
      before it.
      
      Implementation details changes:
      - Removed CallsiteCount.
      - ProfileCount got replaced by Hotness
      - hot-import-multiplier is set to 3.0 for now,
      didn't have time to tune it up, but I see that we get most of the interesting
      functions with 3, so there is no much performance difference with higher, and
      binary size doesn't grow as much as with 10.0.
      
      Reviewers: eraman, mehdi_amini, tejohnson
      
      Subscribers: mehdi_amini, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D24638
      
      llvm-svn: 282437
      d9830eb7
    • Todd Fiala's avatar
      added Linux support for test timeout sampling · 2cd84c90
      Todd Fiala authored
      This is the Linux counterpart to the sampling support I added
      on the macOS side.
      
      This change also introduces zip-file compression if the size of
      the sample output is greater than 10 KB.  The Linux side can be
      quite large and the textual content is averaging over a 10x
      compression factor on tests that I force to time out.  When
      compression takes place, the filename becomes:
      
          {session_dir}/{TestFilename.py}-{pid}.sample.zip
      
      This support relies on the linux 'perf' tool.  If it isn't
      present, the behavior is to ignore pre-kill processing of
      the timed out test process.
      
      Note calling the perf tool under the timeout command appears
      to nuke the profiled process.  This was causing the timeout
      kill logic to fail due to the process having disappeared.
      I modified the kill logic to catch the case of the process
      not existing, and I have it ignore the kill request in that
      case.  Any other exception is still raised.
      
      Reviewers: labath
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D24890
      
      llvm-svn: 282436
      2cd84c90
    • Michal Gorny's avatar
      [include] Declare __STDC_*_MACROS for C++11 compat in old libc · 9eddaeb5
      Michal Gorny authored
      Declare __STDC_FORMAT_MACROS, __STDC_LIMIT_MACROS and
      __STDC_CONSTANT_MACROS before including real inttypes.h/stdint.h when
      the wrapper-header is included in C++11, in order to enable
      the necessary macros in C99-compliant libc.
      
      The C99 standard defined that the format macros in inttypes.h should be
      defined by the C++ implementations only when __STDC_FORMAT_MACROS is
      defined, and the limit and constant macros in stdint.h should be defined
      only when __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined
      appropriately. Following this specification, multiple old versions of
      glibc up to 2.17 do not define those macros by default for C++,
      rendering the libc++ headers non-compliant to the C++11 standard.
      
      In order to achieve the necessary compliance, __STDC_FORMAT_MACROS is
      defined in wrapped inttypes.h just before including the system
      inttypes.h, when C++11 or newer is used. Both __STDC_LIMIT_MACROS
      and __STDC_CONSTANT_MACROS are defined in newly-wrapped stdint.h. This
      fixes the C++11 compliance while preserving the current behavior for
      C++03.
      
      Differential Revision: https://reviews.llvm.org/D24903
      
      llvm-svn: 282435
      9eddaeb5
    • Sean Callanan's avatar
      Added a setting that enables saving all .o files from a given JIT expression. · 5deb06eb
      Sean Callanan authored
      This allows debugging of the JIT and other analyses of the internals of the
      expression parser.  I've also added a testcase that verifies that the setting
      works correctly when off and on.
      
      llvm-svn: 282434
      5deb06eb
    • Zachary Turner's avatar
      Allow StringRef to be constructed from a null pointer. · d543def2
      Zachary Turner authored
      Differential Revision: https://reviews.llvm.org/D24904
      
      llvm-svn: 282433
      d543def2
    • Jim Ingham's avatar
      Fix serialization of Python breakpoint commands. · f7e07256
      Jim Ingham authored
      CommandData breakpoint commands didn't know whether they were
      Python or Command line commands, so they couldn't serialize &
      deserialize themselves properly.  Fix that.
      I also changed the "breakpoint list" command to note in the output
      when the commands are Python commands.  Fortunately only one test
      was relying on this explicit bit of text output.
      
      llvm-svn: 282432
      f7e07256
    • Nirav Dave's avatar
      Add support for Code16GCC · 6477ce26
      Nirav Dave authored
      [X86] The .code16gcc directive parses X86 assembly input in 32-bit mode and
      outputs in 16-bit mode. Teach parser to switch modes appropriately.
      
      Reviewers: dwmw2, craig.topper
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D20109
      
      llvm-svn: 282430
      6477ce26
    • George Rimar's avatar
      [ELF] - Linkerscript: implemented BYTE/SHORT/LONG/QUAD commands. · e38cbab5
      George Rimar authored
      The BYTE, SHORT, LONG, and QUAD commands store one, two, four, and eight bytes (respectively). 
      After storing the bytes, the location counter is incremented by the number of bytes
      stored.
      
      Previously our scripts handles these commands incorrectly. For example:
      SECTIONS  {
        .foo : {
       *(.foo.1)
       BYTE(0x11)
      ...
      We accepted the script above treating BYTE as input section description. 
      These commands are used in the wild though.
      
      Differential revision: https://reviews.llvm.org/D24830
      
      llvm-svn: 282429
      e38cbab5
    • Andrew Kaylor's avatar
      Add optimization bisect support to an optional Mips pass · 595307a4
      Andrew Kaylor authored
      Differential Revision: https://reviews.llvm.org/D19513
      
      llvm-svn: 282428
      595307a4
    • George Rimar's avatar
      [ELF] - Fix for: Bug 30521 - lld exits non-zero return value linking a library with no entry symbol · a213e6b6
      George Rimar authored
      PR30521 was about linking shared library. After r282295 code when linking -shared produced
      "entry symbol not found" warning, what in combination with --fatal-errors failed linkage.
      
      Patch fixes logic (and adds testcases) to follow next rules:
      
      1) If entry was specified and not found report warning.
      2) If entry was not specified then:
       a) Emit warning if not -shared.
       b) Do not emit warning if -shared.
      
      Differential revision: https://reviews.llvm.org/D24913
      
      llvm-svn: 282427
      a213e6b6
    • Matthias Braun's avatar
      CC1: Add -save-stats option · abb6eea1
      Matthias Braun authored
      This option behaves in a similar spirit as -save-temps and writes
      internal llvm statistics in json format to a file.
      
      Differential Revision: https://reviews.llvm.org/D24820
      
      llvm-svn: 282426
      abb6eea1
    • Matthias Braun's avatar
      Statistic: Only print statistics on exit for -stats · c603551b
      Matthias Braun authored
      Previously enabling the statistics with EnableStatistics() would lead to
      them getting printed to stderr/-info-output-file on exit. However
      frontends may want a way to enable statistics and do the printing on
      their own instead of the forced printing on exit.
      
      This changes the code so that only the -stats option enables printing on
      exit, EnableStatistics() only enables the tracking but requires invoking
      one of the PrintStatistics() variants.
      
      Differential Revision: https://reviews.llvm.org/D24819
      
      llvm-svn: 282425
      c603551b
    • Matthias Braun's avatar
      MachineInstr: Fix comment typo, further refine comment; NFC · 3de07911
      Matthias Braun authored
      llvm-svn: 282424
      3de07911
    • Evandro Menezes's avatar
      [AArch64] Fix test triplet · 055767d5
      Evandro Menezes authored
      Specify proper target triplet to pass under Windows too.
      
      llvm-svn: 282423
      055767d5
    • Vedant Kumar's avatar
      [llvm-cov] Silence a warning from the MSVC runtime (NFC) · 5cd496ba
      Vedant Kumar authored
      Rework getLongestCommonPrefixLen() so that it doesn't access string null
      terminators. The old version with std::mismatch would do this:
      
                              |
                              v
          Strings[0] = ['a', nil]
      
          Strings[1] = ['a', 'a', nil]
                              ^
                              |
      
      This should silence a warning from the MSVC runtime (PR30515). As
      before, I tested this out by preparing a coverage report for FileCheck.
      Thanks to Yaron Keren for the report!
      
      llvm-svn: 282422
      5cd496ba
    • Daniel Berlin's avatar
      Update MemorySSA unittest to account for non-pruned SSA form · f72ac492
      Daniel Berlin authored
      llvm-svn: 282421
      f72ac492
    • Tom Stellard's avatar
      AMDGPU/SI: Don't crash on anonymous GlobalValues · 1b9748c6
      Tom Stellard authored
      Summary:
      We need to call AsmPrinter::getNameWithPrefix() in order to handle
      anonymous GlobalValues (e.g. @0, @1).
      
      Reviewers: arsenm, b-sumner
      
      Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D24865
      
      llvm-svn: 282420
      1b9748c6
    • Daniel Berlin's avatar
      Remove pruning of phi nodes in MemorySSA - it makes updating harder · 1e98c042
      Daniel Berlin authored
      Reviewers: george.burgess.iv
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D24923
      
      llvm-svn: 282419
      1e98c042
    • Matthew Simpson's avatar
      [LV] Scalarize instructions marked scalar after vectorization · b764aba2
      Matthew Simpson authored
      This patch ensures that we actually scalarize instructions marked scalar after
      vectorization. Previously, such instructions may have been vectorized instead.
      
      Differential Revision: https://reviews.llvm.org/D23889
      
      llvm-svn: 282418
      b764aba2
    • Aaron Ballman's avatar
      Complete support for the cxxCtorInitializer() AST matcher so that it can be... · 5fa302cb
      Aaron Ballman authored
      Complete support for the cxxCtorInitializer() AST matcher so that it can be used as a top-level matcher.
      
      llvm-svn: 282417
      5fa302cb
    • Haojian Wu's avatar
      [ASTMatcher] Add isStaticStorageClass matcher for varDecl and functionDecl. · b3d2546c
      Haojian Wu authored
      Reviewers: klimek
      
      Subscribers: cfe-commits, klimek
      
      Differential Revision: https://reviews.llvm.org/D24821
      
      llvm-svn: 282415
      b3d2546c
  2. Sep 26, 2016
    • Gor Nishanov's avatar
      [Coroutines] Part14: Handle coroutines with no suspend points. · bc0ebb38
      Gor Nishanov authored
      Summary:
      If coroutine has no suspend points, remove heap allocation and turn a coroutine into a normal function.
      
      Also, if a pattern is detected that coroutine resumes or destroys itself prior to coro.suspend call, turn the suspend point into a simple jump to resume or cleanup label. This pattern occurs when coroutines are used to propagate errors in functions that return expected<T>.
      
      Reviewers: majnemer
      
      Subscribers: mehdi_amini, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D24408
      
      llvm-svn: 282414
      bc0ebb38
    • Geoff Berry's avatar
      [AArch64] Improve add/sub/cmp isel of uxtw forms. · 256fcf97
      Geoff Berry authored
      Don't match the UXTW extended reg forms of ADD/ADDS/SUB/SUBS if the
      32-bit to 64-bit zero-extend can be done for free by taking advantage
      of the 32-bit defining instruction zeroing the upper 32-bits of the X
      register destination.  This enables better instruction selection in a
      few cases, such as:
      
        sub x0, xzr, x8
        instead of:
        mov x8, xzr
        sub x0, x8, w9, uxtw
      
        madd x0, x1, x1, x8
        instead of:
        mul x9, x1, x1
        add x0, x9, w8, uxtw
      
        cmp x2, x8
        instead of:
        sub x8, x2, w8, uxtw
        cmp x8, #0
      
        add x0, x8, x1, lsl #3
        instead of:
        lsl x9, x1, #3
        add x0, x9, w8, uxtw
      
      Reviewers: t.p.northover, jmolloy
      
      Subscribers: mcrosier, aemerson, llvm-commits, rengolin
      
      Differential Revision: https://reviews.llvm.org/D24747
      
      llvm-svn: 282413
      256fcf97
    • Evandro Menezes's avatar
      Add support to optionally limit the size of jump tables. · e45de8a5
      Evandro Menezes authored
      Many high-performance processors have a dedicated branch predictor for
      indirect branches, commonly used with jump tables.  As sophisticated as such
      branch predictors are, they tend to have well defined limits beyond which
      their effectiveness is hampered or even nullified.  One such limit is the
      number of possible destinations for a given indirect branches that such
      branch predictors can handle.
      
      This patch considers a limit that a target may set to the number of
      destination addresses in a jump table.
      
      Patch by: Evandro Menezes <e.menezes@samsung.com>, Aditya Kumar
      <aditya.k7@samsung.com>, Sebastian Pop <s.pop@samsung.com>.
      
      Differential revision: https://reviews.llvm.org/D21940
      
      llvm-svn: 282412
      e45de8a5
    • Daniel Marjamaki's avatar
      [analyzer] Improve CastToStruct checker so it can also detect widening casts of struct data · 13264ebe
      Daniel Marjamaki authored
      Example:
      
      struct AB {
        int A;
        int B;
      };
      
      struct ABC {
        int A;
        int B;
        int C;
      };
      
      void f() {
        struct AB Data;
        struct ABC *P = (struct ABC *)&Data;
      }
      
      Differential Revision: https://reviews.llvm.org/D23508
      
      llvm-svn: 282411
      13264ebe
    • Daniel Jasper's avatar
      clang-format: Only special-case top-level */& in multivar-declstmts. · 3f2cde91
      Daniel Jasper authored
      Before (even with PointerAlignment: Left):
        vector<int *> a, b;
      
      After:
        vector<int*> a, b;
      
      llvm-svn: 282410
      3f2cde91
    • Aaron Ballman's avatar
      Silence a false positive with the cert-err58-cpp check; now allows objects... · 16057285
      Aaron Ballman authored
      Silence a false positive with the cert-err58-cpp check; now allows objects with static or thread storage duration at function block scope.
      
      Patch by Malcolm Parsons
      
      llvm-svn: 282409
      16057285