1. May 09, 2018
    • Stella Stamenova's avatar
      [lit, lldbsuite] Add a bug reference to the failing TestLinuxCore and fix an... · 8a36cb3b
      Stella Stamenova authored
      [lit, lldbsuite] Add a bug reference to the failing TestLinuxCore and fix an undefined property in dotest.py
      
      Summary:
      1) In TestLinuxCore rather than skipping the tests on Windows, mark them as expected failures and add a bug reference
      2) In dotest.py replace the undefined property in the exceptions with the actual property causing the exception
      
      Reviewers: asmith, labath, zturner
      
      Reviewed By: labath, zturner
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46590
      
      llvm-svn: 331886
      8a36cb3b
    • Krzysztof Parzyszek's avatar
      [LV] Change MaxVectorSize bound to 256 in assertion, NFC otherwise · ea4c1bb7
      Krzysztof Parzyszek authored
      It's possible to have a vector of 256 bytes in HVX code on Hexagon
      (vector pair in 128-byte mode).
      
      llvm-svn: 331885
      ea4c1bb7
    • Pavel Labath's avatar
      APFloat/x87: Fix string conversion for "unnormal" values (pr35860) · b1bcafd7
      Pavel Labath authored
      Summary:
      Unnormal values are a feature of some very old x87 processors. We handle
      them correctly for the most part -- the only exception was an unnormal
      value whose significand happened to be zero. In this case the APFloat
      was still initialized as normal number (category = fcNormal), but a
      subsequent toString operation would assert because the math would
      produce nonsensical values for the zero significand.
      
      During review, it was decided that the correct way to fix this is to
      treat all unnormal values as NaNs (as that is what any >=386 processor
      will do).
      
      The issue was discovered because LLDB would crash when trying to print
      some "long double" values.
      
      Reviewers: skatkov, scanon, gottesmm
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41868
      
      llvm-svn: 331884
      b1bcafd7
    • Krzysztof Parzyszek's avatar
      [Hexagon] Simplify MCCodeEmitter, move data to tables · 8e7625ee
      Krzysztof Parzyszek authored
      llvm-svn: 331883
      8e7625ee
    • Pavel Labath's avatar
      Fix Windows build for the Predicate.h refactor in r331880 · 4b130331
      Pavel Labath authored
      llvm-svn: 331882
      4b130331
    • Sid Manning's avatar
      Add basic compiler-rt builtins support for hexagon. · ed3065f7
      Sid Manning authored
      Differential Revision: https://reviews.llvm.org/D46364
      
      llvm-svn: 331881
      ed3065f7
    • Pavel Labath's avatar
      Modernize and clean-up the Predicate class · 3879fe00
      Pavel Labath authored
      Summary:
      The comments on this class were out of date with the implementation, and
      the implementation itself was inconsistent with our usage of the Timeout
      class (I started converting everything to use this class back in D27136,
      but I missed this one). I avoid duplicating the waiting logic by
      introducing a templated WaitFor function, and make other functions
      delegate to that. This function can be also used as a replacement for
      the unused WaitForBitToBeSet functions I removed, if it turns out to be
      necessary.
      
      As this changes the meaning of a "zero" timeout, I tracked down all the
      callers of these functions and updated them accordingly. Propagating the
      changes to all the callers of RunShellCommand was a bit too much for
      this patch, so I stopped there and will continue that in a follow-up
      patch.
      
      I also add some basic unittests for the functions I modified.
      
      Reviewers: jingham, clayborg
      
      Subscribers: mgorny, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D46580
      
      llvm-svn: 331880
      3879fe00
    • Alexey Bataev's avatar
      [OPENMP] Mark global tors/dtors as used. · e253f2f8
      Alexey Bataev authored
      If the global variables are marked as declare target and they need
      ctors/dtors, these ctors/dtors are emitted and then invoked by the
      offloading runtime library. They are not explicitly used in the emitted
      code and thus can be optimized out. Patch marks these functions as used,
      so the optimizer cannot remove these function during the optimization
      phase.
      
      llvm-svn: 331879
      e253f2f8
    • Karl-Johan Karlsson's avatar
      [LV] Add lit testcase for bitcast problem. NFC · b27dd33c
      Karl-Johan Karlsson authored
      llvm-svn: 331878
      b27dd33c
    • Anastasia Stulova's avatar
      [OpenCL] Add constant address space to __func__ in AST. · 59055b94
      Anastasia Stulova authored
      Added string literal helper function to obtain the type
      attributed by a constant address space.
      
      Also fixed predefind __func__ expr to use the helper
      to constract the string literal correctly.
      
      Differential Revision: https://reviews.llvm.org/D46049
      
      llvm-svn: 331877
      59055b94
    • Pavel Labath's avatar
      [Support/Path] Make handling of paths like "///" consistent · d20289b3
      Pavel Labath authored
      Summary:
      Various path functions were not treating paths consisting of slashes
      alone consistently. For example, the iterator-based accessors decomposed the
      path "///" into two elements: "/" and ".". This is not too bad, but it
      is different from the behavior specified by posix:
      ```
      A pathname that contains ***at least one non-slash character*** and that
      ends with one or more trailing slashes shall be resolved as if a single
      dot character ( '.' ) were appended to the pathname.
      ```
      More importantly, this was different from how we treated the same path
      in the filename+parent_path functions, which decomposed this path into
      "." and "". This was completely wrong as it lost the information that
      this was an absolute path which referred to the root directory.
      
      This patch fixes this behavior by making sure all functions treat paths
      consisting of (back)slashes alone the same way as "/". I.e., the
      iterator-based functions will just report one component ("/"), and the
      filename+parent_path will decompose them into "/" and "".
      
      A slightly controversial topic here may be the treatment of "//". Posix
      says that paths beginning with "//" may have special meaning and indeed
      we have code which parses paths like "//net/foo/bar" specially. However,
      as we were already not being consistent in parsing the "//" string
      alone, and any special parsing for it would complicate the code further,
      I chose to treat it the same way as longer sequences of slashes (which
      are guaranteed to be the same as "/").
      
      Another slight change of behavior is in the parsing of paths like
      "//net//". Previously the last component of this path was ".". However,
      as in our parsing the "//net" part in this path was the same as the
      "drive" part in "c:\" and the next slash was the "root directory", it
      made sense to treat "//net//" the same way as "//net/" (i.e., not to add
      the extra "." component at the end).
      
      Reviewers: zturner, rnk, dblaikie, Bigcheese
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D45942
      
      llvm-svn: 331876
      d20289b3
    • Manuel Klimek's avatar
      Do not warn on unused parameters for functions with empty bodies. · d88caa21
      Manuel Klimek authored
      If a function has an empty body, all parameters are trivially unused.
      
      llvm-svn: 331875
      d88caa21
    • Sven van Haastregt's avatar
      [OpenCL] Restrict various keywords in OpenCL C++ mode · 2ca6ba10
      Sven van Haastregt authored
      Restrict the following keywords in the OpenCL C++ language mode,
      according to Sections 2.2 & 2.9 of the OpenCL C++ 1.0 Specification.
      
       - dynamic_cast
       - typeid
       - register (already restricted in OpenCL C, update the diagnostic)
       - thread_local
       - exceptions (try/catch/throw)
       - access qualifiers read_only, write_only, read_write
      
      Support the `__global`, `__local`, `__constant`, `__private`, and
      `__generic` keywords in OpenCL C++.  Leave the unprefixed address
      space qualifiers such as global available, i.e., do not mark them as
      reserved keywords in OpenCL C++.  libclcxx provides explicit address
      space pointer classes such as `global_ptr` and `global<T>` that are
      implemented using the `__`-prefixed qualifiers.
      
      Differential Revision: https://reviews.llvm.org/D46022
      
      llvm-svn: 331874
      2ca6ba10
    • Adhemerval Zanella's avatar
      [AArch64] Improve cost of vector division by constant · f384bc71
      Adhemerval Zanella authored
      With custom lowering for vector MULLH{S,U}, it is now profitable to
      vectorize a divide by constant loop for the custom types (v16i8, v8i16,
      and v4i32).  The cost if based on TargetLowering::Build{S,U}DIV which
      uses a multiply by constant plus adjustment to express a divide by
      constant.
      
      Both {u,s}mull{2} are expressed as Instruction::Mul and shifts by
      Instruction::AShr.
      
      llvm-svn: 331873
      f384bc71
    • Nico Weber's avatar
      Remove 'abi-breaking-checks' lit feature. · 3934dba0
      Nico Weber authored
      Its only two uses were removed in r311730.
      Effectively reverts r304851 (but that code has removed around a bit since then).
      https://reviews.llvm.org/D46619
      
      clang side done in r331871.
      
      llvm-svn: 331872
      3934dba0
    • Nico Weber's avatar
      Remove unused lit setting, see https://reviews.llvm.org/D46619 · 82574aaa
      Nico Weber authored
      llvm-svn: 331871
      82574aaa
    • Alexander Kornienko's avatar
      Fixes issue introduced by r331556. · 48fcfc32
      Alexander Kornienko authored
      Closes bug: https://bugs.llvm.org/show_bug.cgi?id=37357
      
      Patch by Rafael Stahl!
      
      Differential revision: https://reviews.llvm.org/D46633
      
      llvm-svn: 331870
      48fcfc32
    • Pavel Labath's avatar
      Revert "DWARFVerifier: Check "completeness" of .debug_names section" · e0207a60
      Pavel Labath authored
      The new verifier check has found an error in the
      debug-names-name-collisions.ll test on the PS4 bot:
      
      error: Name Index @ 0x0: Entry @ 0xdc: mismatched Name of DIE @ 0x23: index - _ZN3foo3fooE; debug_info - foo.
      
      Reverting while I investigate whether this is a bug in the verifier or
      the generator.
      
      This reverts commit r331868.
      
      llvm-svn: 331869
      e0207a60
    • Pavel Labath's avatar
      DWARFVerifier: Check "completeness" of .debug_names section · 3280e046
      Pavel Labath authored
      Summary:
      This patch implements a check which makes sure all entries required by
      the DWARF v5 specification are present in the Name Index. The algorithm
      tries to follow the wording of Section 6.1.1.1 of the spec as closely as
      possible.
      
      The main deviation from it is that instead of a whitelist-based approach
      in the spec "The name index must contain an entry for each debugging
      information entry that defines a named subprogram, label, variable,
      type, or namespace" I chose a blacklist-based one, where I consider
      everything to be "in" and then remove the entries that don't make sense.
      I did this because it has more potential for catching interesting cases
      and the above is a bit vague (it uses plain words like "variable" and
      "subprogram", but the rest of the section speaks about specific TAGs).
      
      This approach has raised some interesting questions, the main one being
      whether enumerator values should be indexed. The consensus seems to be
      that they should, although it does not follow from section 6.1.1.1.
      For the time being I made the verifier ignore these, as LLVM does not do
      this yet, and I wanted to get a clean run when verifying generated debug
      info.
      
      Another interesting case was the DW_TAG_imported_declaration. It was not
      immediately clear to me whether this should go in or not, but currently
      it is not indexed, and (unlike the enumerators) in does not seem to cause
      problems for LLDB, so I've also ignored it.
      
      Reviewers: JDevlieghere, aprantl, dblaikie
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46583
      
      llvm-svn: 331868
      3280e046
    • Simon Pilgrim's avatar
      [CostModel][X86] Split off SLM checks · fe5c5277
      Simon Pilgrim authored
      A future patch will require this and the diff is much better if we perform the split separately.
      
      llvm-svn: 331867
      fe5c5277
    • Benjamin Kramer's avatar
      Revert "[InstCombine] snprintf optimizations" · ccb0fbe9
      Benjamin Kramer authored
      This reverts commit r331849. It miscompiles
      snprintf(buf, sizeof(buf), "%s", "any constant string); into
      memcpy(buf, "%s", sizeof("any constant string"));
      
      llvm-svn: 331866
      ccb0fbe9
    • Benjamin Kramer's avatar
      [DebugInfo] Mark tests using -debug-only as REQUIRES: asserts · 7b307bce
      Benjamin Kramer authored
      llvm-svn: 331865
      7b307bce
    • Simon Pilgrim's avatar
      [X86] Cleanup WriteFStore/WriteVecStore schedules · ab34aa82
      Simon Pilgrim authored
      MOVNTPD/MOVNTPS should be WriteFStore
      
      Standardized BDW/HSW/SKL/SKX WriteFStore/WriteVecStore - fixes some missed instregex patterns. (V)MASKMOVDQU was already using the default, its costs gets increased but is still nowhere near the real cost of that nasty instruction....
      
      llvm-svn: 331864
      ab34aa82
    • Simon Dardis's avatar
      [mips] Move conditional moves out of isCodeGenOnly · eead2088
      Simon Dardis authored
      Reviewers: atanasyan, smaksimovic, abeserminji
      
      Differential Revision: https://reviews.llvm.org/D46389
      
      llvm-svn: 331863
      eead2088
    • Benjamin Kramer's avatar
      [wasm] Update test for variables->retainedNodes rename. · 9a85470a
      Benjamin Kramer authored
      This fixes the test after LLVM r331841.
      
      llvm-svn: 331862
      9a85470a
    • Hans Wennborg's avatar
      Revert r331843 "[DebugInfo] Generate debug information for labels." · ef2f6948
      Hans Wennborg authored
      It broke the Chromium build (see reply on the review).
      
      > Generate DILabel metadata and call llvm.dbg.label after label
      > statement to associate the metadata with the label.
      >
      > Differential Revision: https://reviews.llvm.org/D45045
      >
      > Patch by Hsiangkai Wang.
      
      This doesn't revert the change to backend-unsupported-error.ll
      that seems to correspond to an llvm-side change.
      
      llvm-svn: 331861
      ef2f6948
    • Martin Storsjo's avatar
      [COFF] Improve correctness of def parsing for GNU features · 97379ff6
      Martin Storsjo authored
      The operator == used for exporting a function with a different
      name in the DLL compared to the name in the import library
      (which is useful for adding linker level aliases for function
      in the import library) is a feature distinct and different from
      the operator = used for exporting a function with a different
      name (both in import library and DLL) than in the implementation
      producing the DLL.
      
      When creating an import library using dlltool, from a def file that
      contains forwards (Func = OtherDll.Func), this shouldn't affect the
      produced import library, which should still behave just as if it
      was a normal exported function.
      
      This clears a lot of confusion and subtle misunderstandings, and
      avoids a parameter that was used to avoid creating weak aliases
      when invoked from lld. (This parameter was added previously due to
      the existing conflation of the two features.)
      
      Differential Revision: https://reviews.llvm.org/D46245
      
      llvm-svn: 331860
      97379ff6
    • Martin Storsjo's avatar
      [COFF] Improve correctness of def parsing for GNU features · 284ab80f
      Martin Storsjo authored
      The operator == used for exporting a function with a different
      name in the DLL compared to the name in the import library
      (which is useful for adding linker level aliases for function
      in the import library) is a feature distinct and different from
      the operator = used for exporting a function with a different
      name (both in import library and DLL) than in the implementation
      producing the DLL.
      
      When creating an import library using dlltool, from a def file that
      contains forwards (Func = OtherDll.Func), this shouldn't affect the
      produced import library, which should still behave just as if it
      was a normal exported function.
      
      This clears a lot of confusion and subtle misunderstandings, and
      avoids a parameter that was used to avoid creating weak aliases
      when invoked from lld. (This parameter was added previously due to
      the existing conflation of the two features.)
      
      Differential Revision: https://reviews.llvm.org/D46245
      
      llvm-svn: 331859
      284ab80f
    • Martin Storsjo's avatar
      Revert "[Driver] Use -fuse-line-directives by default in MSVC mode" · f1f8f4a1
      Martin Storsjo authored
      This reverts commit SVN r331666.
      
      It was afterwards pointed out in https://reviews.llvm.org/D46520
      that #line directives lose information about what parts come from a
      system header. That means the result of -E usually won't compile,
      since Windows headers are typically full of warnings and
      default-error warnings.
      
      llvm-svn: 331858
      f1f8f4a1
    • Krasimir Georgiev's avatar
      [clang-format] Respect BreakBeforeClosingBrace while calculating length · 8b4bc76a
      Krasimir Georgiev authored
      Summary:
      This patch makes `getLengthToMatchingParen` respect the `BreakBeforeClosingBrace`
      ParenState for matching scope closers. In order to distinguish between paren states
      introduced by real vs. fake parens, I've added the token opening the ParensState
      to that struct.
      
      Reviewers: djasper
      
      Reviewed By: djasper
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D46519
      
      llvm-svn: 331857
      8b4bc76a
    • Simon Atanasyan's avatar
      [driver] Add mips_Features_Group to Options to improve documentation sorting · 8e1c75a4
      Simon Atanasyan authored
      Move all of the MIPS-only options into a new m_mips_Features_Group.
      Nearly all other targets have most target-specific options grouped,
      but MIPS does not.
      
      The primary benefits are that the options will be listed together (and
      thus identifiable as MIPS-specific even if they have no help string) in
      the ClangCommandLineReference, and that Options.td is a bit more organized.
      
      A secondary benefit is that a custom version of clang can more easily
      hide/disable groups of options for unsupported targets.
      
      Patch by Vince Del Vecchio
      
      Differential Revision: https://reviews.llvm.org/D46450
      
      llvm-svn: 331856
      8e1c75a4
    • Pavel Labath's avatar
      [DWARF] Align non-accelerated function fullname searching with the apple-tables path · 80d48155
      Pavel Labath authored
      Summary:
      Before this patch the two paths were doing very different things
      - the apple path searched the .apple_names section, which contained
        mangled names, as well as basenames of all functions. It returned any
        name it found.
      - the non-accelerated path looked in the "full name" index we built
        ourselves, which contained mangled as well as demangled names of all
        functions (but no basenames). Then however, if it did not find a match
        it did an extra search in the basename index, with some special
        handling for anonymous namespaces.
      
      This aligns the two paths by changing the non-accelerated path to return
      the same results as in the apple-tables one. In pratice, this means we
      will search in both the "basename", "method" and "fullname" indexes (in
      the manual indexes these are separate indexes. This means the function
      will return some slightly inappropriate results (e.g. bar::baz::foo when
      one asks for a "full name" foo), but this can be handled by additional
      filtering, independently indexing method. I've also stopped inserting
      demangled names into the "fullname" index, as that is inconsistent with
      the apple path.
      
      Reviewers: clayborg, JDevlieghere
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D46576
      
      llvm-svn: 331855
      80d48155
    • Hans Wennborg's avatar
      Add a test for r331746. · 349fdaab
      Hans Wennborg authored
      Thanks to pcc for creating the test file!
      
      llvm-svn: 331854
      349fdaab
    • Shiva Chen's avatar
      [DebugInfo] Fix test failed due to debug-label-mi.ll and debug-label-opt.ll · 39a694ff
      Shiva Chen authored
      Make these two test cases more generic for other architectures.
      Please refer to '[DebugInfo] Convert intrinsic llvm.dbg.label to
      MachineInstr.'
      
      Patch by Hsiangkai Wang
      
      llvm-svn: 331853
      39a694ff
    • Bjorn Pettersson's avatar
      [MergedLoadStoreMotion] Fix a debug invariant bug in mergeStores · 9f953cdd
      Bjorn Pettersson authored
      Summary:
      MergedLoadStoreMotion::mergeStores is using some heuristics
      to limit the amount of stores that it tries to sink (see
      MagicCompileTimeControl in MergedLoadStoreMotion.cpp). The
      heuristic involves counting the number of instructions in
      one of the basic blocks that is part of the transformation.
      
      We now ignore dbg intrinsics when counting instruction for
      the MagicCompileTimeControl heuristic. This to make sure that
      the amount of stores that are sunk doesn't depend on the amount
      of debug information (if -g is used or not).
      
      Reviewers: Gerolf, davide, majnemer
      
      Reviewed By: davide
      
      Subscribers: dberlin, bjope, aprantl, JDevlieghere, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46600
      
      llvm-svn: 331852
      9f953cdd
    • Simon Atanasyan's avatar
      [ELF][MIPS] Add test case to cover LA25 r6 thunks generation. NFC · d62b3e8f
      Simon Atanasyan authored
      llvm-svn: 331851
      d62b3e8f
    • Robert Widmann's avatar
      [LLVM-C] Correct types in Go bindings · 387a4c97
      Robert Widmann authored
      Summary: Fixes a test failure introduced in rL331114.
      
      Reviewers: whitequark
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46631
      
      llvm-svn: 331850
      387a4c97
    • David Bolvansky's avatar
      [InstCombine] snprintf optimizations · 44a37f04
      David Bolvansky authored
      Reviewers: spatel, efriedma, majnemer, rja
      
      Reviewed By: rja
      
      Subscribers: rja, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46285
      
      llvm-svn: 331849
      44a37f04
    • Shiva Chen's avatar
      [DebugInfo] Fix test failed due to new DISubprogram attributes. · 196b28a9
      Shiva Chen authored
      Please refer to '[DebugInfo] Add DILabel metadata and intrinsic
      llvm.dbg.label'. I have renamed the 'variables' attributes to
      'retainedNodes' to include local variables and local labels for the
      function.
      
      Patch by Hsiangkai Wang.
      
      llvm-svn: 331848
      196b28a9
    • Craig Topper's avatar