Skip to content
  1. Nov 18, 2018
  2. Nov 17, 2018
  3. Nov 16, 2018
  4. Nov 15, 2018
  5. Nov 14, 2018
  6. Nov 13, 2018
    • Sanjay Patel's avatar
      [InstCombine] canonicalize rotate patterns with cmp/select · f8f12272
      Sanjay Patel authored
      The cmp+branch variant of this pattern is shown in:
      https://bugs.llvm.org/show_bug.cgi?id=34924
      ...and as discussed there, we probably can't transform
      that without a rotate intrinsic. We do have that now
      via funnel shift, but we're not quite ready to 
      canonicalize IR to that form yet. The case with 'select'
      should already be transformed though, so that's this patch.
      
      The sequence with negation followed by masking is what we
      use in the backend and partly in clang (though that part 
      should be updated).
      
      https://rise4fun.com/Alive/TplC
        %cmp = icmp eq i32 %shamt, 0
        %sub = sub i32 32, %shamt
        %shr = lshr i32 %x, %shamt
        %shl = shl i32 %x, %sub
        %or = or i32 %shr, %shl
        %r = select i1 %cmp, i32 %x, i32 %or
        =>
        %neg = sub i32 0, %shamt
        %masked = and i32 %shamt, 31
        %maskedneg = and i32 %neg, 31
        %shl2 = lshr i32 %x, %masked
        %shr2 = shl i32 %x, %maskedneg
        %r = or i32 %shl2, %shr2
      
      llvm-svn: 346807
      f8f12272
    • Florian Hahn's avatar
      [CSP, Cloning] Update DuplicateInstructionsInSplitBetween to use DomTreeUpdater. · 107d0a87
      Florian Hahn authored
      This patch updates DuplicateInstructionsInSplitBetween to update a DTU
      instead of applying updates to the DT directly.
      
      Given that there only are 2 users, also updated them in this patch to
      avoid churn.
      
      I slightly moved the code in CallSiteSplitting around to reduce the
      places where we have to pass in DTU. If necessary, I could split those
      changes in a separate patch.
      
      This fixes missing DT updates when dealing with musttail calls in
      CallSiteSplitting, by using DTU->deleteBB.
      
      Reviewers: junbuml, kuhar, NutshellySima, indutny, brzycki
      
      Reviewed By: NutshellySima
      
      llvm-svn: 346769
      107d0a87
    • Steven Wu's avatar
      Revert "[ThinLTO] Internalize readonly globals" · fa43892d
      Steven Wu authored
      This reverts commit 10c84a8f35cae4a9fc421648d9608fccda3925f2.
      
      llvm-svn: 346768
      fa43892d
    • Florian Hahn's avatar
      [VPlan] VPlan version of InterleavedAccessInfo. · a4dc7fee
      Florian Hahn authored
      This patch turns InterleaveGroup into a template with the instruction type
      being a template parameter. It also adds a VPInterleavedAccessInfo class, which
      only contains a mapping from VPInstructions to their respective InterleaveGroup.
      As we do not have access to scalar evolution in VPlan, we can re-use
      convert InterleavedAccessInfo to VPInterleavedAccess info.
      
      
      Reviewers: Ayal, mssimpso, hfinkel, dcaballe, rengolin, mkuper, hsaito
      
      Reviewed By: rengolin
      
      Differential Revision: https://reviews.llvm.org/D49489
      
      llvm-svn: 346758
      a4dc7fee
    • Zhizhou Yang's avatar
      Introduce DebugCounter into ConstProp pass · cc633af5
      Zhizhou Yang authored
      Summary:
      This patch introduces DebugCounter into ConstProp pass at per-transformation level.
      
      It will provide an option to skip first n or stop after n transformations for the whole ConstProp pass.
      
      This will make debug easier for the pass, also providing chance to do transformation level bisecting.
      
      Reviewers: davide, fhahn
      
      Reviewed By: fhahn
      
      Subscribers: llozano, george.burgess.iv, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50094
      
      llvm-svn: 346720
      cc633af5
  7. Nov 12, 2018
    • Sanjay Patel's avatar
      [InstCombine] narrow width of rotate patterns, part 3 · 35b1c2d1
      Sanjay Patel authored
      This is a longer variant for the pattern handled in
      rL346713 
      This one includes zexts. 
      
      Eventually, we should canonicalize all rotate patterns 
      to the funnel shift intrinsics, but we need a bit more
      infrastructure to make sure the vectorizers handle those
      intrinsics as well as the shift+logic ops.
      
      https://rise4fun.com/Alive/FMn
      
      Name: narrow rotateright
        %neg = sub i8 0, %shamt
        %rshamt = and i8 %shamt, 7
        %rshamtconv = zext i8 %rshamt to i32
        %lshamt = and i8 %neg, 7
        %lshamtconv = zext i8 %lshamt to i32
        %conv = zext i8 %x to i32
        %shr = lshr i32 %conv, %rshamtconv
        %shl = shl i32 %conv, %lshamtconv
        %or = or i32 %shl, %shr
        %r = trunc i32 %or to i8
        =>
        %maskedShAmt2 = and i8 %shamt, 7
        %negShAmt2 = sub i8 0, %shamt
        %maskedNegShAmt2 = and i8 %negShAmt2, 7
        %shl2 = lshr i8 %x, %maskedShAmt2
        %shr2 = shl i8 %x, %maskedNegShAmt2
        %r = or i8 %shl2, %shr2
      llvm-svn: 346716
      35b1c2d1
    • Sanjay Patel's avatar
      [InstCombine] narrow width of rotate patterns, part 2 (PR39624) · 98e427cc
      Sanjay Patel authored
      The sub-pattern for the shift amount in a rotate can take on
      several different forms, and there's apparently no way to
      canonicalize those without seeing the entire rotate sequence.
      
      This is the form noted in:
      https://bugs.llvm.org/show_bug.cgi?id=39624
      
      https://rise4fun.com/Alive/qnT
      
        %zx = zext i8 %x to i32
        %maskedShAmt = and i32 %shAmt, 7
        %shl = shl i32 %zx, %maskedShAmt
        %negShAmt = sub i32 0, %shAmt
        %maskedNegShAmt = and i32 %negShAmt, 7
        %shr = lshr i32 %zx, %maskedNegShAmt
        %rot = or i32 %shl, %shr
        %r = trunc i32 %rot to i8
        =>
        %truncShAmt = trunc i32 %shAmt to i8
        %maskedShAmt2 = and i8 %truncShAmt, 7
        %shl2 = shl i8 %x, %maskedShAmt2
        %negShAmt2 = sub i8 0, %truncShAmt
        %maskedNegShAmt2 = and i8 %negShAmt2, 7
        %shr2 = lshr i8 %x, %maskedNegShAmt2
        %r = or i8 %shl2, %shr2
      
      llvm-svn: 346713
      98e427cc
    • Sanjay Patel's avatar
      [InstCombine] refactor code for matching shift amount of a rotate; NFC · ceab2329
      Sanjay Patel authored
      As shown in existing test cases and with:
      https://bugs.llvm.org/show_bug.cgi?id=39624
      ...we're missing at least 2 more patterns for rotate narrowing.
      
      llvm-svn: 346711
      ceab2329
    • Philip Reames's avatar
      [GC][InstCombine] Fix a potential iteration issue · b8d8db30
      Philip Reames authored
      Noticed via inspection.  Appears to be largely innocious in practice, but slight code change could have resulted in either visit order dependent missed optimizations or infinite loops.  May be a minor compile time problem today.
      
      llvm-svn: 346698
      b8d8db30
    • Simon Pilgrim's avatar
      [CostModel] Add more realistic SK_ExtractSubvector generic costs. · 631f2bf5
      Simon Pilgrim authored
      Instead of defaulting to a cost = 1, expand to element extract/insert like we do for other shuffles.
      
      This exposes an issue in LoopVectorize which could call SK_ExtractSubvector with a scalar subvector type.
      
      llvm-svn: 346656
      631f2bf5
    • Max Kazantsev's avatar
      [LICM] Hoist guards from non-header blocks · 7d49a3a8
      Max Kazantsev authored
      This patch relaxes overconservative checks on whether or not we could write
      memory before we execute an instruction. This allows us to hoist guards out of
      loops even if they are not in the header block.
      
      Differential Revision: https://reviews.llvm.org/D50891
      Reviewed By: fedor.sergeev
      
      llvm-svn: 346643
      7d49a3a8
    • Calixte Denizet's avatar
      [GCOV] Add options to filter files which must be instrumented. · c6fabeac
      Calixte Denizet authored
      Summary:
      When making code coverage, a lot of files (like the ones coming from /usr/include) are removed when post-processing gcno/gcda so finally they doen't need to be instrumented nor to appear in gcno/gcda.
      The goal of the patch is to be able to filter the files we want to instrument, there are several advantages to do that:
      - improve speed (no overhead due to instrumentation on files we don't care)
      - reduce gcno/gcda size
      - it gives the possibility to easily instrument only few files (e.g. ones modified in a patch) without changing the build system
      - need to accept this patch to be enabled in clang: https://reviews.llvm.org/D52034
      
      Reviewers: marco-c, vsk
      
      Reviewed By: marco-c
      
      Subscribers: llvm-commits, sylvestre.ledru
      
      Differential Revision: https://reviews.llvm.org/D52033
      
      llvm-svn: 346641
      c6fabeac
  8. Nov 11, 2018
  9. Nov 10, 2018
  10. Nov 09, 2018
  11. Nov 08, 2018
    • Florian Hahn's avatar
      [LoopInterchange] Support reductions across inner and outer loop. · a684a994
      Florian Hahn authored
      This patch adds logic to detect reductions across the inner and outer
      loop by following the incoming values of PHI nodes in the outer loop. If
      the incoming values take part in a reduction in the inner loop or come
      from outside the outer loop, we found a reduction spanning across inner
      and outer loop.
      
      With this change, ~10% more loops are interchanged in the LLVM
      test-suite + SPEC2006.
      
      Fixes https://bugs.llvm.org/show_bug.cgi?id=30472
      
      Reviewers: mcrosier, efriedma, karthikthecool, davide, hfinkel, dmgreen
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D43245
      
      llvm-svn: 346438
      a684a994
    • Pirama Arumuga Nainar's avatar
      [LTO] Drop non-prevailing definitions only if linkage is not local or appending · e61652a3
      Pirama Arumuga Nainar authored
      Summary:
      This fixes PR 37422
      
      In ELF, non-weak symbols can also be non-prevailing.  In this particular
      PR, the __llvm_profile_* symbols are non-prevailing but weren't getting
      dropped - causing multiply-defined errors with lld.
      
      Also add a test, strong_non_prevailing.ll, to ensure that multiple
      copies of a strong symbol are dropped.
      
      To fix the test regressions exposed by this fix,
      - do not mark prevailing copies for symbols with 'appending' linkage.
      There's no one prevailing copy for such symbols.
      - fix the prevailing version in dead-strip-fulllto.ll
      - explicitly pass exported symbols to llvm-lto in fumcimport.ll and
      funcimport_var.ll
      
      Reviewers: tejohnson, pcc
      
      Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith,
      dang, srhines, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D54125
      
      llvm-svn: 346436
      e61652a3
Loading