Skip to content
  1. Apr 17, 2019
    • Eric Christopher's avatar
      Revert "Temporarily Revert "Add basic loop fusion pass."" · cee313d2
      Eric Christopher authored
      The reversion apparently deleted the test/Transforms directory.
      
      Will be re-reverting again.
      
      llvm-svn: 358552
      cee313d2
    • Eric Fiselier's avatar
      Fix visibility for coroutine types on Windows · c3d6a929
      Eric Fiselier authored
      llvm-svn: 358551
      c3d6a929
    • Aaron Smith's avatar
      Clear the output string passed to GetHostName() · b8ec7eee
      Aaron Smith authored
      LLVM's wchar to UTF8 conversion routine expects an empty string to store the output.
      GetHostName() on Windows is sometimes called with a non-empty string which triggers
      an assert. The simple fix is to clear the output string before the conversion.
      
      llvm-svn: 358550
      b8ec7eee
    • Peter Collingbourne's avatar
      clangd: Change Windows.h to windows.h. · 990514ce
      Peter Collingbourne authored
      This makes the file more cross compilation friendly.
      
      llvm-svn: 358549
      990514ce
    • Eric Christopher's avatar
      Remove the run-slp-after-loop-vectorization option. · 0ebbf72a
      Eric Christopher authored
      It's been on by default for 4 years and cleans up the pass
      hierarchy.
      
      llvm-svn: 358548
      0ebbf72a
    • Rui Ueyama's avatar
      Fix a crash bug caused by a nested call of parallelForEach. · 5081e41b
      Rui Ueyama authored
      parallelForEach is not reentrant. We use parallelForEach to call
      each section's writeTo(), so calling the same function within writeTo()
      is not safe.
      
      Fixes https://bugs.llvm.org/show_bug.cgi?id=41508
      
      Differential Revision: https://reviews.llvm.org/D60757
      
      llvm-svn: 358547
      5081e41b
    • Eric Christopher's avatar
      Temporarily Revert "Add basic loop fusion pass." · a8634351
      Eric Christopher authored
      As it's causing some bot failures (and per request from kbarton).
      
      This reverts commit r358543/ab70da07.
      
      llvm-svn: 358546
      a8634351
    • Rui Ueyama's avatar
      lld: Fix initial Mach-O load commands size calculation omitting LC_FUNCTION_STARTS · 7f8ca6e3
      Rui Ueyama authored
      Patch by Nicholas Allegra.
      
      The Mach-O writer calculates the size of load commands multiple times.
      
      First, Util::assignAddressesToSections() (in MachONormalizedFileFromAtoms.cpp)
      calculates the size using headerAndLoadCommandsSize() (in
      MachONormalizedFileBinaryWriter.cpp), which creates a temporary
      MachOFileLayout for the NormalizedFile, only to retrieve its
      headerAndLoadCommandsSize.  Later, writeBinary() (in
      MachONormalizedFileBinaryWriter.cpp) creates a new layout and uses the offsets
      from that layout to actually write out everything in the NormalizedFile.
      
      But the NormalizedFile changes between the first computation and the second.
      When Util::assignAddressesToSections is called, file.functionStarts is always
      empty because Util::addFunctionStarts has not yet been called. Yet
      MachOFileLayout decides whether to include a LC_FUNCTION_STARTS command based
      on whether file.functionStarts is nonempty. Therefore, the initial computation
      always omits it.
      
      Because padding for the __TEXT segment (to make its size a multiple of the
      page size) is added between the load commands and the first section, LLD still
      generates a valid binary as long as the amount of padding happens to be large
      enough to fit LC_FUNCTION_STARTS command, which it usually is.
      
      However, it's easy to reproduce the issue by adding a section of a precise
      size. Given foo.c:
      
        __attribute__((section("__TEXT,__foo")))
        char foo[0xd78] = {0};
      
      Run:
      
        clang -dynamiclib -o foo.dylib foo.c -fuse-ld=lld -install_name
        /usr/lib/foo.dylib
        otool -lvv foo.dylib
      
      This should produce:
      
        truncated or malformed object (offset field of section 1 in LC_SEGMENT_64
        command 0 not past the headers of the file)
      
      This commit:
      
       - Changes MachOFileLayout to always assume LC_FUNCTION_STARTS is present for
         the initial computation, as long as generating LC_FUNCTION_STARTS is
         enabled. It would be slightly better to check whether there are actually
         any functions, since no LC_FUNCTION_STARTS will be generated if not, but it
         doesn't cause a problem if the initial computation is too high.
      
       - Adds a test.
      
       - Adds an assert in MachOFileLayout::writeSectionContent() that we are not
         writing section content into the load commands region (which would happen
         if the offset was calculated too low due to the initial load commands size
         calculation being too low).  Adds an assert in
         MachOFileLayout::writeLoadCommands to validate a similar situation where
         two size-of-load-commands computations are expected to be equivalent.
      
      llvm-svn: 358545
      7f8ca6e3
    • Fangrui Song's avatar
      [Driver] Simplify -g level computation and its interaction with -gsplit-dwarf · e3576b0a
      Fangrui Song authored
      Summary:
      When -gsplit-dwarf is used together with other -g options, in most cases
      the computed debug info level is decided by the last -g option, with one
      special case (see below). This patch drops that special case and thus
      makes it easy to reason about:
      
      // If a lower debug level -g comes after -gsplit-dwarf, in some cases
      // -gsplit-dwarf is cancelled.
      -gsplit-dwarf -g0 => 0
      -gsplit-dwarf -gline-directives-only => DebugDirectivesOnly
      -gsplit-dwarf -gmlt -fsplit-dwarf-inlining => 1
      -gsplit-dwarf -gmlt -fno-split-dwarf-inlining => 1 + split
      
      // If -gsplit-dwarf comes after -g options, with this patch, the net
      // effect is 2 + split for all combinations
      -g0 -gsplit-dwarf => 2 + split
      -gline-directives-only -gsplit-dwarf => 2 + split
      -gmlt -gsplit-dwarf -fsplit-dwarf-inlining => 2 + split
      -gmlt -gsplit-dwarf -fno-split-dwarf-inlining => 1 + split (before) 2 + split (after)
      
      The last case has been changed. In general, if the user intends to lower
      debug info level, place that -g option after -gsplit-dwarf.
      
      Some context:
      
      In gcc, the last of -gsplit-dwarf -g0 -g1 -g2 -g3 -ggdb[0-3] -gdwarf-*
      ... decides the debug info level (-gsplit-dwarf -gdwarf-* have level 2).
      It is a bit unfortunate that -gsplit-dwarf -gdwarf-* ... participate in
      the level computation but that is the status quo.
      
      Reviewers: dblaikie, echristo, probinson
      
      Reviewed By: dblaikie, probinson
      
      Subscribers: probinson, aprantl, jdoerfert, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59923
      
      llvm-svn: 358544
      e3576b0a
    • Kit Barton's avatar
      Add basic loop fusion pass. · ab70da07
      Kit Barton authored
      This patch adds a basic loop fusion pass. It will fuse loops that conform to the
      following 4 conditions:
        1. Adjacent (no code between them)
        2. Control flow equivalent (if one loop executes, the other loop executes)
        3. Identical bounds (both loops iterate the same number of iterations)
        4. No negative distance dependencies between the loop bodies.
      
      The pass does not make any changes to the IR to create opportunities for fusion.
      Instead, it checks if the necessary conditions are met and if so it fuses two
      loops together.
      
      The pass has not been added to the pass pipeline yet, and thus is not enabled by
      default. It can be run stand alone using the -loop-fusion option.
      
      Phabricator: https://reviews.llvm.org/D55851
      llvm-svn: 358543
      ab70da07
    • Yi Kong's avatar
      [builtins] Add __cmpsf2 for ARM version of comparesf2 · 64c32362
      Yi Kong authored
      The generic version of comparesf2 defines __cmpsf2 alias for libgcc
      compatibility, but the ARM overlay is missing the alias.
      
      Differential Revision: https://reviews.llvm.org/D60805
      
      llvm-svn: 358542
      64c32362
    • Marshall Clow's avatar
      Add tests for stability to list::sort and forward_list::sort. Thanks to... · 83465c79
      Marshall Clow authored
      Add tests for stability to list::sort and forward_list::sort. Thanks to Jonathan Wakely for the notice
      
      llvm-svn: 358541
      83465c79
    • Sam McCall's avatar
      [ADT] llvm::bsearch, binary search for mere mortals · 6b44291b
      Sam McCall authored
      Summary:
      Add to STLExtras a binary search function with a simple mental model:
      You provide a range and a predicate which is true above a certain point.
      bsearch() tells you that point.
      Overloads are provided for integers, iterators, and containers.
      
      This is more suitable than std:: alternatives in many cases:
       - std::binary_search only indicates presence/absence
       - upper_bound/lower_bound give you the opportunity to pick the wrong one
       - all of the options have confusing names and definitions when your predicate
         doesn't have simple "less than" semantics
       - all of the options require iterators
       - we plumb around a useless `value` parameter that should be a lambda capture
      
      The API is inspired by Go's standard library, but we add an extra parameter as
      well as some overloads and templates to show how clever C++ is.
      
      Reviewers: ilya-biryukov, gribozavr
      
      Subscribers: dexonsmith, kristina, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60779
      
      llvm-svn: 358540
      6b44291b
    • Sanjay Patel's avatar
      [x86] adjust LEA tests for better coverage; NFC · d5bc5ca3
      Sanjay Patel authored
      The scale can 1, 2, or 3.
      
      llvm-svn: 358539
      d5bc5ca3
    • Leonard Chan's avatar
      [NFC] Remove unused function (Sema::pushExternalDeclIntoScope) · 5c09f8d6
      Leonard Chan authored
      llvm-svn: 358538
      5c09f8d6
    • Douglas Yung's avatar
      Modify test to use -S instead of -c so that it works when an external... · 1925f418
      Douglas Yung authored
      Modify test to use -S instead of -c so that it works when an external assembler is used that is not present.
      
      llvm-svn: 358537
      1925f418
    • Peter Collingbourne's avatar
      ELF: Move build id computation to Writer. NFCI. · 97d25e06
      Peter Collingbourne authored
      With partitions, each partition should have the same build id. This means
      that the build id needs to be only computed once, otherwise we will end up
      with different build ids in each partition as a result of the file contents
      changing. This change moves the computation of the build id into Writer so
      that it only happens once.
      
      Differential Revision: https://reviews.llvm.org/D60342
      
      llvm-svn: 358536
      97d25e06
    • Mitch Phillips's avatar
      [HWASan] Fixed slow DWARF unwinding. · 8f9d95d9
      Mitch Phillips authored
      Summary: CFA was setup incorrectly, as there is an 8-byte gap at the top of the stack for SP 16-byte alignment purposes.
      
      Reviewers: eugenis
      
      Reviewed By: eugenis
      
      Subscribers: kubamracek, javed.absar, #sanitizers, llvm-commits, pcc
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D60798
      
      llvm-svn: 358535
      8f9d95d9
    • Marshall Clow's avatar
      Fix list/forward_list implementations of remove_if and unique to deal with... · 896b0c7b
      Marshall Clow authored
      Fix list/forward_list implementations of remove_if and unique to deal with predicates that are part of the sequence passed in. We already do this for remove.
      
      llvm-svn: 358534
      896b0c7b
  2. Apr 16, 2019
Loading