1. Jul 24, 2019
    • Thomas Preud'homme's avatar
      [FileCheck]] Canonicalize caret location testing · ba4e8d79
      Thomas Preud'homme authored
      Summary:
      Testing of caret location in diagnostic message is currently made with
      CHECK directive with the following general format:
      CHECK: {{^         \^$}}
      
      James Henderson suggested the following would be more readable:
      CHECK: {{^}}         ^{{$}}
      
      and when whole lines can be matched (as is the case for command-line
      testing where error messages do not include path):
      CHECK:         ^
      using the option --match-full-lines.
      
      This commit implements these 2 changes on all existing caret position
      tests. It also aligns the caret to the character it is trying to match
      in the above line.
      
      Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
      
      Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D64923
      
      llvm-svn: 366861
      ba4e8d79
    • Thomas Preud'homme's avatar
      FileCheck [8/12]: Define numeric var from expr · 1b059775
      Thomas Preud'homme authored
      Summary:
      This patch is part of a patch series to add support for FileCheck
      numeric expressions. This specific patch lift the restriction for a
      numeric expression to either be a variable definition or a numeric
      expression to try to match.
      
      This commit allows a numeric variable to be set to the result of the
      evaluation of a numeric expression after it has been matched
      successfully. When it happens, the variable is allowed to be used on
      the same line since its value is known at match time.
      
      It also makes use of this possibility to reuse the parsing code to
      parse a command-line definition by crafting a mirror string of the
      -D option with the equal sign replaced by a colon sign, e.g. for option
      '-D#NUMVAL=10' it creates the string
      '-D#NUMVAL=10 (parsed as [[#NUMVAL:10]])' where the numeric expression
      is parsed to define NUMVAL. This result in a few tests needing updating
      for the location diagnostics on top of the tests for the new feature.
      
      It also enables empty numeric expression which match any number without
      defining a variable. This is done here rather than in commit #5 of the
      patch series because it requires to dissociate automatic regex insertion
      in RegExStr from variable definition which would make commit #5 even
      bigger than it already is.
      
      Copyright:
          - Linaro (changes up to diff 183612 of revision D55940)
          - GraphCore (changes in later versions of revision D55940 and
                       in new revision created off D55940)
      
      Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
      
      Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60388
      
      llvm-svn: 366860
      1b059775
    • Jonas Devlieghere's avatar
      [DWARF] Use 32-bit format specifier for offset · f8552e67
      Jonas Devlieghere authored
      This should fix PR42730.
      
      llvm-svn: 366859
      f8552e67
    • Alex Langford's avatar
      [lldb][test_suite] Update tests with unexpected pass on Android aarch64 · 45a3fd20
      Alex Langford authored
      Summary: update some test decorates that can actually pass on andriod aarch64
      
      Patch by Wanyi Ye <kusmour@gmail.com>
      
      Differential Revision: https://reviews.llvm.org/D64767
      
      llvm-svn: 366858
      45a3fd20
    • Amara Emerson's avatar
      [AArch64][GlobalISel] Add support for s128 loads, stores, extracts, truncs. · 511f7f57
      Amara Emerson authored
      We need to be able to load and store s128 for memcpy inlining, where we want to
      generate Q register mem ops. Making these legal also requires that we add some
      support in other instructions. Regbankselect should also know about these since
      they have no GPR register class that can hold them, so need special handling to
      live on the FPR bank.
      
      Differential Revision: https://reviews.llvm.org/D65166
      
      llvm-svn: 366857
      511f7f57
    • Simon Pilgrim's avatar
      Fix "control reaches end of non-void function" warning. NFCI. · 78b1e777
      Simon Pilgrim authored
      llvm-svn: 366856
      78b1e777
    • Eli Friedman's avatar
      [docs] Clarify where the indirect UB due to write-write races comes from · c69273fa
      Eli Friedman authored
      This is based on https://bugs.llvm.org/show_bug.cgi?id=42435#c3.
      
      Patch by Ralf Jung.
      
      llvm-svn: 366855
      c69273fa
    • Jessica Paquette's avatar
      [GlobalISel][AArch64] Save a copy on G_SELECT by fixing condition to GPR · a2fae1e3
      Jessica Paquette authored
      The condition can never be fed by FPRs, so it should always be on a GPR.
      
      Differential Revision: https://reviews.llvm.org/D65157
      
      llvm-svn: 366854
      a2fae1e3
    • Jonas Devlieghere's avatar
      [ExpressionParser] Handle llvm::Expected result · b362c976
      Jonas Devlieghere authored
      This fixes the unchecked-error assertion at runtime.
      
        Expected<T> must be checked before access or destruction. Expected<T>
        value was in success state. (Note: Expected<T> values in success mode
        must still be checked prior to being destroyed).
      
      llvm-svn: 366853
      b362c976
    • Jonas Devlieghere's avatar
      [ExpressionParser] Fix formatting and whitespace (NFC) · 50a3f0e0
      Jonas Devlieghere authored
      Fix formatting and whitespace before making changes to this file.
      
      llvm-svn: 366852
      50a3f0e0
    • Eli Friedman's avatar
      [ARM] Add opt-bisect support to ARMParallelDSP. · b27fc95e
      Eli Friedman authored
      llvm-svn: 366851
      b27fc95e
    • Jan Kratochvil's avatar
      [lldb] Fix occasional hangs of VSCode testcases · 8693f8f9
      Jan Kratochvil authored
      On slower machines the vscode testcases were sometimes hanging:
      
        1910 ? Sl 0:00 |   \_ /usr/bin/python .../llvm/tools/lldb/test/dotest.py ... -p TestVSCode_setBreakpoints.py
        2649 ? Sl 0:00 |       \_ .../build/bin/lldb-vscode
        2690 ? S  0:00 |           \_ .../build/bin/lldb-server gdbserver --fd=9 --native-regs --setsid
        2708 ? t  0:00 |               \_ .../build/lldb-test-build.noindex/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.test_functionality/a.out
      
      A reproducer of the racy bug for send_recv():
      #         self.send_packet(command)
      #+        import time
      #+        time.sleep(1)
      #         done = False
      
      I guess `request_continue` was probably originally intended to be synchronous
      but then it isn't and this code has been leftover there.
      
      Differential revision: https://reviews.llvm.org/D65163
      
      llvm-svn: 366850
      8693f8f9
    • Francis Visoiu Mistrih's avatar
      [Remarks] Introduce a new format: yaml-strtab · c5b5cc45
      Francis Visoiu Mistrih authored
      This exposes better support to use a string table with a format through
      an actual new remark::Format, called yaml-strtab.
      
      This can now be used with -fsave-optimization-record=yaml-strtab.
      
      llvm-svn: 366849
      c5b5cc45
    • Antonio Afonso's avatar
      Revert "Revert "Add ReadCStringFromMemory for faster string reads"" · 70795c1e
      Antonio Afonso authored
      This reverts commit 9c10b620.
      
      llvm-svn: 366848
      70795c1e
    • Antonio Afonso's avatar
      Revert "Revert "Implement xfer:libraries-svr4:read packet"" · 05e32bad
      Antonio Afonso authored
      This reverts commit 08c38f77.
      
      llvm-svn: 366847
      05e32bad
    • Francis Visoiu Mistrih's avatar
      [Remarks][NFC] Move the YAML serializer to its own header · cbbdc418
      Francis Visoiu Mistrih authored
      llvm-svn: 366842
      cbbdc418
    • Yi-Hong Lyu's avatar
      [PowerPC] Remove redundant load immediate instructions · 41a010a4
      Yi-Hong Lyu authored
      Currently PowerPC backend emits code like this:
      
        r3 = li 0
        std r3, 264(r1)
        r3 = li 0
        std r3, 272(r1)
      
      This patch fixes that and other cases where a register already contains a value that is loaded so we will get:
      
        r3 = li 0
        std r3, 264(r1)
        std r3, 272(r1)
      
      Differential Revision: https://reviews.llvm.org/D64220
      
      llvm-svn: 366840
      41a010a4
    • Nico Weber's avatar
      gn build: Merge r366832 · 62ac91f3
      Nico Weber authored
      llvm-svn: 366837
      62ac91f3
    • Nico Weber's avatar
      ld.lld: Demangle symbols from archives in diagnostics · 9c0716f1
      Nico Weber authored
      This ports r366573 from COFF to ELF.
      
      There are now to toString(Archive::Symbol), one doing MSVC demangling
      in COFF and one doing Itanium demangling in ELF, so rename these two
      to toCOFFString() and to toELFString() to not get a duplicate symbol.
      
      Nothing ever passes a raw Archive::Symbol to CHECK(), so these not
      being part of the normal toString() machinery seems ok.
      
      There are two code paths in the ELF linker that emits this type of
      diagnostic:
      
      1. The "normal" one in InputFiles.cpp. This is covered by the tweaked test.
      
      2. An additional one that's only used for libcalls if there's at least
         one bitcode in the link, and if the libcall symbol is lazy, and
         lazily loaded from an archive (i.e. not from a lazy .o file).
         (This code path was added in r339301.) Since all libcall names so far
         are C symbols and never mangled, the change there is not observable
         and hence not covered by tests.
      
      Differential Revision: https://reviews.llvm.org/D65095
      
      llvm-svn: 366836
      9c0716f1
    • Craig Topper's avatar
      [X86] In lowerVectorShuffle, instead of creating a new node to canonicalize... · 76bc3d6e
      Craig Topper authored
      [X86] In lowerVectorShuffle, instead of creating a new node to canonicalize the shuffle mask by commuting, just commute the mask and swap V1/V2.
      
      LegalizeDAG tries to legal the DAG by legalizing nodes before
      their operands.
      
      If we create a new node, we end up legalizing it after its operands.
      This prevents some of the optimizations that can be done when the
      operand is a build_vector since the build_vector will have been
      legalized to something else.
      
      Differential Revision: https://reviews.llvm.org/D65132
      
      llvm-svn: 366835
      76bc3d6e
    • Max Moroz's avatar
      [libFuzzer] Fix __sanitizer_print_memory_profile return type in ExtFunctions.def · 374398af
      Max Moroz authored
      Summary:
      Looks like a typo, as that function actually returns void and is used
      as such in libFuzzer code as well.
      
      Reviewers: kcc, Dor1s
      
      Reviewed By: Dor1s
      
      Subscribers: delcypher, #sanitizers, llvm-commits
      
      Tags: #llvm, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D65160
      
      llvm-svn: 366834
      374398af
    • Jonas Devlieghere's avatar
      [utils] Remove sync-source (with SVN) · db1eb7c5
      Jonas Devlieghere authored
      llvm-svn: 366833
      db1eb7c5
    • Francis Visoiu Mistrih's avatar
      [Remarks] Add unit tests for YAML serialization · 78c92d2e
      Francis Visoiu Mistrih authored
      Add tests for both the string table and non string table case.
      
      llvm-svn: 366832
      78c92d2e
    • Nico Weber's avatar
      clang-format: Fix namespace end comments for namespaces with attributes and macros. · 37944130
      Nico Weber authored
      Fixes PR39247.
      
      While here, also make C++20 `namespace A::inline B::inline C` nested
      inline namespaced definitions work.
      
      Before:
          #define DEPRECATE_WOOF [[deprecated("meow")]]
      
          namespace DEPRECATE_WOOF woof {
          void f() {}
          } // namespace DEPRECATE_WOOFwoof
      
          namespace [[deprecated("meow")]] woof {
            void f() {}
          } // namespace [[deprecated("meow")]]woof
      
          namespace woof::inline bark {
            void f() {}
          } // namespace woof::inlinebark
      
      Now:
          #define DEPRECATE_WOOF [[deprecated("meow")]]
      
          namespace DEPRECATE_WOOF woof {
          void f() {}
          } // namespace woof
      
          namespace [[deprecated("meow")]] woof {
          void f() {}
          } // namespace woof
      
          namespace woof::inline bark {
          void f() {}
          } // namespace woof::inline bark
      
      (In addition to the fixed namespace end comments, also note the correct
      indent of the namespace contents.)
      
      Differential Revision: https://reviews.llvm.org/D65125
      
      llvm-svn: 366831
      37944130
    • Jonas Devlieghere's avatar
      [Utils] Add back utils directory · 93f50594
      Jonas Devlieghere authored
      Due to a bug my earlier commit removed the whole utils directory:
      https://reviews.llvm.org/D65123
      
      llvm-svn: 366830
      93f50594
    • Philip Reames's avatar
      [IndVars] Fix a subtle bug in optimizeLoopExits · ea5c94b4
      Philip Reames authored
      The original code failed to account for the fact that one exit can have a pointer exit count without all of them having pointer exit counts.  This could cause two separate bugs:
      1) We might exit the loop early, and leave optimizations undone.  This is what triggered the assertion failure in the reported test case.
      2) We might optimize one exit, then exit without indicating a change.  This could result in an analysis invalidaton bug if no other transform is done by the rest of indvars.
      
      Note that the pointer exit counts are a really fragile concept.  They show up only when we have a pointer IV w/o a datalayout to provide their size.  It's really questionable to me whether the complexity implied is worth it.
      
      llvm-svn: 366829
      ea5c94b4
    • Nico Weber's avatar
      Improve clang-format-diff help output · 532f7565
      Nico Weber authored
      The description in clang-format-diff.py is more useful than the one
      in `clang-format-diff -h`, so use the same description in both places.
      
      Differential Revision: https://reviews.llvm.org/D64998
      
      llvm-svn: 366828
      532f7565
    • Jonas Devlieghere's avatar
      [Utils] Remove legacy scripts · 6491076e
      Jonas Devlieghere authored
      As pointed out by Nathan in D65155, these scrips don't seem to serve any
      real need anymore.
      
      llvm-svn: 366827
      6491076e
    • Ryan Taylor's avatar
      [IR][Verifier] Allow IntToPtrInst to be !dereferenceable · 6f13637a
      Ryan Taylor authored
      Summary:
      Allow IntToPtrInst to carry !dereferenceable metadata tag.
      This is valid since !dereferenceable can be only be applied to
      pointer type values.
      
      Change-Id: If8a6e3c616f073d51eaff52ab74535c29ed497b4
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D64954
      
      llvm-svn: 366826
      6f13637a
    • Sam Elliott's avatar
      [RISCV][NFC] Correct RUN in rvi-pseudos-invalid.s · 404551ac
      Sam Elliott authored
      This test should test both riscv32 and riscv64.
      
      llvm-svn: 366825
      404551ac
    • Jonas Devlieghere's avatar
      [Logging] Fix format strings · eaedc5ef
      Jonas Devlieghere authored
      Change format strings to use the `{}` syntax instead of the printf
      syntax when using LLDB_LOG.
      
      llvm-svn: 366824
      eaedc5ef
    • Jan Korous's avatar
      [clang][NFCI] Fix random typos · e72321f3
      Jan Korous authored
      llvm-svn: 366823
      e72321f3
    • Rainer Orth's avatar
      [compiler-rt][builtins] Provide __clear_cache for SPARC · 569f92f1
      Rainer Orth authored
      While working on https://reviews.llvm.org/D40900, two tests were failing since __clear_cache
      aborted.  While libgcc's __clear_cache is just empty, this only happens because
      gcc (in gcc/config/sparc/sparc.c (sparc32_initialize_trampoline, sparc64_initialize_trampoline))
      emits flush insns directly.
      
      The following patch mimics that.
      
      Tested on sparcv9-sun-solaris2.11.
      
      Differential Revision: https://reviews.llvm.org/D64496
      
      llvm-svn: 366822
      569f92f1
    • Rainer Orth's avatar
      [CMake] Add -z defs on Solaris · 2b7f3a2b
      Rainer Orth authored
      Like other ELF targets, shared objects should be linked with -z defs on Solaris.
      
      Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.
      
      Differential Revision: https://reviews.llvm.org/D64484
      
      llvm-svn: 366821
      2b7f3a2b
    • Rainer Orth's avatar
      [clang, test] Fix Clang :: Headers/max_align.c on 64-bit SPARC · 2da6eea0
      Rainer Orth authored
      Clang :: Headers/max_align.c currently FAILs on 64-bit SPARC:
      
        error: 'error' diagnostics seen but not expected: 
          File /vol/llvm/src/clang/dist/test/Headers/max_align.c Line 12: static_assert failed due to requirement '8 == _Alignof(max_align_t)' ""
        1 error generated.
      
      This happens because SuitableAlign isn't defined for SPARCv9 unlike SPARCv8
      (which uses the default of 64 bits).  gcc's sparc/sparc.h has
      
        #define BIGGEST_ALIGNMENT (TARGET_ARCH64 ? 128 : 64)
      
      This patch sets SuitableAlign to match and updates the corresponding testcase.
      
      Tested on sparcv9-sun-solaris2.11.
      
      Differential Revision: https://reviews.llvm.org/D64487
      
      llvm-svn: 366820
      2da6eea0
    • Jessica Paquette's avatar
      [GlobalISel][AArch64] Teach GISel to handle shifts in load addressing modes · 2b404d01
      Jessica Paquette authored
      When we select the XRO variants of loads, we can pull in very specific shifts
      (of the size of an element). E.g.
      
      ```
      ldr x1, [x2, x3, lsl #3]
      ```
      
      This teaches GISel to handle these when they're coming from shifts
      specifically.
      
      This adds a new addressing mode function, `selectAddrModeShiftedExtendXReg`
      which recognizes this pattern.
      
      This also packs this up with `selectAddrModeRegisterOffset` into
      `selectAddrModeXRO`. This is intended to be equivalent to `selectAddrModeXRO`
      in AArch64ISelDAGtoDAG.
      
      Also update load-addressing-modes to show that all of the cases here work.
      
      Differential Revision: https://reviews.llvm.org/D65119
      
      llvm-svn: 366819
      2b404d01
  2. Jul 23, 2019