1. Oct 11, 2018
    • Fangrui Song's avatar
      [MC][ELF] Fix section_mergeable_size.ll · f953ea5f
      Fangrui Song authored
      Some targets use %progbits instead of @progbits.
      
      Updating that check with a {{[@%]}}progbits regex to make those bots happy.
      
      llvm-svn: 344206
      f953ea5f
    • Thomas Lively's avatar
      [WebAssembly] Saturating float-to-int builtins · 07ce6df8
      Thomas Lively authored
      Summary: Depends on D53007 and D53004.
      
      Reviewers: aheejin, dschuff
      
      Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D53009
      
      llvm-svn: 344205
      07ce6df8
    • Thomas Lively's avatar
      [WebAssembly] Saturating float to int intrinsics · 2ebacb10
      Thomas Lively authored
      Summary:
      Although the saturating float to int instructions are already
      emitted from normal IR, the fpto{s,u}i instructions produce poison
      values if the argument cannot fit in the result type. These intrinsics
      are therefore necessary to get guaranteed defined saturating behavior.
      
      Reviewers: aheejin, dschuff
      
      Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53004
      
      llvm-svn: 344204
      2ebacb10
    • Kostya Serebryany's avatar
      [hwasan] simplify a test · 7b2b0185
      Kostya Serebryany authored
      llvm-svn: 344203
      7b2b0185
    • Saleem Abdulrasool's avatar
      llvm-c: Add C APIs to access DebugLoc info · 0d1cbcc3
      Saleem Abdulrasool authored
      Add thin shims to C interface to provide access to DebugLoc info for
      Instructions, GlobalVariables and Functions.  Patch by Josh Berdine!
      
      llvm-svn: 344202
      0d1cbcc3
    • Richard Smith's avatar
      Update documentation to indicate that profile remapping support is only · cee53ce4
      Richard Smith authored
      implemented for the new pass manager so far.
      
      llvm-svn: 344201
      cee53ce4
    • Richard Smith's avatar
      Add a flag to remap manglings when reading profile data information. · 6c676628
      Richard Smith authored
      This can be used to preserve profiling information across codebase
      changes that have widespread impact on mangled names, but across which
      most profiling data should still be usable. For example, when switching
      from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI,
      or even from a 32-bit to a 64-bit build.
      
      The user can provide a remapping file specifying parts of mangled names
      that should be treated as equivalent (eg, std::__1 should be treated as
      equivalent to std::__cxx11), and profile data will be treated as
      applying to a particular function if its name is equivalent to the name
      of a function in the profile data under the provided equivalences. See
      the documentation change for a description of how this is configured.
      
      Remapping is supported for both sample-based profiling and instruction
      profiling. We do not support remapping indirect branch target
      information, but all other profile data should be remapped
      appropriately.
      
      Support is only added for the new pass manager. If someone wants to also
      add support for this for the old pass manager, doing so should be
      straightforward.
      
      This is the LLVM side of Clang r344199.
      
      Reviewers: davidxl, tejohnson, dlj, erik.pilkington
      
      Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51249
      
      llvm-svn: 344200
      6c676628
    • Richard Smith's avatar
      Add a flag to remap manglings when reading profile data information. · 8654ae52
      Richard Smith authored
      This can be used to preserve profiling information across codebase
      changes that have widespread impact on mangled names, but across which
      most profiling data should still be usable. For example, when switching
      from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI,
      or even from a 32-bit to a 64-bit build.
      
      The user can provide a remapping file specifying parts of mangled names
      that should be treated as equivalent (eg, std::__1 should be treated as
      equivalent to std::__cxx11), and profile data will be treated as
      applying to a particular function if its name is equivalent to the name
      of a function in the profile data under the provided equivalences. See
      the documentation change for a description of how this is configured.
      
      Remapping is supported for both sample-based profiling and instruction
      profiling. We do not support remapping indirect branch target
      information, but all other profile data should be remapped
      appropriately.
      
      Support is only added for the new pass manager. If someone wants to also
      add support for this for the old pass manager, doing so should be
      straightforward.
      
      llvm-svn: 344199
      8654ae52
    • Warren Ristow's avatar
      [LTO] Account for overriding lib calls via the alias attribute · febfc4e8
      Warren Ristow authored
      Given a library call that is represented as an llvm intrinsic call, but
      later transformed to an actual call, if an overriding definition of that
      library routine is provided indirectly via an alias, prevent LTO from
      eliminating the definition.
      
      This is a fix for PR38547.
      
      Differential Revision: https://reviews.llvm.org/D52836
      
      llvm-svn: 344198
      febfc4e8
    • Nick Desaulniers's avatar
      [MC][ELF] compute entity size for explicit sections · 33531569
      Nick Desaulniers authored
      Summary:
      Global variables might declare themselves to be in explicit sections.
      Calculate the entity size always to prevent assembler warnings
      "entity size for SHF_MERGE not specified" when sections are to be
      marked merge-able.
      
      Fixes PR31828.
      
      Reviewers: rnk, echristo
      
      Reviewed By: rnk
      
      Subscribers: llvm-commits, pirama, srhines
      
      Differential Revision: https://reviews.llvm.org/D53056
      
      llvm-svn: 344197
      33531569
    • Rui Ueyama's avatar
      3c434481
    • Fangrui Song's avatar
      [ELF] Don't warn on undefined symbols if UnresolvedPolicy::Ignore is used · 11ca54f4
      Fangrui Song authored
      Summary:
      Add a condition UnresolvedPolicy::Ignore to elf::warnUnorderedSymbol to suppress Sym->isUndefined() warnings from both
      
      1) --symbol-ordering-file=
      2) .llvm.call-graph-profile
      
      If --unresolved-symbols=ignore-all is used,
      
        no "undefined symbol" error/warning is emitted. It makes sense to not warn unorderable symbols.
      
      Otherwise,
      
        If an executable is linked, the default policy UnresolvedPolicy::ErrorOrWarn will issue a "undefined symbol" error. The unorderable symbol warning is redundant.
      
        If a shared object is linked, it is possible that only part of object files are used and some symbols are left undefined. The warning is not very necessary.
          In particular for .llvm.call-graph-profile, when linking a shared object, a call graph profile may contain undefined symbols. This case generated a warning before but it will be suppressed by this patch.
      
      Reviewers: ruiu, davidxl, espindola
      
      Reviewed By: ruiu
      
      Subscribers: grimar, emaste, arichardson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53044
      
      llvm-svn: 344195
      11ca54f4
    • Aaron Puchert's avatar
      Use TEST_STD_VER instead of __cplusplus [NFC] · 81d381bd
      Aaron Puchert authored
      While __cplusplus was only used a few dozen times, TEST_STD_VAR is used
      more than 2000 times. So we replace the former by the latter for
      consistency in the tests. There should be no functional change.
      
      llvm-svn: 344194
      81d381bd
    • Kostya Serebryany's avatar
      [hwasan] when reporting a bug, print some very basic information about the... · d7c60e42
      Kostya Serebryany authored
      [hwasan] when reporting a bug, print some very basic information about the heap chunk (in addition to the more detailed info that we may fail to show)
      
      llvm-svn: 344193
      d7c60e42
    • Aaron Puchert's avatar
      Use std::scoped_lock only for C++17 and newer · 0e192395
      Aaron Puchert authored
      This fixes a test failure caused by D53049.
      
      llvm-svn: 344192
      0e192395
    • Louis Dionne's avatar
      [libcxxabi] Allow building with sanitizers enabled · 336db683
      Louis Dionne authored
      Summary:
      I copied the sanitizer-related logic in libcxx/lib/CMakeLists.txt. In
      the future, it would be great to avoid duplicating this logic in the
      compiler, libc++ and libc++abi.
      
      Reviewers: EricWF
      
      Subscribers: mgorny, christof, dexonsmith, libcxx-commits, davide
      
      Differential Revision: https://reviews.llvm.org/D53028
      
      llvm-svn: 344191
      336db683
    • Reid Kleckner's avatar
      [AST] Use -fvisibility value when ignoring -fv-i-h* inline static locals · a52d151f
      Reid Kleckner authored
      Summary:
      In r340386 we added code to give static locals in inline functions
      default visibility. Instead, we should use the "default" visibility
      passed on the command line, which could be hidden or protected, as GCC
      does.
      
      Some code bases use both -fvisibility=hidden and
      -fvisibility-inlines-hidden to hide inline functions of classes that are
      explicitly marked with default visibility.
      
      Fixes PR39236
      
      Reviewers: hans, thakis
      
      Subscribers: eraman, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53052
      
      llvm-svn: 344190
      a52d151f
    • Craig Topper's avatar
      [X86] Prevent non-temporal loads from folding into instructions by blocking... · b5421c49
      Craig Topper authored
      [X86] Prevent non-temporal loads from folding into instructions by blocking them in X86DAGToDAGISel::IsProfitableToFold rather than with a predicate.
      
      Remove tryFoldVecLoad since tryFoldLoad would call IsProfitableToFold and pick up the new check.
      
      This saves about 5K out of ~600K on the generated isel table.
      
      llvm-svn: 344189
      b5421c49
    • Chris Bieneman's avatar
      [CMake] NFC. Updating documentation on options · 7329be16
      Chris Bieneman authored
      The Ninja pool options are only supported with the Ninja generator and
      should be called out as such.
      
      llvm-svn: 344188
      7329be16
    • Richard Smith's avatar
      Support for remapping profile data when symbols change, for sample-based · 28436358
      Richard Smith authored
      profiling.
      
      Reviewers: davidxl, tejohnson, dlj, erik.pilkington
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51248
      
      llvm-svn: 344187
      28436358
    • George Burgess IV's avatar
      Replace most users of UnknownSize with LocationSize::unknown(); NFC · 6ef8002c
      George Burgess IV authored
      Moving away from UnknownSize is part of the effort to migrate us to
      LocationSizes (e.g. the cleanup promised in D44748).
      
      This doesn't entirely remove all of the uses of UnknownSize; some uses
      require tweaks to assume that UnknownSize isn't just some kind of int.
      This patch is intended to just be a trivial replacement for all places
      where LocationSize::unknown() will Just Work.
      
      llvm-svn: 344186
      6ef8002c
    • Armando Montanez's avatar
      Test commit: fix typo in comment · fdb732b5
      Armando Montanez authored
      llvm-svn: 344185
      fdb732b5
    • Richard Smith's avatar
      Support for remapping profile data when symbols change, for · ceed4eb1
      Richard Smith authored
      instrumentation-based profiling.
      
      Reviewers: davidxl, tejohnson, dlj, erik.pilkington
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51247
      
      llvm-svn: 344184
      ceed4eb1
    • James Y Knight's avatar
      llvm-ar: Darwin archive format fixes. · c0b28d55
      James Y Knight authored
      * Support writing the DARWIN64 symbol table format.
      
      * In darwin archives, emit a symbol table whenever requested, even
        when there are no members, as the apple linker will abort if given
        an archive without a symbol table.
      
      Added tests for same, and also simplified and moved the GNU 64-bit
      symbol table test into archive-symtab.test.
      
      llvm-svn: 344183
      c0b28d55
    • Roman Lebedev's avatar
      [NFC][X86][AArch64] extract-bits.ll: add tests with constants+storing results. · 62cd4306
      Roman Lebedev authored
      As noted in https://reviews.llvm.org/D53080#inline-467678,
      this *may* get pessimized by that diff.
      
      llvm-svn: 344182
      62cd4306
    • Sanjay Patel's avatar
      [InstCombine] reverse 'trunc X to <N x i1>' canonicalization; 2nd try · 05aadf88
      Sanjay Patel authored
      Re-trying r344082 because it unintentionally included extra diffs.
      
      Original commit message:
      icmp ne (and X, 1), 0 --> trunc X to N x i1
      
      Ideally, we'd do the same for scalars, but there will likely be
      regressions unless we add more trunc folds as we're doing here
      for vectors.
      
      The motivating vector case is from PR37549:
      https://bugs.llvm.org/show_bug.cgi?id=37549
      
      define <4 x float> @bitwise_select(<4 x float> %x, <4 x float> %y, <4 x float> %z, <4 x float> %w) {
      
        %c = fcmp ole <4 x float> %x, %y
        %s = sext <4 x i1> %c to <4 x i32>
        %s1 = shufflevector <4 x i32> %s, <4 x i32> undef, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
        %s2 = shufflevector <4 x i32> %s, <4 x i32> undef, <4 x i32> <i32 2, i32 2, i32 3, i32 3>
        %cond = or <4 x i32> %s1, %s2
        %condtr = trunc <4 x i32> %cond to <4 x i1>
        %r = select <4 x i1> %condtr, <4 x float> %z, <4 x float> %w
        ret <4 x float> %r
      
      }
      
      Here's a sampling of the vector codegen for that case using
      mask+icmp (current behavior) vs. trunc (with this patch):
      
      AVX before:
      
      vcmpleps        %xmm1, %xmm0, %xmm0
      vpermilps       $80, %xmm0, %xmm1 ## xmm1 = xmm0[0,0,1,1]
      vpermilps       $250, %xmm0, %xmm0 ## xmm0 = xmm0[2,2,3,3]
      vorps   %xmm0, %xmm1, %xmm0
      vandps  LCPI0_0(%rip), %xmm0, %xmm0
      vxorps  %xmm1, %xmm1, %xmm1
      vpcmpeqd        %xmm1, %xmm0, %xmm0
      vblendvps       %xmm0, %xmm3, %xmm2, %xmm0
      
      AVX after:
      
      vcmpleps        %xmm1, %xmm0, %xmm0
      vpermilps       $80, %xmm0, %xmm1 ## xmm1 = xmm0[0,0,1,1]
      vpermilps       $250, %xmm0, %xmm0 ## xmm0 = xmm0[2,2,3,3]
      vorps   %xmm0, %xmm1, %xmm0
      vblendvps       %xmm0, %xmm2, %xmm3, %xmm0
      
      AVX512f before:
      
      vcmpleps        %xmm1, %xmm0, %xmm0
      vpermilps       $80, %xmm0, %xmm1 ## xmm1 = xmm0[0,0,1,1]
      vpermilps       $250, %xmm0, %xmm0 ## xmm0 = xmm0[2,2,3,3]
      vorps   %xmm0, %xmm1, %xmm0
      vpbroadcastd    LCPI0_0(%rip), %xmm1 ## xmm1 = [1,1,1,1]
      vptestnmd       %zmm1, %zmm0, %k1
      vblendmps       %zmm3, %zmm2, %zmm0 {%k1}
      
      AVX512f after:
      
      vcmpleps        %xmm1, %xmm0, %xmm0
      vpermilps       $80, %xmm0, %xmm1 ## xmm1 = xmm0[0,0,1,1]
      vpermilps       $250, %xmm0, %xmm0 ## xmm0 = xmm0[2,2,3,3]
      vorps   %xmm0, %xmm1, %xmm0
      vpslld  $31, %xmm0, %xmm0
      vptestmd        %zmm0, %zmm0, %k1
      vblendmps       %zmm2, %zmm3, %zmm0 {%k1}
      
      AArch64 before:
      
      fcmge   v0.4s, v1.4s, v0.4s
      zip1    v1.4s, v0.4s, v0.4s
      zip2    v0.4s, v0.4s, v0.4s
      orr     v0.16b, v1.16b, v0.16b
      movi    v1.4s, #1
      and     v0.16b, v0.16b, v1.16b
      cmeq    v0.4s, v0.4s, #0
      bsl     v0.16b, v3.16b, v2.16b
      
      AArch64 after:
      
      fcmge   v0.4s, v1.4s, v0.4s
      zip1    v1.4s, v0.4s, v0.4s
      zip2    v0.4s, v0.4s, v0.4s
      orr     v0.16b, v1.16b, v0.16b
      bsl     v0.16b, v2.16b, v3.16b
      
      PowerPC-le before:
      
      xvcmpgesp 34, 35, 34
      vspltisw 0, 1
      vmrglw 3, 2, 2
      vmrghw 2, 2, 2
      xxlor 0, 35, 34
      xxlxor 35, 35, 35
      xxland 34, 0, 32
      vcmpequw 2, 2, 3
      xxsel 34, 36, 37, 34
      
      PowerPC-le after:
      
      xvcmpgesp 34, 35, 34
      vmrglw 3, 2, 2
      vmrghw 2, 2, 2
      xxlor 0, 35, 34
      xxsel 34, 37, 36, 0
      
      Differential Revision: https://reviews.llvm.org/D52747
      
      llvm-svn: 344181
      05aadf88
    • Thomas Lively's avatar
      [WebAssembly][NFC] Remove repetition of Defs = [ARGUMENTS] · eff0542c
      Thomas Lively authored
      Summary:
      By moving that line into the `I` multiclass.
      
      Reviewers: aheejin
      
      Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53093
      
      llvm-svn: 344180
      eff0542c
    • Roman Lebedev's avatar
      [X86] Move X86DAGToDAGISel::matchBEXTRFromAnd() into X86ISelLowering · 33d84c6d
      Roman Lebedev authored
      Summary:
      As discussed in [[ https://bugs.llvm.org/show_bug.cgi?id=38938 | PR38938 ]],
      we fail to emit `BEXTR` if the mask is shifted.
      We can't deal with that in `X86DAGToDAGISel` `before the address mode for the inc is selected`,
      and we can't really do it in the normal DAGCombine, because we don't have generic `ISD::BitFieldExtract` node,
      and if we simply turn the shifted mask into a normal mask + shift-left, it will be folded back.
      So it would seem X86ISelLowering is the place to handle this.
      
      This patch only moves the matchBEXTRFromAnd()
      from X86DAGToDAGISel to X86ISelLowering.
      It does not add support for the 'shifted mask' pattern.
      
      Reviewers: RKSimon, craig.topper, spatel
      
      Reviewed By: RKSimon
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52426
      
      llvm-svn: 344179
      33d84c6d
    • Sanjay Patel's avatar
      revert r344082: [InstCombine] reverse 'trunc X to <N x i1>' canonicalization · 58fc00d0
      Sanjay Patel authored
      This commit accidentally included the diffs from D53057.
      
      llvm-svn: 344178
      58fc00d0
    • Rui Ueyama's avatar
      Eliminate dependency to formatv(). NFC. · 9ae88c64
      Rui Ueyama authored
      llvm-svn: 344177
      9ae88c64
    • David Bolvansky's avatar
      [DwarfVerifier] Fixed -Wimplicit-fallthrough warning · 7e30c91d
      David Bolvansky authored
      Reviewers: JDevlieghere, RKSimon
      
      Reviewed By: JDevlieghere
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52963
      
      llvm-svn: 344176
      7e30c91d
    • Thomas Lively's avatar
      [WebAssembly][NFC] Use vnot patfrag to simplify v128.not · 103f0161
      Thomas Lively authored
      Reviewers: aheejin, dschuff
      
      Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53097
      
      llvm-svn: 344175
      103f0161
    • Kostya Serebryany's avatar
      [hwasan] print all threads in a bug report · a3933997
      Kostya Serebryany authored
      llvm-svn: 344174
      a3933997
    • Zachary Turner's avatar
      [SymbolFileNativePDB] Fix compilation errors with gcc. · 39965f5d
      Zachary Turner authored
      llvm-svn: 344173
      39965f5d
    • Renato Golin's avatar
      [LV] Add a new reduction pattern match · cb19c8e3
      Renato Golin authored
      Adding a new reduction pattern match for vectorizing code similar to TSVC s3111:
      
      for (int i = 0; i < N; i++)
        if (a[i] > b)
          sum += a[i];
      
      This patch adds support for fadd, fsub and fmull, as well as multiple
      branches and different (but compatible) instructions (ex. add+sub) in
      different branches.
      
      I have forwarded to trunk, added fsub and fmul functionality and
      additional tests, but the credit goes to Takahiro, who did most of the
      actual work.
      
      Differential Revision: https://reviews.llvm.org/D49168
      
      Patch by Takahiro Miyoshi <takahiro.miyoshi@linaro.org>.
      
      llvm-svn: 344172
      cb19c8e3
    • Francis Visoiu Mistrih's avatar
      Reland: [OptRemarks] Add library for parsing optimization remarks · 2e76cab4
      Francis Visoiu Mistrih authored
      Add a library that parses optimization remarks (currently YAML, so based
      on the YAMLParser).
      
      The goal is to be able to provide tools a remark parser that is not
      completely dependent on YAML, in case we decide to change the format
      later.
      
      It exposes a C API which takes a handler that is called with the remark
      structure.
      
      It adds a libLLVMOptRemark.a static library, and it's used in-tree by
      the llvm-opt-report tool (from which the parser has been mostly moved
      out).
      
      Differential Revision: https://reviews.llvm.org/D52776
      
      Fixed the tests by removing the usage of C++11 strings, which seems not
      to be supported by gcc 4.8.4 if they're used as a macro argument.
      
      llvm-svn: 344171
      2e76cab4
    • Kostya Serebryany's avatar
    • Aaron Smith's avatar
      [Windows] Fix a bug that causes lldb to freeze · e3037904
      Aaron Smith authored
      Summary:
      If the process exits before any initial stop then notify the debugger 
      of the error otherwise WaitForDebuggerConnection() will be blocked.
      An example of this issue is when a process fails to load a dependent DLL.
      
      In addition to the fix, remove a duplicate call to FreeProcessHandles() in 
      DebuggerThread::HandleExitProcessEvent() and use decimal format 
      for all thread IDs.
      
      Reviewers: rnk, zturner, aleksandr.urakov
      
      Reviewed By: zturner
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D53090
      
      llvm-svn: 344168
      e3037904
    • Eric Fiselier's avatar
      Add test macros for always_inline and noinline · fca28db9
      Eric Fiselier authored
      llvm-svn: 344167
      fca28db9
    • Scott Linder's avatar
      [Support] Remove redundant qualifiers in YAMLTraits (NFC) · ad115b78
      Scott Linder authored
      llvm-svn: 344166
      ad115b78