1. Oct 18, 2019
    • Michael Kruse's avatar
      [ScopBuilder] Fix bug 38358 by preserving correct order of ScopStmts. · d72637f5
      Michael Kruse authored
      ScopBuilder::buildEqivClassBlockStmts creates ScopStmts for instruction
      groups in basic block and inserts these ScopStmts into Scop::StmtMap,
      however, as described in llvm.org/PR38358, comment #5, StmtScops are
      inserted into vector ScopStmt[BB] in wrong order.  As a result,
      ScopBuilder::buildSchedule creates wrong order sequence node.
      
      Looking closer to code, it's clear there is no equivalent classes with
      interleaving isOrderedInstruction(memory access) instructions after
      joinOrderedInstructions.  Afterwards, ScopStmts need to be created and
      inserted in the original order of memory access instructions, however,
      at the moment ScopStmts are inserted in the order of leader instructions
      which are probably not memory access instructions.
      
      The fix is simple with a standalone loop scanning
      isOrderedInstruction(memory access) instructions in basic block and
      inserting elements into LeaderToInstList one by one.  The patch also
      removes double reversing operations which are now unnecessary.
      
      New test preserve-equiv-class-order-in-basic_block.ll is also added.
      
      Differential Revision: https://reviews.llvm.org/D68941
      
      llvm-svn: 375192
      d72637f5
    • Philip Reames's avatar
      [IndVars] Factor out some common code into a utility function · 8eaa5b9a
      Philip Reames authored
      As requested in review of D69009
      
      llvm-svn: 375191
      8eaa5b9a
    • Philip Reames's avatar
      [Test] Precommit test for D69006 · 3266eac7
      Philip Reames authored
      llvm-svn: 375190
      3266eac7
    • Artem Dergachev's avatar
      8b3ef1e4
    • Raphael Isemann's avatar
      [lldb][NFC] Fix typo in DWARFASTParserClang.cpp · b31c6241
      Raphael Isemann authored
      llvm-svn: 375187
      b31c6241
    • Artem Dergachev's avatar
      [analyzer] Assign truly stable identifiers to exploded nodes. · 14e9eb3d
      Artem Dergachev authored
      ExplodedGraph nodes will now have a numeric identifier stored in them
      which will keep track of the order in which the nodes were created
      and it will be fully deterministic both accross runs and across machines.
      
      This is extremely useful for debugging as it allows reliably setting
      conditional breakpoints by node IDs.
      
      llvm-svn: 375186
      14e9eb3d
    • Artem Dergachev's avatar
      [analyzer] Display cast kinds in program point dumps. · d325196f
      Artem Dergachev authored
      Because cast expressions have their own hierarchy, it's extremely useful
      to have some information about what kind of casts are we dealing with.
      
      llvm-svn: 375185
      d325196f
    • Artem Dergachev's avatar
      [analyzer] exploded-graph-rewriter: Make node headers a bit lighter. · 73b67f0b
      Artem Dergachev authored
      The 50% grey color is too dark on some monitors.
      
      llvm-svn: 375184
      73b67f0b
    • David Blaikie's avatar
      DebugInfo: Move loclist base address from DwarfFile to DebugLocStream · 2941cda5
      David Blaikie authored
      There's no need to have more than one of these (there can be two
      DwarfFiles - one for the .o, one for the .dwo - but only one loc/loclist
      section (either in the .o or the .dwo) & certainly one per
      DebugLocStream, which is currently singular in DwarfDebug)
      
      llvm-svn: 375183
      2941cda5
    • Lawrence D'Anna's avatar
      eliminate one form of PythonObject::Reset() · 03819d1c
      Lawrence D'Anna authored
      Summary:
      I'd like to eliminate all forms of Reset() and all public constructors
      on these objects, so the only way to make them is with Take<> and Retain<>
      and the only way to copy or move them is with actual c++ copy, move, or
      assignment.
      
      This is a simple place to start.
      
      Reviewers: JDevlieghere, clayborg, labath, jingham
      
      Reviewed By: labath
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D69080
      
      llvm-svn: 375182
      03819d1c
    • Lawrence D'Anna's avatar
      clean up the implementation of PythonCallable::GetNumArguments · c86a6aca
      Lawrence D'Anna authored
      Summary:
      The current implementation of PythonCallable::GetNumArguments
      is not exception safe, has weird semantics, and is just plain
      incorrect for some kinds of functions.
      
      Python 3.3 introduces inspect.signature, which lets us easily
      query for function signatures in a sane and documented way.
      
      This patch leaves the old implementation in place for < 3.3,
      but uses inspect.signature for modern pythons.   It also leaves
      the old weird semantics in place, but with FIXMEs grousing about
      it.   We should update the callers and fix the semantics in a
      subsequent patch.    It also adds some tests.
      
      Reviewers: JDevlieghere, clayborg, labath, jingham
      
      Reviewed By: labath
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D68995
      
      llvm-svn: 375181
      c86a6aca
    • David Blaikie's avatar
    • Eli Friedman's avatar
      [ARM] Fix arm_neon.h with -flax-vector-conversions=none, part 3 · 5b0e039a
      Eli Friedman authored
      It's completely impossible to check that I've actually found all the
      issues, due to the use of macros in arm_neon.h, but hopefully this time
      it'll take more than a few hours for someone to find another issue.
      
      I have no idea why, but apparently there's a rule that some, but not
      all, builtins which should take an fp16 vector actually take an int8
      vector as an argument.  Fix this, and add test coverage.
      
      Differential Revision: https://reviews.llvm.org/D68838
      
      llvm-svn: 375179
      5b0e039a
    • Jordan Rupprecht's avatar
      Reland [llvm-objdump] Use a counter for llvm-objdump -h instead of the section index. · 98a2ae7d
      Jordan Rupprecht authored
      This relands r374931 (reverted in r375088). It fixes 32-bit builds by using the right format string specifier for uint64_t (PRIu64) instead of `%d`.
      
      Original description:
      
      When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).
      
      While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.
      
      Reviewers: grimar, jhenderson, espindola
      
      Reviewed By: grimar
      
      Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68848
      
      llvm-svn: 375178
      98a2ae7d
    • Sergey Dmitriev's avatar
      6caada4e
    • Don Hinton's avatar
      [Error] Make llvm::cantFail include the original error messages · ecb310b3
      Don Hinton authored
      Summary:
      The current implementation eats the current errors and just outputs
      the message parameter passed to llvm::cantFail.  This change appends
      the original error message(s), so the user can see exactly why
      cantFail failed.  New logic is conditional on NDEBUG.
      
      Reviewed By: lhames
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69057
      
      llvm-svn: 375176
      ecb310b3
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] drop getIsFP td helper · befab66a
      Stanislav Mekhanoshin authored
      We already have isFloatType helper, and they are out of sync.
      Drop one and merge the type list.
      
      Differential Revision: https://reviews.llvm.org/D69138
      
      llvm-svn: 375175
      befab66a
    • Sterling Augustine's avatar
      (NFC) Delete variable made unused by llvm-svn: 375160 · bbbc873f
      Sterling Augustine authored
      Reviewers: aprantl
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69143
      
      llvm-svn: 375174
      bbbc873f
    • Raphael Isemann's avatar
      [lldb] X-fail tests that use constructors in expressions on Windows · 69b3363a
      Raphael Isemann authored
      These tests were testing a bug related to constructors. It seems that
      on Windows the expression command can't construct objects (or at least,
      call their constructor explicitly which is required for the tests), so
      this is just x-failing them until Windows actually supports constructor calls.
      
      llvm-svn: 375173
      69b3363a
    • Jonas Devlieghere's avatar
      [test] Add a .clang-format file for the shell test. · a0f6c643
      Jonas Devlieghere authored
      The API tests have a .clang-format file that disables formatting
      altogether. While this is needed for some tests, it also leads to
      inconsistency between test files. The shell tests suffer from a similar
      problem: a test with a source-file extension (.c, .cpp) will get
      formatted, potentially breaking up lines and leading to invalid RUN
      commands.
      
      Rather than completely disabling formatting here, I propose to not
      enforce a line limit instead. That way tests will be consistent, but you
      can still have long run commands (as is not uncommon in LLVM either) and
      use breakpoints with patters that extend beyond 80 cols.
      
      Differential revision: https://reviews.llvm.org/D69058
      
      llvm-svn: 375172
      a0f6c643
    • Julian Lettner's avatar
      [lit] Move computation of deadline up into base class · 9a335b6e
      Julian Lettner authored
      llvm-svn: 375171
      9a335b6e
    • Adrian Prantl's avatar
      Adapt Windows test to API change. · 3ebbda0f
      Adrian Prantl authored
      llvm-svn: 375170
      3ebbda0f
    • Jordan Rupprecht's avatar
      [llvm-objcopy] Add support for shell wildcards · edeebad7
      Jordan Rupprecht authored
      Summary: GNU objcopy accepts the --wildcard flag to allow wildcard matching on symbol-related flags. (Note: it's implicitly true for section flags).
      
      The basic syntax is to allow *, ?, \, and [] which work similarly to how they work in a shell. Additionally, starting a wildcard with ! causes that wildcard to prevent it from matching a flag.
      
      Use an updated GlobPattern in libSupport to handle these patterns. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).
      
      Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap
      
      Reviewed By: MaskRay
      
      Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66613
      
      llvm-svn: 375169
      edeebad7
    • Alexey Bataev's avatar
      [OPENMP]Dow not emit warnings for uninitialized loop counters. · 9c5d76ff
      Alexey Bataev authored
      In OpenMP constructs all counters are initialized and we should not emit
      warnings about uninitialized privatized loop control variables.
      
      llvm-svn: 375167
      9c5d76ff
    • Evgeniy Stepanov's avatar
      libhwasan initialisation include kernel syscall ABI relaxation · d5282dfc
      Evgeniy Stepanov authored
      Summary:
      Until now AArch64 development has been on patched kernels that have an always
      on relaxed syscall ABI where tagged pointers are accepted.
      The patches that have gone into the mainline kernel rely on each process opting
      in to this relaxed ABI.
      
      This commit adds code to choose that ABI into __hwasan_init.
      
      The idea has already been agreed with one of the hwasan developers
      (http://lists.llvm.org/pipermail/llvm-dev/2019-September/135328.html).
      
      The patch ignores failures of `EINVAL` for Android, since there are older versions of the Android kernel that don't require this `prctl` or even have the relevant values.  Avoiding EINVAL will let the library run on them.
      
      I've tested this on an AArch64 VM running a kernel that requires this
      prctl, having compiled both with clang and gcc.
      
      Patch by Matthew Malcomson.
      
      Reviewers: eugenis, kcc, pcc
      
      Reviewed By: eugenis
      
      Subscribers: srhines, kristof.beyls, #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D68794
      
      llvm-svn: 375166
      d5282dfc
    • Julian Lettner's avatar
      Reland "[lit] Synthesize artificial deadline" · 2ca8e27b
      Julian Lettner authored
      We always want to use a deadline when calling `result.await`.  Let's
      synthesize an artificial deadline (now plus one year) to simplify code
      and do less busy waiting.
      
      Thanks to Reid Kleckner for diagnosing that a deadline for of "positive
      infinity" does not work with Python 3 anymore.  See commit:
      4ff1e34b
      
      I tested this patch with Python 2 and Python 3.
      
      llvm-svn: 375165
      2ca8e27b
    • Martin Storsjo's avatar
      Revert "[LLDB] [test] Use %clang_cl instead of build.py in a few tests" · 54017d0f
      Martin Storsjo authored
      This reverts SVN r375156, as it seems to have broken tests when run
      on macOS: http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2706/console
      
      llvm-svn: 375163
      54017d0f
    • Dan Liew's avatar
      [Builtins] Downgrade duplicate source file warning from a fatal error to a warning. · dc748816
      Dan Liew authored
      This is a follow up to r375150 to unbreak the `clang-ppc64be-linux` bot.
      The commit caused running the tests to fail due to
      
      ```
      llvm-lit:
      /home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/llvm/projects/compiler-rt/test/builtins/Unit/lit.cfg.py:116:
      fatal: builtins_source_features contains duplicates:
      ['librt_has_divtc3']
      ```
      
      This commit should be reverted once the build system bug for powerpc is
      fixed.
      
      llvm-svn: 375162
      dc748816
    • Adrian Prantl's avatar
      Modernize the rest of the Find.* API (NFC) · 1ad655e2
      Adrian Prantl authored
      This patch removes the size_t return value and the append parameter
      from the remainder of the Find.* functions in LLDB's internal API. As
      in the previous patches, this is motivated by the fact that these
      parameters aren't really used, and in the case of the append parameter
      were frequently implemented incorrectly.
      
      Differential Revision: https://reviews.llvm.org/D69119
      
      llvm-svn: 375160
      1ad655e2
    • Sanjay Patel's avatar
      [x86] add test for setcc to shift transform; NFC · e3905dee
      Sanjay Patel authored
      llvm-svn: 375158
      e3905dee
    • Shoaib Meenai's avatar
      [cmake] Pass external project source directories to sub-configures · c9499264
      Shoaib Meenai authored
      We're passing LLVM_EXTERNAL_PROJECTS to cross-compilation configures, so
      we also need to pass the source directories of those projects, otherwise
      configuration can fail from not finding them.
      
      Differential Revision: https://reviews.llvm.org/D69076
      
      llvm-svn: 375157
      c9499264
    • Martin Storsjo's avatar
      [LLDB] [test] Use %clang_cl instead of build.py in a few tests · 95980409
      Martin Storsjo authored
      This allows explicitly specifying the intended target architecture,
      for tests that aren't supposed to be executed, and that don't
      require MSVC headers or libraries to be available.
      
      (These tests already implicitly assumed to be built for x86; one
      didn't specify anything, assuming x86_64, while the other specified
      --arch=32, which only picks the 32 bit variant of the default target
      architecture).
      
      Join two comment lines in disassembly.cpp, to keep row numbers
      checked in the test unchanged.
      
      This fixes running check-lldb on arm linux.
      
      Differential Revision: https://reviews.llvm.org/D69031
      
      llvm-svn: 375156
      95980409
    • Alexander Shaposhnikov's avatar
      [Object] Fix the return type of getOffset/getSize · 68db51d5
      Alexander Shaposhnikov authored
      Header64.offset/Header64.size are uint64_t, thus we should not 
      truncate them to unit32_t. Moreover, there are a number of places 
      where we sum the offset and the size (e.g. in various checks in MachOUniversal.cpp),
      the truncation causes issues since the offset/size can perfectly fit into uint32_t, 
      while the sum overflows.
      
      Differential revision: https://reviews.llvm.org/D69126
      
      Test plan: make check-all
      
      llvm-svn: 375154
      68db51d5
    • Roman Lebedev's avatar
    • Nemanja Ivanovic's avatar
      [PowerPC] Turn on CR-Logical reducer pass · 8a3d7c9c
      Nemanja Ivanovic authored
      Quite a while ago, we implemented a pass that will reduce the number of
      CR-logical operations we emit. It does so by converting a CR-logical operation
      into a branch. We have kept this off by default because it seemed to cause a
      significant regression with one benchmark.
      However, that regression turned out to be due to a completely unrelated
      reason - AADB introducing a self-copy that is a priority-setting nop and it was
      just exacerbated by this pass.
      
      Now that we understand the reason for the only degradation, we can turn this
      pass on by default. We have long since fixed the cause for the degradation.
      
      Differential revision: https://reviews.llvm.org/D52431
      
      llvm-svn: 375152
      8a3d7c9c
    • Raphael Isemann's avatar
      [lldb] Don't emit artificial constructor declarations as global functions · 6237c9fe
      Raphael Isemann authored
      Summary:
      When we have a artificial constructor DIE, we currently create from that a global function with the name of that class.
      That ends up causing a bunch of funny errors such as "must use 'struct' tag to refer to type 'Foo' in this scope" when
      doing `Foo f`. Also causes that constructing a class via `Foo()` actually just calls that global function.
      
      The fix is that when we have an artificial method decl, we always treat it as handled even if we don't create a CXXMethodDecl
      for it (which we never do for artificial methods at the moment).
      
      Fixes rdar://55757491 and probably some other radars.
      
      Reviewers: aprantl, vsk, shafik
      
      Reviewed By: aprantl
      
      Subscribers: jingham, shafik, labath, JDevlieghere, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D68130
      
      llvm-svn: 375151
      6237c9fe
    • Dan Liew's avatar
      [Builtins] Provide a mechanism to selectively disable tests based on whether... · 5be7eb3a
      Dan Liew authored
      [Builtins] Provide a mechanism to selectively disable tests based on whether an implementation is provided by a builtin library.
      
      Summary:
      If a platform removes some builtin implementations (e.g. via the
      Darwin-excludes mechanism) then this can lead to test failures because
      the test expects an implementation to be available.
      
      To solve this lit features are added for each configuration based
      on which sources are included in the builtin library. The features
      are of the form `librt_has_<name>` where `<name>` is the name of the
      source file with the file extension removed. This handles C and
      assembly sources.
      
      With the lit features in place it is possible to make certain tests
      require them.
      
      Example:
      
      ```
      REQUIRES: librt_has_comparedf2
      ```
      
      All top-level tests in `test/builtins/Unit` (i.e. not under
      `arm`, `ppc`, and `riscv`) have been annotated with the appropriate
      `REQUIRES: librt_has_*` statement.
      
      rdar://problem/55520987
      
      Reviewers: beanz, steven_wu, arphaman, dexonsmith, phosek, thakis
      
      Subscribers: mgorny, #sanitizers, llvm-commits
      
      Tags: #llvm, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D68064
      
      llvm-svn: 375150
      5be7eb3a
    • Jordan Rupprecht's avatar
      Reapply r375051: [support] GlobPattern: add support for `\` and `[!...]`, and... · 48993d5a
      Jordan Rupprecht authored
      Reapply r375051: [support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places
      
      Reland r375051 (reverted in r375052) after fixing lld tests on Windows in r375126 and r375131.
      
      Original description: Update GlobPattern in libSupport to handle a few more cases. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).
      
      This will be used to implement the `--wildcard` flag in llvm-objcopy to be more compatible with GNU objcopy.
      
      This is split off of D66613 to land the libSupport changes separately. The llvm-objcopy part will land soon.
      
      Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap
      
      Reviewed By: MaskRay
      
      Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66613
      
      llvm-svn: 375149
      48993d5a
    • Sterling Augustine's avatar
      NFC: Fix variable only used in asserts by propagating the value. · 05c3d902
      Sterling Augustine authored
      Summary:
      This fixes builds with assertions disabled that would otherwise
      fail with unused variable warnings
      
      Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69123
      
      llvm-svn: 375148
      05c3d902
    • Reid Kleckner's avatar
      [asan] Update Windows test expectations for LLVM's MS demangler · 0aaa1931
      Reid Kleckner authored
      After r375041 llvm-symbolizer uses it for demangling instead of
      UnDecorateSymbolName. LLVM puts spaces after commas while Microsoft does
      not.
      
      llvm-svn: 375147
      0aaa1931