1. Feb 04, 2017
  2. Feb 03, 2017
    • Simon Dardis's avatar
      [mips] Remove absolute size assertion for end directive · 68e9d940
      Simon Dardis authored
      The .end <symbol> directive for MIPS marks the end of a symbol and sets the
      symbol's size. Previously, the corresponding emitDirective handler asserted
      that a function's size could be evaluated to an absolute value at that point
      in time.
      
      This cannot be done with when directives like .align have been encountered,
      instead set the function's size to the corresponding symbolic expression and
      let ELFObjectWriter resolve the expression to an absolute value. This avoids
      a redundant call to evaluateAsAbsolute.
      
      llvm-svn: 294012
      68e9d940
    • Justin Lebar's avatar
      [NVPTX] Enable combineRepeatedFPDivisors for NVPTX. · e90c4684
      Justin Lebar authored
      Reviewers: tra
      
      Subscribers: jholewinski, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D29477
      
      llvm-svn: 294011
      e90c4684
    • Justin Lebar's avatar
      [ADT] Fix comment on StringRef::take_back. NFC · 522211b9
      Justin Lebar authored
      llvm-svn: 294010
      522211b9
    • Daniel Jasper's avatar
      c06f6da3
    • Alex Lorenz's avatar
      [Sema][ObjC++] Typo correction should handle ivars and properties · 776b4176
      Alex Lorenz authored
      After r260016 and r260017 disabled typo correction for ivars and properties
      clang didn't report errors about unresolved identifier in the base of ivar and
      property ref expressions. This meant that clang invoked CodeGen on invalid AST
      which then caused a crash.
      
      This commit re-enables typo correction for ivars and properites, and fixes the
      PR25113 & PR26486 (that were originally fixed in r260017 and r260016) in a
      different manner by transforming the Objective-C ivar reference expression with
      'IsFreeIvar' preserved.
      
      rdar://30310772
      
      llvm-svn: 294008
      776b4176
    • Daniel Sanders's avatar
      [globalisel] Fix missing break. · 320f79c8
      Daniel Sanders authored
      The instruction selector has been emitting the register bank information too.
      
      llvm-svn: 294007
      320f79c8
    • Rafael Espindola's avatar
      Handle numbers followed by ":" in linker scripts. · 4524268c
      Rafael Espindola authored
      This is a fix for Bugzilla 31813.
      
      The problem is that the tokenizer does not create a separate token for
      ":" unless there's white space before it. Changed it to always create
      a token for ":" and reworked some logic that relied on ":" being
      attached to some tokens like "global:" and "local:".
      
      llvm-svn: 294006
      4524268c
    • Rafael Espindola's avatar
      Replace MergeOutputSection with a synthetic section. · 9e9754b5
      Rafael Espindola authored
      With a synthetic merge section we can have, for example, a single
      .rodata section with stings, fixed sized constants and non merge
      constants.
      
      I can be simplified further by not setting Entsize, but that is
      probably better done is a followup patch.
      
      This should allow some cleanup in the linker script code now that
      every output section command maps to just one output section.
      
      llvm-svn: 294005
      9e9754b5
    • Artem Tamazov's avatar
      [AMDGPU][mc] Fix AddressSanitizer leftover issue in gfx7_asm_all test · 43b61561
      Artem Tamazov authored
      Issue occurs when assembling "ds_ordered_count v0, v0 gds".
      
      llvm-svn: 294004
      43b61561
    • Alexey Bataev's avatar
      [SelectionDAG] Fix for PR30775: Assertion `NodeToMatch->getOpcode() != · a0d9f258
      Alexey Bataev authored
      ISD::DELETED_NODE && "NodeToMatch was removed partway through
      selection"' failed.
      
      NodeToMatch can be modified during matching, but code does not handle
      this situation.
      
      Differential Revision: https://reviews.llvm.org/D29292
      
      llvm-svn: 294003
      a0d9f258
    • Maxim Ostapenko's avatar
      [lsan] Disable sem_init_glibc.cc testcase for LSan x86. · 490c508b
      Maxim Ostapenko authored
      This test relies on sanitizer common interceptor to pick the oldest version of
      sem_init function from Glibc. But LSan actually doesn't intercept sem_init, thus
      the new implementation is called that causes test failure. Disable it for LSan x86,
      the proper fix would require to check Glibc version at runtime and adjust
      GET_SEM_VALUE(V) accordingly. 
      
      llvm-svn: 294001
      490c508b
    • Sanne Wouda's avatar
      [ARM] Change TCReturn to tBL if tailcall optimization fails. · a9941857
      Sanne Wouda authored
      Summary:
      The tail call optimisation is performed before register allocation, so
      at that point we don't know if LR is being spilt or not. If LR was spilt
      to the stack, then we cannot do a tail call optimisation. That would
      involve popping back into LR which is not possible in Thumb1 code.
      
      Reviewers: rengolin, jmolloy, rovka, olista01
      
      Reviewed By: olista01
      
      Subscribers: llvm-commits, aemerson
      
      Differential Revision: https://reviews.llvm.org/D29020
      
      llvm-svn: 294000
      a9941857
    • Sanne Wouda's avatar
      [LLC] Add an inline assembly diagnostics handler. · 57b63d6a
      Sanne Wouda authored
      Summary:
      llc would hit a fatal error for errors in inline assembly. The
      diagnostics message is now printed.
      
      Reviewers: rengolin, MatzeB, javed.absar, anemet
      
      Reviewed By: anemet
      
      Subscribers: jyknight, nemanjai, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D29408
      
      llvm-svn: 293999
      57b63d6a
    • Sanne Wouda's avatar
      Test commit: remove a blank line. · 19cfe151
      Sanne Wouda authored
      Testing commit access.
      
      llvm-svn: 293998
      19cfe151
    • Krasimir Georgiev's avatar
      [clang-format] Re-align broken comment lines where appropriate. · d105b72d
      Krasimir Georgiev authored
      Summary:
      The comment aligner was skipping over newly broken comment lines. This patch fixes that.
      
      source:
      ```
      int ab; // line
      int a; // long long
      ```
      
      format with column limit 15 before:
      ```
      int ab; // line
      int a;  // long
             // long
      ```
      
      format with column limit 15 after:
      ```
      int ab; // line
      int a;  // long
              // long
      ```
      
      Reviewers: djasper
      
      Reviewed By: djasper
      
      Subscribers: cfe-commits, klimek
      
      Differential Revision: https://reviews.llvm.org/D29486
      
      llvm-svn: 293997
      d105b72d
    • Ismail Donmez's avatar
      Fix shared build after r293965 (Core) and r293967 (COFF) · 82c489f2
      Ismail Donmez authored
      llvm-svn: 293996
      82c489f2
    • Daniel Jasper's avatar
      da910e0a
    • Alexey Bataev's avatar
      [SLP] Fix for PR31690: Allow using of extra values in horizontal reductions. · a16cfe6f
      Alexey Bataev authored
      Currently LLVM supports vectorization of horizontal reduction
      instructions with initial value set to 0. Patch supports vectorization
      of reduction with non-zero initial values. Also it supports a
      vectorization of instructions with some extra arguments, like:
      
      float f(float x[], int a, int b) {
        float p = a % b;
        p += x[0] + 3;
        for (int i = 1; i < 32; i++)
          p += x[i];
        return p;
      }
      
      Patch allows vectorization of this kind of horizontal reductions.
      
      Differential Revision: https://reviews.llvm.org/D28961
      
      llvm-svn: 293994
      a16cfe6f
    • Mehdi Amini's avatar
      Revert "[ThinLTO] Add an auto-hide feature" · 1380edf4
      Mehdi Amini authored
      This reverts commit r293970.
      
      After more discussion, this belongs to the linker side and
      there is no added value to do it at this level.
      
      llvm-svn: 293993
      1380edf4
    • Maxim Ostapenko's avatar
      [sanitizer] Fix 'dyld: Symbol not found: _memmem' linkage error on Darwin 10.6 · e5f2bfae
      Maxim Ostapenko authored
      This patch tries to fixes sanitizer linkage errors on Darwin 10.6 originally reporded
      in GCC's pr78663 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78663).
      
      Differential Revision: https://reviews.llvm.org/D29287
      
      llvm-svn: 293992
      e5f2bfae
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] Unroll preferences improvements · f29602df
      Stanislav Mekhanoshin authored
      Exit loop analysis early if suitable private access found.
      Do not account for GEPs which are invariant to loop induction variable.
      Do not account for Allocas which are too big to fit into register file anyway.
      Add option for tuning: -amdgpu-unroll-threshold-private.
      
      Differential Revision: https://reviews.llvm.org/D29473
      
      llvm-svn: 293991
      f29602df
    • Ahmed Bougacha's avatar
      [Support] Accept macosx triple as 'darwin' in Host unittest. NFC. · f60b6845
      Ahmed Bougacha authored
      If LLVM was configured with an x86_64-apple-macosx host triple, this
      test would fail, as the API works but the triple isn't in the whitelist.
      
      llvm-svn: 293990
      f60b6845
    • Marcos Pividori's avatar
      [sanitizer coverage] Fix Instrumentation to work on Windows. · db5a5655
      Marcos Pividori authored
      On Windows, the symbols "___stop___sancov_guards" and "___start___sancov_guards"
      are not defined automatically. So, we need to take a different approach.
      We define 3 sections:
      
       Section ".SCOV$A" will only hold a variable ___start___sancov_guard.
       Section ".SCOV$M" will hold the main data.
       Section ".SCOV$Z" will only hold a variable ___stop___sancov_guards.
      
      When linking, they will be merged sorted by the characters after the $, so we
      can use the pointers of the variables ___[start|stop]___sancov_guard to know the
      actual range of addresses of that section.
      
      In this diff, I updated instrumentation to include all the guard arrays in
      section ".SCOV$M".
      
      Differential Revision: https://reviews.llvm.org/D28434
      
      llvm-svn: 293987
      db5a5655
    • Bob Haarman's avatar
      added missing dependency on intrinsics_gen to lib/Core · 37c22a3e
      Bob Haarman authored
      llvm-svn: 293986
      37c22a3e
    • Matt Arsenault's avatar
      AMDGPU: Fold fneg into fmin/fmax_legacy · e1b59530
      Matt Arsenault authored
      llvm-svn: 293972
      e1b59530
    • David Blaikie's avatar
      DebugInfo: ensure type and namespace names are included in pubnames/pubtypes... · a0e3c751
      David Blaikie authored
      DebugInfo: ensure type and namespace names are included in pubnames/pubtypes even when they are only present in type units
      
      While looking to add support for placing singular types (types that will
      only be emitted in one place (such as attached to a strong vtable or
      explicit template instantiation definition)) not in type units (since
      type units have overhead) I stumbled across that change causing an
      increase in pubtypes.
      
      Turns out we were missing some types from type units if they were only
      referenced from other type units and not from the debug_info section.
      
      This fixes that, following GCC's line of describing the offset of such
      entities as the CU die (since there's no compile unit-relative offset
      that would describe such an entity - they aren't in the CU). Also like
      GCC, this change prefers to describe the type stub within the CU rather
      than the "just use the CU offset" fallback where possible. This may give
      the DWARF consumer some opportunity to find the extra info in the type
      stub - though I'm not sure GDB does anything with this currently.
      
      The size of the pubnames/pubtypes sections now match exactly with or
      without type units enabled.
      
      This nearly triples (+189%) the pubtypes section for a clang self-host
      and grows pubnames by 0.07% (without compression). For a total of 8%
      increase in debug info sections of the objects of a Split DWARF build
      when using type units.
      
      llvm-svn: 293971
      a0e3c751
    • Mehdi Amini's avatar
      [ThinLTO] Add an auto-hide feature · b0a8ff71
      Mehdi Amini authored
      When a symbol is not exported outside of the
      DSO, it is can be hidden. Usually we try to internalize
      as much as possible, but it is not always possible, for
      instance a symbol can be referenced outside of the LTO
      unit, or there can be cross-module reference in ThinLTO.
      
      This is a recommit of r293912 after fixing build failures,
      and a recommit of r293918 after fixing LLD tests.
      
      Differential Revision: https://reviews.llvm.org/D28978
      
      llvm-svn: 293970
      b0a8ff71
    • Craig Topper's avatar
    • Matt Arsenault's avatar
      AMDGPU: Fold fneg into fminnum/fmaxnum · 2511c031
      Matt Arsenault authored
      llvm-svn: 293968
      2511c031
    • Bob Haarman's avatar
      refactor COFF linker to use new LTO API · cde5e5b6
      Bob Haarman authored
      Summary: The COFF linker previously implemented link-time optimization using an API which has now been marked as legacy. This change refactors the COFF linker to use the new LTO API, which is also used by the ELF linker.
      
      Reviewers: pcc, ruiu
      
      Reviewed By: pcc
      
      Subscribers: mgorny, mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D29059
      
      llvm-svn: 293967
      cde5e5b6
    • Bob Haarman's avatar
      added missing files for r293965 · fbc229dc
      Bob Haarman authored
      llvm-svn: 293966
      fbc229dc
    • Bob Haarman's avatar
      add the ability to call InitTargetOptionsFromCodeGenFlags from multiple objects · 35989d6b
      Bob Haarman authored
      Summary: llvm/CodeGen/CommandFlags.h a utility function InitTargetOptionsFromCodeGenFlags which is used to set target options from flags based on the command line. The command line flags are stored in globals defined in the same file, and including the file in multiple places causes the globals to be defined multiple times, leading to linker errors. This change adds a single place in lld where these globals are defined and exports only the utility function. This makes it possible to call InitTargetOptionsFromCodeGenFlags from multiple places in lld, which a follow-up change will do.
      
      Reviewers: davide, ruiu
      
      Reviewed By: davide, ruiu
      
      Subscribers: mgorny
      
      Differential Revision: https://reviews.llvm.org/D29058
      
      llvm-svn: 293965
      35989d6b
    • Konstantin Zhuravlyov's avatar
      803b141f
    • Rui Ueyama's avatar
      Update comments. · 6697ec29
      Rui Ueyama authored
      llvm-svn: 293963
      6697ec29
    • Matt Arsenault's avatar
      AMDGPU: Check if users of fneg can fold mods · a8fcfadf
      Matt Arsenault authored
      In multi-use cases this can save a few instructions.
      
      llvm-svn: 293962
      a8fcfadf
    • Mehdi Amini's avatar
      Revert "[ThinLTO] Add an auto-hide feature" · 21c89dc9
      Mehdi Amini authored
      This reverts commit r293918, one lld test does not pass.
      
      llvm-svn: 293961
      21c89dc9
    • Bob Haarman's avatar
      [lto] added getCOFFWeakExternalFallback · e4062dfd
      Bob Haarman authored
      Summary: This allows clients of the LTO API to determine the name of the fallback symbol for COFF weak externals.
      
      Reviewers: pcc
      
      Reviewed By: pcc
      
      Subscribers: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D29365
      
      llvm-svn: 293960
      e4062dfd
    • Marcos Pividori's avatar
      [sancov] Define delimiters for sanitizer coverage's binary section on Windows. · c1f8a824
      Marcos Pividori authored
      On Windows, the symbols "___stop___sancov_guards" and "___start___sancov_guards"
      are not defined automatically. So, we need to take a different approach.
      We define 3 sections: ".SCOV$A", ".SCOV$M" and ".SCOV$Z".
      
       Section ".SCOV$A" will only hold a variable ___start___sancov_guard.
       Section ".SCOV$M" will hold the main data.
       Section ".SCOV$Z" will only hold a variable ___stop___sancov_guards.
      
      When linking, they will be merged sorted by the characters after the $, so we
      can use the pointers of the variables ___[start|stop]___sancov_guard to know the
      actual range of addresses of that section.
      
      ___[start|stop]___sancov_guard should be defined only once per module. On
      Windows, we have 2 different cases:
      
      + When considering a shared runtime:
       All the modules, main executable and dlls, are linked to an auxiliary static
       library dynamic_runtime_thunk.lib. Because of that, we include the delimiters
       in `SancovDynamicRuntimeThunk`.
      
      + When considering a static runtime:
       The main executable in linked to the static runtime library.
       All the dlls are linked to an auxiliary static library dll_thunk.
       Because of that, we include the delimiter to both `SancovDllThunk` and
       `SANITIZER_LIBCDEP_SOURCES` (which is included in the static runtime lib).
      
      Differential Revision: https://reviews.llvm.org/D28435
      
      llvm-svn: 293959
      c1f8a824
    • Marcos Pividori's avatar
      [sanitizer] Use interception to access to strong definitions in the executable. · 2b9c44e2
      Marcos Pividori authored
      In Windows, when sanitizers are implemented as a shared library (DLL), users can
      redefine and export a new definition for weak functions, in the main executable,
      for example:
      
      extern "C" __declspec(dllexport)
      void __sanitizer_cov_trace_pc_guard(u32* guard) {
        // Different implementation provided by the client.
      }
      
      However, other dlls, will continue using the default implementation imported
      from the sanitizer dll. This is different in linux, where all the shared
      libraries will consider the strong definition.
      
      With the implementation in this diff, when the dll is initialized, it will check
      if the main executable exports the definition for some weak function (for
      example __sanitizer_cov_trace_pc_guard). If it finds that function, then it will
      override the function in the dll with that pointer. So, all the dlls with
      instrumentation that import __sanitizer_cov_trace_pc_guard__dll() from asan dll,
      will be using the function provided by the main executable.
      
      In other words, when the main executable exports a strong definition for a weak
      function, we ensure all the dlls use that implementation instead of the default
      weak implementation.
      
      The behavior is similar to linux. Now, every user that want to override a weak
      function, only has to define and export it. The same for Linux and Windows, and
      it will work fine. So, there is no difference on the user's side.
      
      All the sanitizers will include a file sanitizer_win_weak_interception.cc that
      register sanitizer's weak functions to be intercepted in the binary section WEAK
      
      When the sanitizer dll is initialized, it will execute weak_intercept_init()
      which will consider all the CB registered in the section WEAK. So, for all the
      weak functions registered, we will check if a strong definition is provided in
      the main executable.
      
      All the files sanitizer_win_weak_interception.cc are independent, so we do not
      need to include a specific list of sanitizers.
      Now, we include [asan|ubsan|sanitizer_coverage]_win_weak_interception.cc and
      sanitizer_win_weak_interception.cc in asan dll, so when it is initialized, it
      will consider all the weak functions from asan, ubsan and sanitizer coverage.
      
      After this diff, sanitizer coverage is fixed for MD on Windows. In particular
      libFuzzer can provide custom implementation for all sanitizer coverage's weak
      functions, and they will be considered by asan dll.
      
      Differential Revision: https://reviews.llvm.org/D29168
      
      llvm-svn: 293958
      2b9c44e2