1. Jul 02, 2019
  2. Jul 01, 2019
    • Roman Lebedev's avatar
      [InstCombine] (Y + ~X) + 1 --> Y - X fold (PR42459) · 04d3d3bb
      Roman Lebedev authored
      Summary:
      To be noted, this pattern is not unhandled by instcombine per-se,
      it is somehow does end up being folded when one runs opt -O3,
      but not if it's just -instcombine. Regardless, that fold is
      indirect, depends on some other folds, and is thus blind
      when there are extra uses.
      
      This does address the regression being exposed in D63992.
      
      https://godbolt.org/z/7DGltU
      https://rise4fun.com/Alive/EPO0
      
      Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=42459 | PR42459 ]]
      
      Reviewers: spatel, nikic, huihuiz
      
      Reviewed By: spatel
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63993
      
      llvm-svn: 364792
      04d3d3bb
    • Roman Lebedev's avatar
      [InstCombine] Shift amount reassociation in bittest (PR42399) · 72b8d41c
      Roman Lebedev authored
      Summary:
      Given pattern:
      `icmp eq/ne (and ((x shift Q), (y oppositeshift K))), 0`
      we should move shifts to the same hand of 'and', i.e. rewrite as
      `icmp eq/ne (and (x shift (Q+K)), y), 0`  iff `(Q+K) u< bitwidth(x)`
      
      It might be tempting to not restrict this to situations where we know
      we'd fold two shifts together, but i'm not sure what rules should there be
      to avoid endless combine loops.
      
      We pick the same shift that was originally used to shift the variable we picked to shift:
      https://rise4fun.com/Alive/6x1v
      
      Should fix [[ https://bugs.llvm.org/show_bug.cgi?id=42399 | PR42399]].
      
      Reviewers: spatel, nikic, RKSimon
      
      Reviewed By: spatel
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63829
      
      llvm-svn: 364791
      72b8d41c
    • Krzysztof Parzyszek's avatar
      [Hexagon] Custom-lower UADDO(x, 1) and USUBO(x, 1) · 5abf80cd
      Krzysztof Parzyszek authored
      llvm-svn: 364790
      5abf80cd
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Select G_FRAME_INDEX · cda82f0b
      Matt Arsenault authored
      llvm-svn: 364789
      cda82f0b
    • Nicolai Haehnle's avatar
      AMDGPU/GFX10: fix scratch resource descriptor · 7cfd99ab
      Nicolai Haehnle authored
      Summary:
      The stride should depend on the wave size, not the hardware generation.
      
      Also, the 32_FLOAT format is 0x16, not 16; though that shouldn't be
      relevant.
      
      Change-Id: I088f93bf6708974d085d1c50967f119061da6dc6
      
      Reviewers: arsenm, rampitec, mareko
      
      Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63808
      
      llvm-svn: 364788
      7cfd99ab
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Make s16 select legal · fdf36729
      Matt Arsenault authored
      This is easy to handle and avoids legalization artifacts which are
      likely to obscure combines.
      
      llvm-svn: 364787
      fdf36729
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Select G_BRCOND for scc conditions · 6464280e
      Matt Arsenault authored
      llvm-svn: 364786
      6464280e
    • Gabor Marton's avatar
      [ASTImporter] Mark erroneous nodes in shared st · 2afbfb6b
      Gabor Marton authored
      Summary:
      Now we store the errors for the Decls in the "to" context too. For
      that, however, we have to put these errors in a shared state (among all
      the ASTImporter objects which handle the same "to" context but different
      "from" contexts).
      
      After a series of imports from different "from" TUs we have a "to" context
      which may have erroneous nodes in it. (Remember, the AST is immutable so
      there is no way to delete a node once we had created it and we realized
      the error later.) All these erroneous nodes are marked in
      ASTImporterSharedState::ImportErrors.  Clients of the ASTImporter may
      use this as an input. E.g. the static analyzer engine may not try to
      analyze a function if that is marked as erroneous (it can be queried via
      ASTImporterSharedState::getImportDeclErrorIfAny()).
      
      Reviewers: a_sidorin, a.sidorin, shafik
      
      Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D62376
      
      llvm-svn: 364785
      2afbfb6b
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Tolerate copies with no type set · 1daad91a
      Matt Arsenault authored
      isVCC has the same bug, but isn't used in a context where it can cause
      a problem.
      
      llvm-svn: 364784
      1daad91a
    • Matt Arsenault's avatar
      AMDGPU: Fix tests using the default alloca address space · fb99fc7a
      Matt Arsenault authored
      llvm-svn: 364783
      fb99fc7a
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Select src modifiers · 4f64ade0
      Matt Arsenault authored
      llvm-svn: 364782
      4f64ade0
    • Michal Gorny's avatar
      [lldb] [Process/NetBSD] Use global enable bits for watchpoints · 0856721e
      Michal Gorny authored
      Set global enable bits (i.e. bits 1, 3, 5, 7) to enable watchpoints
      on NetBSD rather than the local enable bits (0, 2, 4, 6).  The former
      are necessary for watchpoints to be correctly recognized by the NetBSD
      kernel.  The latter cause them to be reported as trace points.
      
      Differential Revision: https://reviews.llvm.org/D63792
      
      llvm-svn: 364781
      0856721e
    • Michal Gorny's avatar
      [lldb] [Process/NetBSD] Fix segfault when handling watchpoint · baf64b65
      Michal Gorny authored
      Fix the watchpoint/breakpoint code to search for matching thread entry
      in m_threads explicitly rather than assuming that it will be present
      at specified index.  The previous code segfault since it wrongly assumed
      that the index will match LWP ID which was incorrect even for a single
      thread (where index was 0 and LWP ID was 1).
      
      While fixing that off-by-one error would help for this specific task,
      I believe it is better to be explicit in what we are searching for.
      
      Differential Revision: https://reviews.llvm.org/D63791
      
      llvm-svn: 364780
      baf64b65
    • Michal Gorny's avatar
      [lldb] [Process/NetBSD] Support reading YMM registers via PT_*XSTATE · 2b2ad934
      Michal Gorny authored
      Provide a (conditional) support for the new PT_GETXSTATE
      and PT_SETXSTATE ptrace() requests, and use them to implement getting
      and setting YMM registers.  The functions used for splitting
      and recombining YMM register data are based on matching functions
      in FreeBSD plugin, with some simplification and updates to match NetBSD
      structures.
      
      Differential Revision: https://reviews.llvm.org/D63545
      
      llvm-svn: 364779
      2b2ad934
    • Diana Picus's avatar
      Fixup r364512 · 2ba16011
      Diana Picus authored
      Fix stack-use-after-scope errors from r364512. One instance was already
      fixed in r364611 - this patch simplifies that fix and addresses one more
      instance of similar code.
      
      Discussed in: https://reviews.llvm.org/D63905
      
      llvm-svn: 364778
      2ba16011
    • Sam Elliott's avatar
      [RISCV] Avoid save-restore target feature warning · 28145735
      Sam Elliott authored
      Summary:
      LLVM issues a warning if passed unknown target features. Neither I nor
      @asb noticed this until after https://reviews.llvm.org/D63498 landed.
      
      This patch stops passing the (unknown) "save-restore" target feature to
      the LLVM backend, but continues to emit a warning if a driver asks for
      `-msave-restore`. The default of assuming `-mno-save-restore` (and
      emitting no warnings) remains.
      
      Reviewers: asb
      
      Reviewed By: asb
      
      Subscribers: rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, cfe-commits, asb
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D64008
      
      llvm-svn: 364777
      28145735
    • Michal Gorny's avatar
      Revert "[lldb] [Process/NetBSD] Fix constructor after r363707" · 535f39ce
      Michal Gorny authored
      Now that r364751 has been reverted, we need to revert this fixup
      as well.
      
      llvm-svn: 364776
      535f39ce
    • Jinsong Ji's avatar
      [UpdateTestChecks][PowerPC] Avoid empty string when scrubbing loop comments · ee653934
      Jinsong Ji authored
      Summary:
      SCRUB_LOOP_COMMENT_RE was introduced in https://reviews.llvm.org/D31285
      This works for some loops.
      
      However, we may generate lines with loop comments only.
      And since we don't scrub leading white spaces, this will leave an empty
      line there, and FileCheck will complain it.
      
      eg: llvm/test/CodeGen/PowerPC/PR35812-neg-cmpxchg.ll:27:15:
      error: found empty check string with prefix 'CHECK:'
      ; CHECK-NEXT:
      
      This prevented us from using the `update_llc_test_checks.py` for quite some cases.
      
      We should still keep the comment token there, so that we can safely
      scrub the loop comment without breaking FileCheck.
      
      Reviewers: timshen, hfinkel, lebedev.ri, RKSimon
      
      Subscribers: nemanjai, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63957
      
      llvm-svn: 364775
      ee653934
    • Benjamin Kramer's avatar
      4f769361
    • Jan Kratochvil's avatar
      Fix lookup of symbols at the same address with no size vs. size · 3f594ed1
      Jan Kratochvil authored
      This fixes a failing testcase on Fedora 30 x86_64 (regression Fedora 29->30):
      
      PASS:
      ./bin/lldb ./lldb-test-build.noindex/functionalities/unwind/noreturn/TestNoreturnUnwind.test_dwarf/a.out -o 'settings set symbols.enable-external-lookup false' -o r -o bt -o quit
        * frame #0: 0x00007ffff7aa6e75 libc.so.6`__GI_raise + 325
          frame #1: 0x00007ffff7a91895 libc.so.6`__GI_abort + 295
          frame #2: 0x0000000000401140 a.out`func_c at main.c:12:2
          frame #3: 0x000000000040113a a.out`func_b at main.c:18:2
          frame #4: 0x0000000000401134 a.out`func_a at main.c:26:2
          frame #5: 0x000000000040112e a.out`main(argc=<unavailable>, argv=<unavailable>) at main.c:32:2
          frame #6: 0x00007ffff7a92f33 libc.so.6`__libc_start_main + 243
          frame #7: 0x000000000040106e a.out`_start + 46
      
      vs.
      
      FAIL - unrecognized abort() function:
      ./bin/lldb ./lldb-test-build.noindex/functionalities/unwind/noreturn/TestNoreturnUnwind.test_dwarf/a.out -o 'settings set symbols.enable-external-lookup false' -o r -o bt -o quit
        * frame #0: 0x00007ffff7aa6e75 libc.so.6`.annobin_raise.c + 325
          frame #1: 0x00007ffff7a91895 libc.so.6`.annobin_loadmsgcat.c_end.unlikely + 295
          frame #2: 0x0000000000401140 a.out`func_c at main.c:12:2
          frame #3: 0x000000000040113a a.out`func_b at main.c:18:2
          frame #4: 0x0000000000401134 a.out`func_a at main.c:26:2
          frame #5: 0x000000000040112e a.out`main(argc=<unavailable>, argv=<unavailable>) at main.c:32:2
          frame #6: 0x00007ffff7a92f33 libc.so.6`.annobin_libc_start.c + 243
          frame #7: 0x000000000040106e a.out`.annobin_init.c.hot + 46
      
      The extra ELF symbols are there due to Annobin (I did not investigate why this problem happened specifically since F-30 and not since F-28).
      It is due to:
      
      Symbol table '.dynsym' contains 2361 entries:
      Valu e          Size Type   Bind   Vis     Name
      0000000000022769   5 FUNC   LOCAL  DEFAULT _nl_load_domain.cold
      000000000002276e   0 NOTYPE LOCAL  HIDDEN  .annobin_abort.c.unlikely
      ...
      000000000002276e   0 NOTYPE LOCAL  HIDDEN  .annobin_loadmsgcat.c_end.unlikely
      ...
      000000000002276e   0 NOTYPE LOCAL  HIDDEN  .annobin_textdomain.c_end.unlikely
      000000000002276e 548 FUNC   GLOBAL DEFAULT abort
      000000000002276e 548 FUNC   GLOBAL DEFAULT abort@@GLIBC_2.2.5
      000000000002276e 548 FUNC   LOCAL  DEFAULT __GI_abort
      0000000000022992   0 NOTYPE LOCAL  HIDDEN  .annobin_abort.c_end.unlikely
      
      Differential Revision: https://reviews.llvm.org/D63540
      
      llvm-svn: 364773
      3f594ed1