1. Apr 17, 2019
    • Fangrui Song's avatar
      [DWARF] Pass ReferenceToDIEOffsets elements by reference · df44ff1b
      Fangrui Song authored
      llvm-svn: 358558
      df44ff1b
    • Dmitri Gribenko's avatar
      Fixed error message printing in write_cmake_config.py · b9b35fd1
      Dmitri Gribenko authored
      Summary:
      Previously, write_cmake_config.py would raise an error while printing
      the error, because `leftovers` in "'\n'.join(leftovers)" is a tuple.
      
      Subscribers: mgorny, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60766
      
      llvm-svn: 358557
      b9b35fd1
    • Craig Topper's avatar
      [X86] Autogenerate complete checks. NFC · 5ca2e04c
      Craig Topper authored
      llvm-svn: 358556
      5ca2e04c
    • Craig Topper's avatar
      [X86] In CopyToFromAsymmetricReg, use VR128 instead of FR32 instructions for... · 6bf08027
      Craig Topper authored
      [X86] In CopyToFromAsymmetricReg, use VR128 instead of FR32 instructions for GR32<->XMM register copies.
      
      We have two versions of some instructions, VR128 versions and FR32 versions that
      are marked as CodeGenOnly.
      
      This change switches to using the VR128 versions for these copies. It's after
      register allocation so the class size no longer matters. This matches how GR64
      works.
      
      llvm-svn: 358555
      6bf08027
    • Andrea Di Biagio's avatar
      [MCA] Moved the bottleneck analysis to its own file. NFCI · 57cef586
      Andrea Di Biagio authored
      llvm-svn: 358554
      57cef586
    • Eric Christopher's avatar
      Revert "Add basic loop fusion pass." Per request. · e29874ea
      Eric Christopher authored
      This reverts commit r358543/ab70da07.
      
      llvm-svn: 358553
      e29874ea
    • 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
    • Davide Italiano's avatar
      [tools] Only build lldb-test when needed. · b2930b86
      Davide Italiano authored
      llvm-svn: 358533
      b2930b86
    • Robert Widmann's avatar
      [LLVM-C] Add Accessors For Global Variable Metadata Properties · d6eb4bb8
      Robert Widmann authored
      Summary: Metadata for a global variable is really a  (GlobalVariable, Expression) tuple.  Allow access to these, then allow retrieving the file, scope, and line for a DIVariable, whether global or local.  This should be the last of the accessors required for uniform access to location and file information metadata.
      
      Reviewers: jberdine, whitequark, deadalnix
      
      Reviewed By: jberdine, whitequark
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60725
      
      llvm-svn: 358532
      d6eb4bb8
    • Ali Tamur's avatar
      Fix a typo in comments. [NFC] · e8de5cd6
      Ali Tamur authored
      llvm-svn: 358531
      e8de5cd6
    • Alex Langford's avatar
      [Process] Fix linux arm64 single step compilation failure · 7603bd52
      Alex Langford authored
      This was updated in r356703 to use llvm::sys::RetryAfterSignal, which
      comes from llvm/Support/Errno.h. The header wasn't added, so it fails if
      you compile for arm64/aarch64.
      
      llvm-svn: 358530
      7603bd52
    • Louis Dionne's avatar
      [NFC] Build libc++ verbosely in the macOS CI · 4eff3de9
      Louis Dionne authored
      llvm-svn: 358529
      4eff3de9
    • Davide Italiano's avatar
      [tools] Make vscode and lldb-instr optional. · 6df6895d
      Davide Italiano authored
      Summary:
      Saves some build times, and they're not part of the usual
      developer workflow.
      
      Reviewers: JDevlieghere, friss
      
      Subscribers: mgorny, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D60780
      
      llvm-svn: 358528
      6df6895d
    • Nick Desaulniers's avatar
      [NVPTXAsmPrinter] clean up dead code. NFC · 3271ca01
      Nick Desaulniers authored
      Summary:
      The printOperand function takes a default parameter, for which there are
      zero call sites that explicitly pass such a parameter.  As such, there
      is no case to support. This means that the method
      printVecModifiedImmediate is purly dead code, and can be removed.
      
      The eventual goal for some of these AsmPrinter refactoring is to have
      printOperand be a virtual method; making it easier to print operands
      from the base class for more generic Asm printing. It will help if all
      printOperand methods have the same function signature (ie. no Modifier
      argument when not needed).
      
      Reviewers: echristo, tra
      
      Reviewed By: echristo
      
      Subscribers: jholewinski, hiraditya, llvm-commits, craig.topper, srhines
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60727
      
      llvm-svn: 358527
      3271ca01
    • Simon Pilgrim's avatar
      [TargetLowering] Rename preferShiftsToClearExtremeBits and shouldFoldShiftPairToMask (PR41359) · e5573f4f
      Simon Pilgrim authored
      As discussed on PR41359, this patch renames the pair of shift-mask target feature functions to make their purposes more obvious.
      
      shouldFoldShiftPairToMask -> shouldFoldConstantShiftPairToMask
      
      preferShiftsToClearExtremeBits -> shouldFoldMaskToVariableShiftPair
      
      llvm-svn: 358526
      e5573f4f
    • Frederic Riss's avatar
      [debugserver] Relax the codesigning identity check · b47d3560
      Frederic Riss authored
      In an effort to help new LLDB developers, we added checks and messaging around
      the selection of your codesigning identity on macOS. While helpful, it is not
      actually correct. It's perfectly valid to codesign with an identity that is
      not named lldb_codesign. Currently this fails the build.
      
      This patch keeps a warning that informs developers how to setup lldb_codesign
      and how to pass it to cmake, but it allows the build to proceed with a
      different identity.
      
      llvm-svn: 358525
      b47d3560
    • Louis Dionne's avatar
      4b9c19e4
    • Sanjay Patel's avatar
      [EarlyCSE] detect equivalence of selects with inverse conditions and commuted operands (PR41101) · e08783e2
      Sanjay Patel authored
      This is 1 of the problems discussed in the post-commit thread for:
      rL355741 / http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190311/635516.html
      and filed as:
      https://bugs.llvm.org/show_bug.cgi?id=41101
      
      Instcombine tries to canonicalize some of these cases (and there's room for improvement
      there independently of this patch), but it can't always do that because of extra uses.
      So we need to recognize these commuted operand patterns here in EarlyCSE. This is similar
      to how we detect commuted compares and commuted min/max/abs.
      
      Differential Revision: https://reviews.llvm.org/D60723
      
      llvm-svn: 358523
      e08783e2
    • Anton Afanasyev's avatar
      Time profiler: optimize json output time · 3a00b020
      Anton Afanasyev authored
      Summary:
      Use llvm::json::Array.reserve() to optimize json output time. Here is motivation:
      https://reviews.llvm.org/D60609#1468941. In short: for the json array
      with ~32K entries, pushing back each entry takes ~4% of whole time compared
      to the method of preliminary memory reservation: (3995-3845)/3995 = 3.75%.
      
      Reviewers: lebedev.ri
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60792
      
      llvm-svn: 358522
      3a00b020
    • Nikita Popov's avatar
      [CVP] Simplify umulo and smulo that cannot overflow · 52b24ee9
      Nikita Popov authored
      If a umul.with.overflow or smul.with.overflow operation cannot
      overflow, simplify it to a simple mul nuw / mul nsw. After the
      refactoring in D60668 this is just a matter of removing an
      explicit check against multiplications.
      
      Differential Revision: https://reviews.llvm.org/D60791
      
      llvm-svn: 358521
      52b24ee9
    • Anton Afanasyev's avatar
      [Support][JSON] Add reserve() to json Array · 765f0183
      Anton Afanasyev authored
      Summary:
      Space reservation increases json lib performance for the arrays with large number of entries.
      Here is the example and discussion: https://reviews.llvm.org/D60609#1468941
      
      Reviewers: lebedev.ri, sammccall
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60788
      
      llvm-svn: 358520
      765f0183
    • Simon Pilgrim's avatar
      [SLP] Refactoring of the operand reordering code. · 82ffa88a
      Simon Pilgrim authored
      This is a refactoring patch which should have all the functionality of the current code. Its goal is twofold:
      i. Cleanup and simplify the reordering code, and
      ii. Generalize reordering so that it will work for an arbitrary number of operands, not just 2.
      
      This is the second patch in a series of patches that will enable operand reordering across chains of operations. An example of this was presented in EuroLLVM'18 https://www.youtube.com/watch?v=gIEn34LvyNo .
      
      Committed on behalf of @vporpo (Vasileios Porpodas)
      
      Differential Revision: https://reviews.llvm.org/D59973
      
      llvm-svn: 358519
      82ffa88a