1. Apr 13, 2019
    • Nikita Popov's avatar
      [CVP] Set NSW/NUW flags when simplifying with.overflow · 00a0d5d1
      Nikita Popov authored
      When CVP determines that a with.overflow intrinsic cannot overflow,
      it currently inserts a simple add/sub. As we already determined that
      there can be no overflow, we should add the appropriate NUW/NSW flag.
      
      Differential Revision: https://reviews.llvm.org/D60585
      
      llvm-svn: 358298
      00a0d5d1
    • Nikita Popov's avatar
      [KnownBits] Add computeForAddCarry() · 7671fc71
      Nikita Popov authored
      This is for D60460. computeForAddSub() essentially already supports
      carries because it has to deal with subtractions. This revision
      extracts a lower-level computeForAddCarry() function, which allows
      computing the known bits for add (carry known zero), sub (carry known
      one) and addcarry (carry unknown).
      
      As we don't seem to have any yet, I've added a unit test file for
      KnownBits and exhaustive tests for the new computeForAddCarry()
      functionality, as well the existing computeForAddSub() function.
      
      Differential Revision: https://reviews.llvm.org/D60522
      
      llvm-svn: 358297
      7671fc71
    • Philip Reames's avatar
    • Lang Hames's avatar
      Simplify decoupling between RuntimeDyld/RuntimeDyldChecker, add 'got_addr' util. · c7c1f215
      Lang Hames authored
      This patch reduces the number of functions in the interface between RuntimeDyld
      and RuntimeDyldChecker by combining "GetXAddress" and "GetXContent" functions
      into "GetXInfo" functions that return a struct describing both the address and
      content. The GetStubOffset function is also replaced with a pair of utilities,
      GetStubInfo and GetGOTInfo, that fit the new scheme. For RuntimeDyld both of
      these functions will return the same result, but for the new JITLink linker
      (https://reviews.llvm.org/D58704) these will provide the addresses of PLT stubs
      and GOT entries respectively.
      
      For JITLink's use, a 'got_addr' utility has been added to the rtdyld-check
      language, and the syntax of 'got_addr' and 'stub_addr' has been changed: both
      functions now take two arguments, a 'stub container name' and a target symbol
      name. For llvm-rtdyld/RuntimeDyld the stub container name is the object file
      name and section name, separated by a slash. E.g.:
      
      rtdyld-check: *{8}(stub_addr(foo.o/__text, y)) = y
      
      For the upcoming llvm-jitlink utility, which creates stubs on a per-file basis
      rather than a per-section basis, the container name is just the file name. E.g.:
      
      jitlink-check: *{8}(got_addr(foo.o, y)) = y
      llvm-svn: 358295
      c7c1f215
    • Louis Dionne's avatar
      [libc++] Run back-deployment CI against previously-released libc++abi dylibs · e4d6ac5d
      Louis Dionne authored
      We used to do it against the current system's libc++abi, which is not as
      good as doing it with the libc++abi that matches the libc++ we're running
      against.
      
      Note that I made sure we were indeed picking up the provided libc++abi
      by replacing it by something that doesn't work and watching it burn.
      
      llvm-svn: 358294
      e4d6ac5d
    • Kadir Cetinkaya's avatar
      [clangd] Fix an overflow inside a test · 5757bfbd
      Kadir Cetinkaya authored
      llvm-svn: 358293
      5757bfbd
    • Brendon Cahoon's avatar
      [Hexagon] Fix reuse bug in Vector Loop Carried Reuse pass · 4df216cd
      Brendon Cahoon authored
      The Hexagon Vector Loop Carried Reuse pass was allowing reuse between
      two shufflevectors with different masks. The reason is that the masks
      are not instruction objects, so the code that checks each operand
      just skipped over the operands.
      
      This patch fixes the bug by checking if the operands are the same
      when they are not instruction objects. If the objects are not the
      same, then the code assumes that reuse cannot occur.
      
      Differential Revision: https://reviews.llvm.org/D60019
      
      llvm-svn: 358292
      4df216cd
    • Sanjay Patel's avatar
      [DAGCombiner] narrow shuffle of concatenated vectors · 5e4ad39a
      Sanjay Patel authored
      // shuffle (concat X, undef), (concat Y, undef), Mask -->
      // concat (shuffle X, Y, Mask0), (shuffle X, Y, Mask1)
      
      The ARM changes with 'vtrn' and narrowed 'vuzp' are improvements.
      
      The x86 changes look neutral or better. There's one test with an
      extra instruction, but that could be reversed for a subtarget with
      the right attributes. But by default, we want to avoid the 256-bit
      op when possible (in my motivating benchmark, a handful of ymm ops
      sprinkled into a sequence of xmm ops are triggering frequency
      throttling on Haswell resulting in significantly worse perf).
      
      Differential Revision: https://reviews.llvm.org/D60545
      
      llvm-svn: 358291
      5e4ad39a
    • Yaxun Liu's avatar
      [HIP] Use -mlink-builtin-bitcode to link device library · 7bd8c37b
      Yaxun Liu authored
      Use -mlink-builtin-bitcode instead of llvm-link to link
      device library so that device library bitcode and user
      device code can be compiled in a consistent way.
      
      This is the same approach used by CUDA and OpenMP.
      
      Differential Revision: https://reviews.llvm.org/D60513
      
      llvm-svn: 358290
      7bd8c37b
  2. Apr 12, 2019
    • Zachary Turner's avatar
      [PDB Docs] Add some prose describing public and global symbols. · e1bc9758
      Zachary Turner authored
      llvm-svn: 358289
      e1bc9758
    • Bruno Ricci's avatar
      [AST][NFC] Add const children() accessors to all AST nodes · 06186509
      Bruno Ricci authored
      Systematically add the const-qualified version of children()
      to all statement/expression nodes. Previously the const-qualified
      variant was only defined for some nodes. NFC.
      
      Patch by: Nicolas Manichon
      
      Differential Revision: https://reviews.llvm.org/D60029
      
      Reviewed By: riccibruno
      
      llvm-svn: 358288
      06186509
    • Hiroshi Yamauchi's avatar
      Add options for MaxLoadsPerMemcmp(OptSize). · c27ff0d3
      Hiroshi Yamauchi authored
      Reviewers: davidxl
      
      Reviewed By: davidxl
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60587
      
      llvm-svn: 358287
      c27ff0d3
    • Simon Pilgrim's avatar
      [X86][SSE] Recognise vXi1 boolean anyof/allof reduction patterns · 6c8f4ada
      Simon Pilgrim authored
      Currently combineHorizontalPredicateResult only handles anyof/allof reduction patterns of legal types, which can be tricky to match as type legalization of bools can introduce bitcasts/truncs/extensions.
      
      This patch extends combineHorizontalPredicateResult to recognise vXi1 bool reductions as well and uses the existing combineBitcastvxi1 helper to create the MOVMSK necessary to then compare the signmask result.
      
      This ensures the accuracy of the reduction costs added in D60403 which assume the MOVMSK generation.
      
      Differential Revision: https://reviews.llvm.org/D60610
      
      llvm-svn: 358286
      6c8f4ada
    • Pierre Gousseau's avatar
      [asan] Add gcc 8's driver option -fsanitize=pointer-compare and -fsanitize=pointer-substract. · 1e39fc1f
      Pierre Gousseau authored
      Disabled by default as this is still an experimental feature.
      
      Reviewed By: thakis
      
      Differential Revision: https://reviews.llvm.org/D59221
      
      llvm-svn: 358285
      1e39fc1f
    • Pavel Labath's avatar
      Fix compiler warning introduced by r358261 · ce0a88a5
      Pavel Labath authored
      Add a virtual destructor to the class with virtual methods.
      
      llvm-svn: 358284
      ce0a88a5
    • Bruno Ricci's avatar
      [AST] Forbid copy/move of statements/types · f6c7692d
      Bruno Ricci authored
      Statements, expressions and types are not supposed to be copied/moved,
      and trying to do so is only going to result in tears. Someone tripped
      on this a few days ago on the mailing list. NFC.
      
      Differential Revision: https://reviews.llvm.org/D60123
      
      Reviewed By: aaron.ballman
      
      llvm-svn: 358283
      f6c7692d
    • Haojian Wu's avatar
      [clangd] Enable clang-tidy by default. · 64608833
      Haojian Wu authored
      Summary:
      We have turned on the flag internally for a while, and we don't receive complains.
      Should be good to turn it on now.
      
      If the projects doesn't have .clang-tidy files, no clang-tidy check will
      be run.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D60560
      
      llvm-svn: 358282
      64608833
    • Hans Wennborg's avatar
      Revert r358268 "[DebugInfo] DW_OP_deref_size in PrologEpilogInserter." · 4e6b8579
      Hans Wennborg authored
      It causes clang to crash while building Chromium. See https://crbug.com/952230
      for reproducer.
      
      > The PrologEpilogInserter need to insert a DW_OP_deref_size before
      > prepending a memory location expression to an already implicit
      > expression to avoid having the existing expression act on the memory
      > address instead of the value behind it.
      >
      > The reason for using DW_OP_deref_size and not plain DW_OP_deref is that
      > big-endian targets need to read the right size as simply truncating a
      > larger read would yield the wrong result (LSB bytes are not at the lower
      > address).
      >
      > Differential Revision: https://reviews.llvm.org/D59687
      
      llvm-svn: 358281
      4e6b8579
    • Eugene Leviant's avatar
      [llvm-objcopy] Fill .symtab_shndx section correctly · 88089fed
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D60555
      
      llvm-svn: 358278
      88089fed
    • Fangrui Song's avatar
      Use llvm::upper_bound. NFC · fb79ff6a
      Fangrui Song authored
      llvm-svn: 358277
      fb79ff6a
    • Diogo N. Sampaio's avatar
      [Aarch64] Add v8.2-a half precision element extract intrinsics · eb312ddf
      Diogo N. Sampaio authored
      Summary:
      Implements the intrinsics define on the ACLE to extract half precision fp scalar elements from float16x4_t and float16x8_t vector types.
      a.k.a:
      vduph_lane_f16
      vduph_laneq_f16
      
      Reviewers: pablooliveira, olista01, LukeGeeson, DavidSpickett
      
      Reviewed By: DavidSpickett
      
      Subscribers: DavidSpickett, javed.absar, kristof.beyls, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D60272
      
      llvm-svn: 358276
      eb312ddf
    • Krasimir Georgiev's avatar
      [clang-format] Use SpacesBeforeTrailingComments for "option" directive · 69150467
      Krasimir Georgiev authored
      Summary:
      AnnotatingParser::next() is needed to implicitly set TT_BlockComment
      versus TT_LineComment.  On most other paths through
      AnnotatingParser::parseLine(), all tokens are consumed to achieve that.
      This change updates one place where this wasn't done.
      
      Contributed by @dchai!
      
      Reviewers: krasimir
      
      Reviewed By: krasimir
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D60541
      
      llvm-svn: 358275
      69150467
    • Kadir Cetinkaya's avatar
      [clangd] Show template argument list in workspacesymbols and documentsymbols responses · 4f789e1b
      Kadir Cetinkaya authored
      Summary:
      Last part of re-landing rC356541. Puts TemplateArgumentsList into
      responses of the above mentioned two requests.
      
      Reviewers: ioeric, ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59641
      
      llvm-svn: 358274
      4f789e1b
    • Kadir Cetinkaya's avatar
      [clangd] Add TemplateArgumentList into Symbol · 79063de9
      Kadir Cetinkaya authored
      Summary:
      Part of re-landing rC356541 with D59599. Changes the way we store
      template arguments, previous patch was storing them inside Name field of Symbol.
      Which was violating the assumption:
      ```Symbol::Scope+Symbol::Name == clang::clangd::printQualifiedName```
      which was made in multiple places inside codebase. This patch instead moves
      those arguments into their own field. Currently the field is meant to be
      human-readable, can be made structured if need be.
      
      Reviewers: ioeric, ilya-biryukov, gribozavr
      
      Subscribers: MaskRay, jkorous, arphaman, jdoerfert, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59640
      
      llvm-svn: 358273
      79063de9
    • Kadir Cetinkaya's avatar
      [clangd] Print template arguments helper · a80a5228
      Kadir Cetinkaya authored
      Summary:
      Prepares ground for printing template arguments as written in the
      source code, part of re-landing rC356541 with D59599 applied.
      
      Reviewers: ioeric, ilya-biryukov
      
      Subscribers: mgorny, MaskRay, jkorous, arphaman, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59639
      
      llvm-svn: 358272
      a80a5228
    • Kang Zhang's avatar
      [PowerPC] Add initialization for some ppc passes · 2446f843
      Kang Zhang authored
      Summary:
      
      Some llc debug options need pass-name as the parameters.
      But if we use the pass-name ppc-early-ret, we will get below error:
      llc test.ll -stop-after ppc-early-ret
      LLVM ERROR: "ppc-early-ret" pass is not registered.
      Below pass-names have the pass is not registered error:
      ppc-ctr-loops
      ppc-ctr-loops-verify
      ppc-loop-preinc-prep
      ppc-toc-reg-deps
      ppc-vsx-copy
      ppc-early-ret
      ppc-vsx-fma-mutate
      ppc-vsx-swaps
      ppc-reduce-cr-ops
      ppc-qpx-load-splat
      ppc-branch-coalescing
      ppc-branch-select
      
      Reviewed By: jsji
      
      Differential Revision: https://reviews.llvm.org/D60248
      
      llvm-svn: 358271
      2446f843
    • Jeremy Morse's avatar
      [DebugInfo] Fix pr41175 Dead Store Elimination missing debug loc · 32afe6a1
      Jeremy Morse authored
      Bug: https://bugs.llvm.org/show_bug.cgi?id=41175
      
      In the bug test case the DSE pass is shortening the range of memory that a
      memset is working on. A getelementptr is generated so that the new
      starting address can be passed to memset. This instruction was not given
      a DebugLoc.
      
      To fix the bug, copy the DebugLoc from the memset instruction.
      
      Patch by Orlando Cazalet-Hyams!
      
      Differential Revision: https://reviews.llvm.org/D60556
      
      llvm-svn: 358270
      32afe6a1
    • Markus Lavin's avatar
      [DebugInfo] DW_OP_deref_size in PrologEpilogInserter. · 138c7612
      Markus Lavin authored
      The PrologEpilogInserter need to insert a DW_OP_deref_size before
      prepending a memory location expression to an already implicit
      expression to avoid having the existing expression act on the memory
      address instead of the value behind it.
      
      The reason for using DW_OP_deref_size and not plain DW_OP_deref is that
      big-endian targets need to read the right size as simply truncating a
      larger read would yield the wrong result (LSB bytes are not at the lower
      address).
      
      Differential Revision: https://reviews.llvm.org/D59687
      
      llvm-svn: 358268
      138c7612
    • Hans Wennborg's avatar
      Fix missing arguments in tutorial · 9b795b3c
      Hans Wennborg authored
      In tutorial "8. Kaleidoscope: Compiling to Object Code" a call to
      TargetMachine->addPassesToEmitFile(pass, dest, FileType) is missing
      nullptr as its 3rd value.
      
      Patch by Sajjad Heydari!
      
      Differential revision: https://reviews.llvm.org/D60369
      
      llvm-svn: 358267
      9b795b3c
    • Pavel Labath's avatar
      Make TestPrintStackTraces deterministic · 539b7e65
      Pavel Labath authored
      This test contained an incredibly complicated inferior, but in reality,
      all it was testing was that we can backtrace up to main and see main's
      arguments.
      
      However, the way this was implemented (setting a breakpoint on a
      separate thread) meant that each time the test would run, it would stop
      in a different location on the main thread. Most of the time this
      location would be deep in some libc function, which meant that the
      success of this test depended on our ability to backtrace out of a
      random function of the c library that the user happens to have
      installed.
      
      This makes the test unpredictable. Backtracing out of a libc function is
      an important functionality, but this is not the way to test it. Often it
      is not even our fault that we cannot backtrace out because the C library
      contains a lot of assembly routines that may not have correct unwind
      info associated with them.
      
      For this reason the test has accumulated numerous @expectedFail/Flaky
      decorators. In this patch, I replace the inferior with one that does not
      depend on libc functions. Instead I create a couple of stack frames of
      user code, and have the test verify that. I also simplify the test by
      using lldbutil.run_to_source_breakpoint.
      
      llvm-svn: 358266
      539b7e65
    • Aaron Smith's avatar
      [lldb-server] Update tests to use std::thread/mutex for all platforms · 4b0931bc
      Aaron Smith authored
      Summary:
      Some cleanup suggested when bringing up lldb-server on Windows. 
      Thanks to Hui Huang for the patch.
      
      Reviewers: zturner, labath, jfb, Hui
      
      Reviewed By: labath
      
      Subscribers: clayborg, dexonsmith, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D60496
      
      llvm-svn: 358265
      4b0931bc
    • Eric Christopher's avatar
      Move getNumFrameInfos and getDwarfFrameInfos out of line and remove · b4144877
      Eric Christopher authored
      the MCDwarf.h include.
      
      This removes 50 transitive dependencies for a modification of
      MCDwarf.h in a build of llc for a pair of out of line functions
      and reduces the build overhead of 'touch MCDwarf.h" by 15% without
      impacting test time of check-llvm.
      
      llvm-svn: 358264
      b4144877
    • Eric Christopher's avatar
      Add explicit dependencies on MCSection.h and MCDwarf.h to the .cpp · 6b06c6a5
      Eric Christopher authored
      files rather than rely on transitive includes from MCStreamer.h.
      
      llvm-svn: 358263
      6b06c6a5
    • Fangrui Song's avatar
      d5c40424
    • Pavel Labath's avatar
      PDBFPO: Improvements to the AST visitor · 85ce053d
      Pavel Labath authored
      Summary:
      This patch attempts to solve two issues made this code hard to follow
      for me.
      
      The first issue was that a lot of what these visitors do is mutate the
      AST. The visitor pattern is not particularly good for that because by
      the time you have performed the dynamic type dispatch, it's too late to
      go back to the parent node, and change its pointer. The previous code
      dealt with that relatively elegantly, but it still meant that one had to
      perform manual type checks, which is what the visitor pattern is
      supposed to avoid.
      
      The second issue was not being able to return values from the Visit
      functions, which meant that one had to store function results in member
      variables (a common problem with visitor patterns).
      
      Here, I solve both problems by making the visitor use a type switch
      instead of going through double dispatch on the visited object.  This
      allows one to parameterize the visitor based on the return type and pass
      function results as function results. The mutation is fascilitated by
      having each Visit function take two arguments -- a reference to the
      object itself (with the correct dynamic type), and a reference to the
      parent's pointer to this object.
      
      Although this wasn't my explicit goal here, the fact that we're not
      using virtual dispatch anymore  allows us to make the AST nodes
      trivially destructible, which is a good thing, since we were not
      destroying them anyway.
      
      Reviewers: aleksandr.urakov, amccarth
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D60410
      
      llvm-svn: 358261
      85ce053d
    • Eric Christopher's avatar
      Revert "[PowerPC] Add initialization for some ppc passes" · b6926bdc
      Eric Christopher authored
      This reverts commit 6f8f98ce as it
      is breaking nearly every bot.
      
      llvm-svn: 358260
      b6926bdc
    • Xing GUO's avatar
      [llvm-readobj] Change variables' name to match LLVM-style. NFC. · e855e2eb
      Xing GUO authored
      llvm-svn: 358259
      e855e2eb
    • Eric Christopher's avatar
      Move addInitialFrameState out of line and remove the MCDwarf.h include. · 886a7b3b
      Eric Christopher authored
      This removes 50 transitive dependencies for a modification of
      MCDwarf.h in a build of llc for a single out of line function
      and reduces the build overhead by 20% without impacting test
      time of check-llvm.
      
      llvm-svn: 358258
      886a7b3b
    • Craig Topper's avatar
      [TargetLowering][X86] Teach SimplifyDemandedBits to use ShrinkDemandedOp on ISD::SHL nodes. · 3b1239d2
      Craig Topper authored
      If the upper bits of the SHL result aren't used, we might be able to use a narrower shift. For example, on X86 this can turn a 64-bit into 32-bit enabling a smaller encoding.
      
      Differential Revision: https://reviews.llvm.org/D60358
      
      llvm-svn: 358257
      3b1239d2
    • Kang Zhang's avatar
      [PowerPC] Add initialization for some ppc passes · 6f8f98ce
      Kang Zhang authored
      Summary:
      
      Some llc debug options need pass-name as the parameters.
      But if we use the pass-name ppc-early-ret, we will get below error:
      llc test.ll -stop-after ppc-early-ret
      LLVM ERROR: "ppc-early-ret" pass is not registered.
      Below pass-names have the pass is not registered error:
      ppc-ctr-loops
      ppc-ctr-loops-verify
      ppc-loop-preinc-prep
      ppc-toc-reg-deps
      ppc-vsx-copy
      ppc-early-ret
      ppc-vsx-fma-mutate
      ppc-vsx-swaps
      ppc-reduce-cr-ops
      ppc-qpx-load-splat
      ppc-branch-coalescing
      ppc-branch-select
      
      Reviewed By: jsji
      
      Differential Revision: https://reviews.llvm.org/D60248
      
      llvm-svn: 358256
      6f8f98ce