1. Apr 01, 2019
  2. Mar 31, 2019
    • Sanjay Patel's avatar
      7ac1186b
    • Sanjay Patel's avatar
      [x86] allow movmsk with 2-element reductions · e1bc360f
      Sanjay Patel authored
      One motivation for making this change is that the lack of using movmsk is likely
      a main source of perf difference between clang and gcc on the C-Ray benchmark as
      shown here:
      https://www.phoronix.com/scan.php?page=article&item=gcc-clang-2019&num=5
      ...but this change alone isn't enough to solve that problem.
      
      The 'all-of' examples show what is likely the worst case trade-off: we end up with
      an extra instruction (or 2 if we count the 'xor' register clearing). The 'any-of'
      examples look clearly better using movmsk because we've traded 2 vector instructions
      for 2 scalar instructions, and movmsk may have better timing than the generic 'movq'.
      
      If we examine the llvm-mca output for these cases, it appears that even though the
      'all-of' movmsk variant looks worse on paper, it would perform better on both
      Haswell and Jaguar.
      
        $ llvm-mca -mcpu=haswell no_movmsk.s -timeline
        Iterations:        100
        Instructions:      400
        Total Cycles:      504
        Total uOps:        400
      
        Dispatch Width:    4
        uOps Per Cycle:    0.79
        IPC:               0.79
        Block RThroughput: 1.0
      
        $ llvm-mca -mcpu=haswell movmsk.s -timeline
        Iterations:        100
        Instructions:      600
        Total Cycles:      358
        Total uOps:        600
      
        Dispatch Width:    4
        uOps Per Cycle:    1.68
        IPC:               1.68
        Block RThroughput: 1.5
      
        $ llvm-mca -mcpu=btver2 no_movmsk.s -timeline
        Iterations:        100
        Instructions:      400
        Total Cycles:      407
        Total uOps:        400
      
        Dispatch Width:    2
        uOps Per Cycle:    0.98
        IPC:               0.98
        Block RThroughput: 2.0
      
        $ llvm-mca -mcpu=btver2 movmsk.s -timeline
        Iterations:        100
        Instructions:      600
        Total Cycles:      311
        Total uOps:        600
      
        Dispatch Width:    2
        uOps Per Cycle:    1.93
        IPC:               1.93
        Block RThroughput: 3.0
      
      Finally, there may be CPUs where movmsk is horribly slow (old AMD small cores?), but if
      that's true, then we're also almost certainly making the wrong transform already for
      reductions with >2 elements, so that should be fixed independently.
      
      Differential Revision: https://reviews.llvm.org/D59997
      
      llvm-svn: 357367
      e1bc360f
    • Sanjay Patel's avatar
      [InstCombine] canonicalize select shuffles by commuting · b276dd19
      Sanjay Patel authored
      In PR41304:
      https://bugs.llvm.org/show_bug.cgi?id=41304
      ...we have a case where we want to fold a binop of select-shuffle (blended) values.
      
      Rather than try to match commuted variants of the pattern, we can canonicalize the
      shuffles and check for mask equality with commuted operands.
      
      We don't produce arbitrary shuffle masks in instcombine, but select-shuffles are a
      special case that the backend is required to handle because we already canonicalize
      vector select to this shuffle form.
      
      So there should be no codegen difference from this change. It's possible that this
      improves CSE in IR though.
      
      Differential Revision: https://reviews.llvm.org/D60016
      
      llvm-svn: 357366
      b276dd19
    • Liang Zou's avatar
      fix typo: "\t" => " " · 9f4a4d39
      Liang Zou authored
      Reviewers: llvm.org, Jim
      
      Reviewed By: Jim
      
      Subscribers: arsenm, jvesely, nhaehnle, rupprecht, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59983
      
      llvm-svn: 357365
      9f4a4d39
    • David Chisnall's avatar
      [gnustep-objc] Make the GNUstep v2 ABI work for Windows DLLs. · 7b36a864
      David Chisnall authored
      Summary:
      Based on a patch by Dustin Howett, modified to not change the ABI for
      ELF platforms.
      
      Use more Windows-like section names.
      
      This also makes things more readable by PE/COFF debug tools that assume
      sections fit in the first header.
      
      With these changes in, it is now possible to build a working WinObjC
      with clang and the WinObjC version of GNUstep libobjc (upstream GNUstep
      libobjc + a work around for incremental linking, which can be removed
      once LINK.EXE gains a feature to opt sections out of receiving extra
      padding during an incremental link).
      
      Patch by Dustin Howett!
      
      Reviewers: DHowett-MSFT
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D58724
      
      llvm-svn: 357364
      7b36a864
    • David Chisnall's avatar
      COMDAT-fold block descriptors. · 17d42953
      David Chisnall authored
      Without this change, linking multiple objects containing block
      descriptors together on Windows will generate duplicate symbol errors.
      
      Patch by Dustin Howett!
      
      Differential Revision: https://reviews.llvm.org/D58807
      
      llvm-svn: 357363
      17d42953
    • David Chisnall's avatar
      [objc-gnustep] Use .init_array not .ctors when requested. · 0e9e02cd
      David Chisnall authored
      This doesn't make a difference most of the time but FreeBSD/ARM doesn't
      run anything in the .ctors array.
      
      llvm-svn: 357362
      0e9e02cd
    • Fedor Sergeev's avatar
      SafepointIRVerifier port to new Pass Manager · a2ed448b
      Fedor Sergeev authored
      Straightforward port of StatepointIRVerifier pass to new Pass Manager framework.
      
      Fix By: skatkov
      Reviewed By: fedor.sergeev
      Differential Revision: https://reviews.llvm.org/D59825
      
      This is a re-land of r357147/r357148 with LLVM_ENABLE_MODULES build fixed.
      Adding IR/SafepointIRVerifier.h into its own module.
      
      llvm-svn: 357361
      a2ed448b
    • Luqman Aden's avatar
      7c67dbdc
    • Fangrui Song's avatar
      Range-style std::find{,_if} -> llvm::find{,_if}. NFC · 75e74e07
      Fangrui Song authored
      llvm-svn: 357359
      75e74e07
    • Nico Weber's avatar
      gn build: Merge r357340 · eaf4484e
      Nico Weber authored
      llvm-svn: 357358
      eaf4484e
    • Nico Weber's avatar
      gn build: Merge r357326 · ec04b072
      Nico Weber authored
      llvm-svn: 357357
      ec04b072
    • Nico Weber's avatar
      Rename IncludeFixerTests to ClangIncludeFixerTests and ChangeNamespaceTests to... · a28ee7ec
      Nico Weber authored
      Rename IncludeFixerTests to ClangIncludeFixerTests and ChangeNamespaceTests to ClangChangeNamespaceTests
      
      Follow-up to r356897 and r356254.
      
      llvm-svn: 357356
      a28ee7ec
    • Simon Pilgrim's avatar
      [SystemZ] Remove fcmp undef from reduced test · ec56621a
      Simon Pilgrim authored
      Pre-commit for D60006 (Add fcmp UNDEF handling to SelectionDAG::FoldSetCC)
      
      Approved by @uweigand (Ulrich Weigand)
      
      llvm-svn: 357355
      ec56621a
    • Simon Pilgrim's avatar
      [MIPS] Remove fcmp undef from reduced test · 513e6b9d
      Simon Pilgrim authored
      Pre-commit for D60006 (Add fcmp UNDEF handling to SelectionDAG::FoldSetCC)
      
      Approved by @atanasyan (Simon Atanasyan)
      
      llvm-svn: 357354
      513e6b9d
    • Craig Topper's avatar
      [X86] Teach isel for RMW binops to handle negate · e4a0fc7d
      Craig Topper authored
      Negate updates flags like a subtract. We should be able to use the flags from the RMW form of negate when we have (store (X86ISD::SUB 0, load A), A)
      
      Differential Revision: https://reviews.llvm.org/D60007
      
      llvm-svn: 357353
      e4a0fc7d
    • Alex Bradbury's avatar
      [RISCV] Add codegen support for ilp32f, ilp32d, lp64f, and lp64d ("hard float") ABIs · 0b2803ee
      Alex Bradbury authored
      This patch adds support for the RISC-V hard float ABIs, building on top of
      rL355771, which added basic target-abi parsing and MC layer support. It also
      builds on some re-organisations and expansion of the upstream ABI and calling
      convention tests which were recently committed directly upstream.
      
      A number of aspects of the RISC-V float hard float ABIs require frontend
      support (e.g. flattening of structs and passing int+fp for fp+fp structs in a
      pair of registers), and will be addressed in a Clang patch.
      
      As can be seen from the tests, it would be worthwhile extending
      RISCVMergeBaseOffsets to handle constant pool as well as global accesses.
      
      Differential Revision: https://reviews.llvm.org/D59357
      
      llvm-svn: 357352
      0b2803ee
    • Simon Pilgrim's avatar
      [X86][SSE] detectAVGPattern - Match zext(or(x,y)) 'add like' patterns (PR41316) · 10c9032c
      Simon Pilgrim authored
      Fixes PR41316 where the expanded PAVG intrinsic had had one of its ADDs turned into an OR due to its operands having no conflicting bits.
      
      llvm-svn: 357351
      10c9032c
  3. Mar 30, 2019