1. Jan 08, 2020
  2. Jan 07, 2020
    • Med Ismail Bennani's avatar
      9daa44c9
    • Sanjay Patel's avatar
      [InstCombine] try to pull 'not' of select into compare operands · f8962571
      Sanjay Patel authored
      not (select ?, (cmp TPred, ?, ?), (cmp FPred, ?, ?) -->
           select ?, (cmp TPred', ?, ?), (cmp FPred', ?, ?)
      
      If both sides of the select are cmps, we can remove an instruction.
      The case where only side is a cmp is deferred to a possible
      follow-on patch.
      
      We have a more general 'isFreeToInvert' analysis, but I'm not seeing
      a way to use that more widely without inducing infinite looping
      (opposing transforms).
      Here, we flip the compare predicates directly, so we should not have
      any danger by creating extra intermediate 'not' ops.
      
      Alive proofs:
      https://rise4fun.com/Alive/jKa
      
      Name: both select values are compares - invert predicates
        %tcmp = icmp sle i32 %x, %y
        %fcmp = icmp ugt i32 %z, %w
        %sel = select i1 %cond, i1 %tcmp, i1 %fcmp
        %not = xor i1 %sel, true
      =>
        %tcmp_not = icmp sgt i32 %x, %y
        %fcmp_not = icmp ule i32 %z, %w
        %not = select i1 %cond, i1 %tcmp_not, i1 %fcmp_not
      
      Name: false val is compare - invert/not
        %fcmp = icmp ugt i32 %z, %w
        %sel = select i1 %cond, i1 %tcmp, i1 %fcmp
        %not = xor i1 %sel, true
      =>
        %tcmp_not = xor i1 %tcmp, -1
        %fcmp_not = icmp ule i32 %z, %w
        %not = select i1 %cond, i1 %tcmp_not, i1 %fcmp_not
      
      Differential Revision: https://reviews.llvm.org/D72007
      f8962571
    • Matt Arsenault's avatar
      e699c03c
    • Matt Arsenault's avatar
      9150d6bd
    • Tim Northover's avatar
      OpaquePtr: print byval types containing anonymous types correctly. · e130eef5
      Tim Northover authored
      Attribute::getAsString doesn't have enough information to print anonymous
      Module-level types correctly, so they come back as "%type 0xabcd". This results
      in broken IR when printing as text.
      
      Instead, print type-attributes (currently just byval) using the TypePrinting
      infrastructure available in AsmWriter. This only applies to function argument
      attributes.
      e130eef5
    • Matt Arsenault's avatar
      llc: Change behavior of -mcpu with existing attribute · f26ed6e4
      Matt Arsenault authored
      Don't overwrite existing target-cpu attributes.
      
      I've often found the replacement behavior annoying, and this is
      inconsistent with how the fast math command line flags interact with
      the function attributes.
      
      Does not yet change target-features, since I think that should behave
      as a concatenation.
      f26ed6e4
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Partially fix llvm.amdgcn.kill pattern import · a428386d
      Matt Arsenault authored
      Tests deferred since the existing DAG test depends on some other
      operations, but isn't far from working as-is.
      a428386d
    • Hans Wennborg's avatar
      [docs] NFC: Fix typos in documents · e334a3a6
      Hans Wennborg authored
      "the the" -> "the"
      "an" -> "a"
      
      Patch by Kazuaki Ishizaki <ishizaki@jp.ibm.com>!
      
      Differential revision: https://reviews.llvm.org/D72091
      e334a3a6
    • Sam Parker's avatar
      [TypePromotion] Use SetVectors instead of PtrSets · 3c7f740f
      Sam Parker authored
      Remove the chance of non-deterministic insertion of zexts of the
      sources by using a SetVector instead of SmallPtrSet. Do the same for
      sinks for consistency and to negate the small issue from possibly
      happening. The SafeWrap instructions are now also stored in a
      SmallVector. The IRPromoter members of these structures have been
      changed to references.
      
      Differential Revision: https://reviews.llvm.org/D72322
      3c7f740f
    • Sanjay Patel's avatar
      [DAGCombiner] reduce shuffle of concat of same vector · 58e2e92a
      Sanjay Patel authored
      This is possibly a small part towards solving PR42024:
      https://bugs.llvm.org/show_bug.cgi?id=42024
      
      The vectorizer is creating shuffles of concat like this:
      
      %63 = shufflevector <4 x i64> %x, <4 x i64> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
      %64 = shufflevector <8 x i64> %63, <8 x i64> undef, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
      
      That might be fixable in the vectorizers, but we're not allowed to fold that into a single shuffle in instcombine,
      so we should have a backend backstop to convert that into the likely simpler form:
      
      %64 = shufflevector <4 x i64> %x, <4 x i64> undef, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
      
      Differential Revision: https://reviews.llvm.org/D72300
      58e2e92a
    • Alexey Bataev's avatar
      [OPENMP]Do not diagnose references to non-integral types for ref in · 3f2e3dc4
      Alexey Bataev authored
      declare simd.
      
      According to the standard, a list-item that appears in a linear clause without the ref modifier must be of integral or pointer type, or must be a reference to an integral or pointer type. Added check that this restriction is applied only to non-ref items.
      3f2e3dc4
    • Kadir Cetinkaya's avatar
      [clangd] Introduce bulletlists · a000f2e5
      Kadir Cetinkaya authored
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D71422
      a000f2e5
    • Sjoerd Meijer's avatar
      [ARM][MVE] VPT Blocks: findVCMPToFoldIntoVPS · e34801c8
      Sjoerd Meijer authored
      This is a recommit of D71330, but with a few things fixed and changed:
      
      1) ReachingDefAnalysis: this was not running with optnone as it was checking
      skipFunction(), which other analysis passes don't do. I guess this is a
      copy-paste from a codegen pass.
      2) VPTBlockPass: here I've added skipFunction(), because like most/all
      optimisations, we don't want to run this with optnone.
      
      This fixes the issues with the initial/previous commit: the VPTBlockPass was
      running with optnone, but ReachingDefAnalysis wasn't, and so VPTBlockPass was
      crashing querying ReachingDefAnalysis.
      
      I've added test case mve-vpt-block-optnone.mir to check that we don't run
      VPTBlock with optnone.
      
      Differential Revision: https://reviews.llvm.org/D71470
      e34801c8
    • Simon Pilgrim's avatar
      [X86] Standardize shuffle match/lowering function names. NFC. · c0365aaa
      Simon Pilgrim authored
      We mainly use lowerShuffle*/matchShuffle* - replace the (few) lowerVectorShuffle*/matchVectorShuffle* cases to be consistent.
      c0365aaa