1. Nov 01, 2018
  2. Oct 31, 2018
    • Krzysztof Parzyszek's avatar
      [Hexagon] Make sure not to use GP-relative addressing with PIC · 977a1fe5
      Krzysztof Parzyszek authored
      Make sure that -relocation-model=pic prevents use of GP-relative
      addressing modes.
      
      llvm-svn: 345731
      977a1fe5
    • Andrea Di Biagio's avatar
      52578ac6
    • Kadir Cetinkaya's avatar
      Delete dependency on config.h · 8e422d67
      Kadir Cetinkaya authored
      Summary:
      Since llvm/Config/config.h is not available on standalone builds,
      use __USE_POSIX instead of HAVE_PTHREAD_H and get rid of the include.
      
      Reviewers: sammccall
      
      Reviewed By: sammccall
      
      Subscribers: lebedev.ri, krytarowski, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D53935
      
      llvm-svn: 345729
      8e422d67
    • Sanjay Patel's avatar
      [InstSimplify] fold 'fcmp nnan ult X, 0.0' when X is not negative · d4dc30c2
      Sanjay Patel authored
      This is the inverted case for the transform added with D53874 / rL345725.
      
      llvm-svn: 345728
      d4dc30c2
    • Sanjay Patel's avatar
      [InstCombine] add assertion that InstSimplify has folded a fabs+fcmp; NFC · b9fe3fbb
      Sanjay Patel authored
      The 'OLT' case was updated at rL266175, so I assume it was just an
      oversight that 'UGE' was not included because that patch handled
      both predicates in InstSimplify.
      
      llvm-svn: 345727
      b9fe3fbb
    • Kamil Rytarowski's avatar
      Update ioctl(2) operations for NetBSD 8.99.25 · 84484609
      Kamil Rytarowski authored
      Eliminate dropped operations, add new operations.
      
      Update included headers for newer need.
      
      Add a fallback definition of nvlist_ref_t, becaue this type
      is internal to libnpf and the kernel, not exported into public
      headers.
      
      llvm-svn: 345726
      84484609
    • Sanjay Patel's avatar
      [InstSimplify] fold 'fcmp nnan oge X, 0.0' when X is not negative · 85cba3b6
      Sanjay Patel authored
      This re-raises some of the open questions about how to apply and use fast-math-flags in IR from PR38086:
      https://bugs.llvm.org/show_bug.cgi?id=38086
      ...but given the current implementation (no FMF on casts), this is likely the only way to predicate the 
      transform.
      
      This is part of solving PR39475:
      https://bugs.llvm.org/show_bug.cgi?id=39475
      
      Differential Revision: https://reviews.llvm.org/D53874
      
      llvm-svn: 345725
      85cba3b6
    • Kristof Umann's avatar
      [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag · 7d6d9eb6
      Kristof Umann authored
      This is the first part of the implementation of the inclusion of macro
      expansions into the plist output. It adds a new flag that adds a new
      "macro_expansions" entry to each report that has PathDiagnosticPieces that were
      expanded from a macro. While there's an entry for each macro expansion, both
      the name of the macro and what it expands to is missing, and will be implemented
      in followup patches.
      
      Differential Revision: https://reviews.llvm.org/D52742
      
      llvm-svn: 345724
      7d6d9eb6
    • Fedor Sergeev's avatar
      [LoopUnroll] allow customization for new-pass-manager version of LoopUnroll · 412ed347
      Fedor Sergeev authored
      Unlike its legacy counterpart new pass manager's LoopUnrollPass does
      not provide any means to select which flavors of unroll to run
      (runtime, peeling, partial), relying on global defaults.
      
      In some cases having ability to run a restricted LoopUnroll that
      does more than LoopFullUnroll is needed.
      
      Introduced LoopUnrollOptions to select optional unroll behaviors.
      Added 'unroll<peeling>' to PassRegistry mainly for the sake of testing.
      
      Reviewers: chandlerc, tejohnson
      Differential Revision: https://reviews.llvm.org/D53440
      
      llvm-svn: 345723
      412ed347
    • Sanjay Patel's avatar
      [InstSimplify] add tests for fcmp and known positive; NFC · 1cd9917e
      Sanjay Patel authored
      llvm-svn: 345722
      1cd9917e
    • David Bolvansky's avatar
      [DAGCombiner] Fold 0 div/rem X to 0 · d0080c3a
      David Bolvansky authored
      Reviewers: RKSimon, spatel, javed.absar, craig.topper, t.p.northover
      
      Reviewed By: RKSimon
      
      Subscribers: craig.topper, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52504
      
      llvm-svn: 345721
      d0080c3a
    • George Rimar's avatar
      [LLDB] - Removed unused variable. NFC. · 103a0559
      George Rimar authored
      Introduced in r344119.
      
      Thanks to Dávid Bolvanský fo reporting.
      
      llvm-svn: 345720
      103a0559
    • Nicolai Haehnle's avatar
      AMDGPU: Rewrite SILowerI1Copies to always stay on SALU · 814abb59
      Nicolai Haehnle authored
      Summary:
      Instead of writing boolean values temporarily into 32-bit VGPRs
      if they are involved in PHIs or are observed from outside a loop,
      we use bitwise masking operations to combine lane masks in a way
      that is consistent with wave control flow.
      
      Move SIFixSGPRCopies to before this pass, since that pass
      incorrectly attempts to move SGPR phis to VGPRs.
      
      This should recover most of the code quality that was lost with
      the bug fix in "AMDGPU: Remove PHI loop condition optimization".
      
      There are still some relevant cases where code quality could be
      improved, in particular:
      
      - We often introduce redundant masks with EXEC. Ideally, we'd
        have a generic computeKnownBits-like analysis to determine
        whether masks are already masked by EXEC, so we can avoid this
        masking both here and when lowering uniform control flow.
      
      - The criterion we use to determine whether a def is observed
        from outside a loop is conservative: it doesn't check whether
        (loop) branch conditions are uniform.
      
      Change-Id: Ibabdb373a7510e426b90deef00f5e16c5d56e64b
      
      Reviewers: arsenm, rampitec, tpr
      
      Subscribers: kzhuravl, jvesely, wdng, mgorny, yaxunl, dstuttard, t-tye, eraman, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53496
      
      llvm-svn: 345719
      814abb59
    • Nicolai Haehnle's avatar
      AMDGPU: Remove PHI loop condition optimization · 28212cc6
      Nicolai Haehnle authored
      
      
      Summary:
      The optimization to early break out of loops if all threads are dead was
      never fully implemented.
      
      But the PHI node analyzing is actually causing a number of problems, so
      remove all the extra code for it.
      
      (This does actually regress code quality in a few places because it
       ends up relying more heavily on phi's of i1, which we don't do a
       great job with. However, since it fixes real bugs in the wild, we
       should take this change. I have some prototype changes to improve
       i1 lowering in general -- not just for control flow -- which should
       help recover the code quality, I just need to make those changes
       fit for general consumption. -- Nicolai)
      
      Change-Id: I6fc6c6c8961857ac6009fcfb9f7e5e48dc23fbb1
      Patch-by: default avatarChristian König <christian.koenig@amd.com>
      
      Reviewers: arsenm, rampitec, tpr
      
      Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53359
      
      llvm-svn: 345718
      28212cc6
    • Sanjay Patel's avatar
      [InstSimplify] fold icmp based on range of abs/nabs · 2efccd2c
      Sanjay Patel authored
      This is a fix for PR39475:
      https://bugs.llvm.org/show_bug.cgi?id=39475
      
      We managed to get some of these patterns using computeKnownBits in D47041, but that 
      can't be used for nabs(). Instead, put in some range-based logic, so we can fold 
      both abs/nabs with icmp with a constant value.
      
      Alive proofs:
      https://rise4fun.com/Alive/21r
      
      Name: abs_nsw_is_positive
        %cmp = icmp slt i32 %x, 0
        %negx = sub nsw i32 0, %x
        %abs = select i1 %cmp, i32 %negx, i32 %x
        %r = icmp sgt i32 %abs, -1
          =>
        %r = i1 true
       
      Name: abs_nsw_is_not_negative
        %cmp = icmp slt i32 %x, 0
        %negx = sub nsw i32 0, %x
        %abs = select i1 %cmp, i32 %negx, i32 %x
        %r = icmp slt i32 %abs, 0
          =>
        %r = i1 false
       
      Name: nabs_is_negative_or_0
        %cmp = icmp slt i32 %x, 0
        %negx = sub i32 0, %x
        %nabs = select i1 %cmp, i32 %x, i32 %negx
        %r = icmp slt i32 %nabs, 1
          =>
        %r = i1 true
      
      Name: nabs_is_not_over_0
        %cmp = icmp slt i32 %x, 0
        %negx = sub i32 0, %x
        %nabs = select i1 %cmp, i32 %x, i32 %negx
        %r = icmp sgt i32 %nabs, 0
          =>
        %r = i1 false
      
      Differential Revision: https://reviews.llvm.org/D53844
      
      llvm-svn: 345717
      2efccd2c
    • Sam McCall's avatar
      [clang-tidy] Remove false decoupling in ClangTidyContext. NFC · dd2120c0
      Sam McCall authored
      These getters/setters don't encapsulate any behavior, and can only be
      called by friends.
      
      llvm-svn: 345716
      dd2120c0
    • Kamil Rytarowski's avatar
      Update generate_netbsd_ioctls.awk for NetBSD 8.99.25 · ec37188a
      Kamil Rytarowski authored
      Add dynamic detection of header files in /usr/include.
      Handle "nvlist_ref_t" needed by npf(4) ioctl(2) operations.
      
      llvm-svn: 345715
      ec37188a
    • Andrea Di Biagio's avatar
      [tblgen][PredicateExpander] Add the ability to describe more complex... · 3d2b7176
      Andrea Di Biagio authored
      [tblgen][PredicateExpander] Add the ability to describe more complex constraints on instruction operands.
      
      Before this patch, class PredicateExpander only knew how to expand simple
      predicates that performed checks on instruction operands.
      In particular, the new scheduling predicate syntax was not rich enough to
      express checks like this one:
      
        Foo(MI->getOperand(0).getImm()) == ExpectedVal;
      
      Here, the immediate operand value at index zero is passed in input to function
      Foo, and ExpectedVal is compared against the value returned by function Foo.
      
      While this predicate pattern doesn't show up in any X86 model, it shows up in
      other upstream targets. So, being able to support those predicates is
      fundamental if we want to be able to modernize all the scheduling models
      upstream.
      
      With this patch, we allow users to specify if a register/immediate operand value
      needs to be passed in input to a function as part of the predicate check. Now,
      register/immediate operand checks all derive from base class CheckOperandBase.
      
      This patch also changes where TIIPredicate definitions are expanded by the
      instructon info emitter. Before, definitions were expanded in class
      XXXGenInstrInfo (where XXX is a target name).
      With the introduction of this new syntax, we may want to have TIIPredicates
      expanded directly in XXXInstrInfo. That is because functions used by the new
      operand predicates may only exist in the derived class (i.e. XXXInstrInfo).
      
      This patch is a non functional change for the existing scheduling models.
      In future, we will be able to use this richer syntax to better describe complex
      scheduling predicates, and expose them to llvm-mca.
      
      Differential Revision: https://reviews.llvm.org/D53880
      
      llvm-svn: 345714
      3d2b7176