Skip to content
  1. Nov 21, 2017
  2. Nov 20, 2017
    • Fedor Sergeev's avatar
      [Sparc] efficient pattern for UINT_TO_FP conversion · a476117e
      Fedor Sergeev authored
      Summary:
              while investigating performance degradation of imagick benchmark
              there were found inefficient pattern for UINT_TO_FP conversion.
              That pattern causes RAW hazard in assembly code. Specifically,
              uitofp IR operator results in poor assembler :
      
              st          %i0, [%fp - 952]
              ldd         [%fp - 952], %f0
      
              it stores 32-bit integer register into memory location and then
              loads 64-bit floating point data from that location.
              That is exactly RAW hazard case. To optimize that case it is
              possible to use SPISD::ITOF and SPISD::XTOF for conversion from
              integer to floating point data type and to use ISD::BITCAST to
              copy from integer register into floating point register.
              The fix is to write custom UINT_TO_FP pattern using SPISD::ITOF,
              SPISD::XTOF, ISD::BITCAST.
      
      Patch by Alexey Lapshin
      
      Reviewers: fedor.sergeev, jyknight, dcederman, lero_chris
      
      Reviewed By: jyknight
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D36875
      
      llvm-svn: 318704
      a476117e
    • David Blaikie's avatar
      Add ADL support to range based <algorithm> extensions · 2bc260ab
      David Blaikie authored
      This adds support for ADL in the range based <algorithm> extensions
      (llvm::for_each etc.).
      
      Also adds the helper functions llvm::adl::begin and llvm::adl::end which wrap
      std::begin and std::end with ADL support.
      
      Saw this was missing from a recent llvm weekly post about adding llvm::for_each
      and thought I might add it.
      
      Patch by Stephen Dollberg!
      
      Differential Revision: https://reviews.llvm.org/D40006
      
      llvm-svn: 318703
      2bc260ab
    • Zachary Turner's avatar
      Resubmit "Refactor debuginfo-tests" again. · 8b6ef88e
      Zachary Turner authored
      This was reverted due to the tests being run twice on some
      build bots.  Each run had a slightly different configuration
      due to the way in which it was being invoked.  This fixes
      the problem (albeit in a somewhat hacky way).  Hopefully in
      the future we can get rid of the workflow of running
      debuginfo-tests as part of clang, and then this hack can
      go away.
      
      llvm-svn: 318697
      8b6ef88e
    • Hiroshi Yamauchi's avatar
      Fix a lld-x86_64-darwin13 build error. · 5c774b92
      Hiroshi Yamauchi authored
      Summary:
      Fix this build error
      
      http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/15112/steps/build_Lld/logs/stdio
      
      after https://reviews.llvm.org/rL318693
      
      Reviewers: davidxl
      
      Reviewed By: davidxl
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D40266
      
      llvm-svn: 318696
      5c774b92
    • Yonghong Song's avatar
      bpf: add a test case for trunc-op optimization · a4de6d86
      Yonghong Song authored
      
      
      Commit b5cbc7760ab8 ("[bpf] allow direct and indirect calls")
      allowed more than one function in the bpf program, and
      commit 114353884415 ("bpf: fix a bug in trunc-op optimization")
      fixed a bug in trunc-op optimization which only showed up
      with more than one function in the bpf program.
      
      This patch added a test case for trunc-op optimization
      for bpf programs with two functions. Reverting commit
      "bpf: fix a bug in trunc-op optimization" will cause
      failure for this test case.
      
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      llvm-svn: 318695
      a4de6d86
    • Hiroshi Yamauchi's avatar
      Add heuristics for irreducible loop metadata under PGO · c94d4d70
      Hiroshi Yamauchi authored
      Summary:
      Add the following heuristics for irreducible loop metadata:
      
      - When an irreducible loop header is missing the loop header weight metadata,
        give it the minimum weight seen among other headers.
      - Annotate indirectbr targets with the loop header weight metadata (as they are
        likely to become irreducible loop headers after indirectbr tail duplication.)
      
      These greatly improve the accuracy of the block frequency info of the Python
      interpreter loop (eg. from ~3-16x off down to ~40-55% off) and the Python
      performance (eg. unpack_sequence from ~50% slower to ~8% faster than GCC) due to
      better register allocation under PGO.
      
      Reviewers: davidxl
      
      Reviewed By: davidxl
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D39980
      
      llvm-svn: 318693
      c94d4d70
    • Simon Pilgrim's avatar
      Fix spelling in comment. NFCI. · c179c39e
      Simon Pilgrim authored
      llvm-svn: 318687
      c179c39e
    • Mandeep Singh Grang's avatar
      Revert "[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering" · f953e4b8
      Mandeep Singh Grang authored
      This broke the bots. Reverting this until I can fix the failures.
      
      This reverts commit 5a3db2856d12a3c4b400f487d39f8f05989e79f0.
      
      llvm-svn: 318686
      f953e4b8
    • Evandro Menezes's avatar
      [AArch64] Adjust the cost model for Exynos M1 and M2 · 46f672b7
      Evandro Menezes authored
      Fix the modeling of test and branch.
      
      llvm-svn: 318685
      46f672b7
    • Paul Robinson's avatar
      Revert "Fix out-of-order stepping behavior in programs with sunk instructions." · 746edea0
      Paul Robinson authored
      This reverts commit 30419e150cd940893a13b345e85f96053850208f.
      aka r318679.  It caused "sanitizer-windows" bot to fail.
      
      llvm-svn: 318684
      746edea0
    • Mandeep Singh Grang's avatar
      [SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering · dc9de509
      Mandeep Singh Grang authored
      Summary:
      This fixes failures in the following tests uncovered by D39245:
              LLVM :: CodeGen/ARM/ifcvt3.ll
              LLVM :: CodeGen/ARM/switch-minsize.ll
              LLVM :: CodeGen/X86/switch.ll
      
      Reviewers: hans, efriedma
      
      Reviewed By: hans
      
      Subscribers: fhahn, aemerson, kristof.beyls, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D39995
      
      llvm-svn: 318680
      dc9de509
    • Paul Robinson's avatar
      Fix out-of-order stepping behavior in programs with sunk instructions. · f0b02965
      Paul Robinson authored
      MachineSink attempts to place instructions near the basic blocks where
      they are needed.  Once an instruction has been sunk, its location
      relative to other instructions is no longer consistent with the
      original source code. In order to ensure correct single-stepping and
      profiling, the debug location for sunk instructions is either merged
      with the insertion point or erased if the target successor block is
      empty.
      
      Patch by Matthew Voss!
      
      Differential Revision: https://reviews.llvm.org/D39933
      
      llvm-svn: 318679
      f0b02965
    • Nirav Dave's avatar
      [X86] Avoid unecessary opsize byte in segment move to memory · 36690612
      Nirav Dave authored
      Summary:
      
      Segment moves to memory are always 16-bit. Remove invalid 32 and 64
      bit variants.
      
      Fixes PR34478.
      
      Reviewers: rnk, craig.topper
      
      Subscribers: llvm-commits, hiraditya
      
      Differential Revision: https://reviews.llvm.org/D39847
      
      llvm-svn: 318678
      36690612
    • Teresa Johnson's avatar
      [SROA] Correctly invalidate analyses when dead instructions deleted · 3309002a
      Teresa Johnson authored
      Summary:
      SROA can fail in rewriting alloca but still rewrite a phi resulting
      in dead instruction elimination. The Changed flag was not being set
      correctly, resulting in downstream passes using stale analyses.
      The included test case will assert during the second BDCE pass as a
      result.
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D39921
      
      llvm-svn: 318677
      3309002a
    • Dmitry Preobrazhensky's avatar
      [AMDGPU][MC][GFX8][GFX9] Corrected names of integer v_{add/addc/sub/subrev/subb/subbrev} · a0342dc9
      Dmitry Preobrazhensky authored
      See bug 34765: https://bugs.llvm.org//show_bug.cgi?id=34765
      
      Reviewers: tamazov, SamWot, arsenm, vpykhtin
      
      Differential Revision: https://reviews.llvm.org/D40088
      
      llvm-svn: 318675
      a0342dc9
    • Evgeniy Stepanov's avatar
      [asan] Use dynamic shadow on 32-bit Android, try 2. · 8e7018d9
      Evgeniy Stepanov authored
      Summary:
      This change reverts r318575 and changes FindDynamicShadowStart() to
      keep the memory range it found mapped PROT_NONE to make sure it is
      not reused. We also skip MemoryRangeIsAvailable() check, because it
      is (a) unnecessary, and (b) would fail anyway.
      
      Reviewers: pcc, vitalybuka, kcc
      
      Subscribers: srhines, kubamracek, mgorny, llvm-commits, hiraditya
      
      Differential Revision: https://reviews.llvm.org/D40203
      
      llvm-svn: 318666
      8e7018d9
    • Tony Jiang's avatar
      [MachineCSE] Add new callback for is caller preserved or constant physregs · f75f4d65
      Tony Jiang authored
      The instructions addis,addi, bl are used to calculate the address of TLS thread
      local variables. These TLS access code sequences are generated repeatedly every
      time the thread local variable is accessed. By communicating to Machine CSE that
      X2 is guaranteed to have the same value within the same function call (so called
      Caller Preserved Physical Register), the redundant TLS access code sequences are
      cleaned up.
      
      Differential Revision: https://reviews.llvm.org/D39173
      
      llvm-svn: 318661
      f75f4d65
    • Yaxun Liu's avatar
      [AMDGPU] Update test r600.amdgpu-alias-analysis.ll · 45d25e12
      Yaxun Liu authored
      Manually update test r600.amdgpu-alias-analysis.ll for amdgiz environment
      since it cannot be done by script.
      
      The two pointers are swapped in the output because PrintResults in
      AliasAnalysisEvaluator.cpp sorts the strings obtained from printAsOperand
      before printing them.
      
      Differential Revision: https://reviews.llvm.org/D40131
      
      llvm-svn: 318660
      45d25e12
    • Simon Dardis's avatar
      [mips] Reorder target specific passes · 1631d6ce
      Simon Dardis authored
      Move the hazard scheduling pass to after the long branch pass, as the
      long branch pass can create forbiddden slot hazards. Rather than complicating
      the implementation of the long branch pass to handle forbidden slot hazards,
      just reorder the passes.
      
      llvm-svn: 318657
      1631d6ce
    • Jonas Paulsson's avatar
      [SystemZ] Bugfix for handling of subregisters in getRegAllocationHints(). · 12e3a588
      Jonas Paulsson authored
      The 32 bit subreg indices of GR128 registers must also be checked for in
      getRC32().
      
      Review: Ulrich Weigand.
      llvm-svn: 318652
      12e3a588
    • Tony Jiang's avatar
      [PPC] Heuristic to choose between a X-Form VSX ld/st vs a X-Form FP ld/st. · 438bf4a6
      Tony Jiang authored
      The VSX versions have the advantage of a full 64-register target whereas the FP
      ones have the advantage of lower latency and higher throughput. So what we’re
      after is using the faster instructions in low register pressure situations and
      using the larger register file in high register pressure situations.
      
      The heuristic chooses between the following 7 pairs of instructions.
      PPC::LXSSPX vs PPC::LFSX
      PPC::LXSDX vs PPC::LFDX
      PPC::STXSSPX vs PPC::STFSX
      PPC::STXSDX vs PPC::STFDX
      PPC::LXSIWAX vs PPC::LFIWAX
      PPC::LXSIWZX vs PPC::LFIWZX
      PPC::STXSIWX vs PPC::STFIWX
      
      Differential Revision: https://reviews.llvm.org/D38486
      
      llvm-svn: 318651
      438bf4a6
    • Sander de Smalen's avatar
      [AArch64][TableGen] Skip tied result operands for InstAlias · 0c5a29b6
      Sander de Smalen authored
      Summary:
      This patch fixes an issue so that the right alias is printed when the instruction has tied operands. It checks the number of operands in the resulting instruction as opposed to the alias, and then skips over tied operands that should not be printed in the alias.
      
      This allows to generate the preferred assembly syntax for the AArch64 'ins' instruction, which should always be displayed as 'mov' according to the ARM Architecture Reference Manual. Several unit tests have changed as a result, but only to reflect the preferred disassembly. Some other InstAlias patterns (movk/bic/orr) needed a slight adjustment to stop them becoming the default and breaking other unit tests.
      
      Please note that the patch is mostly the same as https://reviews.llvm.org/D29219 which was reverted because of an issue found when running TableGen with the Address Sanitizer. That issue has been addressed in this iteration of the patch.
      
      
      Reviewers: rengolin, stoklund, huntergr, SjoerdMeijer, rovka
      
      Reviewed By: rengolin, SjoerdMeijer
      
      Subscribers: fhahn, aemerson, javed.absar, kristof.beyls, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D40030
      
      llvm-svn: 318650
      0c5a29b6
    • Valery Pykhtin's avatar
    • Gil Rapaport's avatar
      [LV] Model masking in VPlan, introducing VPInstructions · 8b9d1f3c
      Gil Rapaport authored
      This patch adds a new abstraction layer to VPlan and leverages it to model the planned
      instructions that manipulate masks (AND, OR, NOT), introduced during predication.
      
      The new VPValue and VPUser classes model how data flows into, through and out
      of a VPlan, forming the vertices of a planned Def-Use graph. The new
      VPInstruction class is a generic single-instruction Recipe that models a
      planned instruction along with its opcode, operands and users. See
      VectorizationPlan.rst for more details.
      
      Differential Revision: https://reviews.llvm.org/D38676
      
      llvm-svn: 318645
      8b9d1f3c
    • Diana Picus's avatar
      [ARM GlobalISel] Add test for RSBri. NFC · 3ac50403
      Diana Picus authored
      Add instruction selector test for RSBri, which is derived from
      AsI1_rbin_irs, and make sure it doesn't get mistaken for SUBri, which is
      derived from the very similar AsI1_bin_irs pattern.
      
      llvm-svn: 318643
      3ac50403
    • Diana Picus's avatar
      [ARM GlobalISel] Clean up binary operator tests. NFC · 6db48f7d
      Diana Picus authored
      Remove some of the instruction selector tests for binary operators (and,
      or, xor). These are all derived from the same kind of TableGen pattern,
      AsI1_bin_irs, so there's no point in testing all of them.
      
      llvm-svn: 318642
      6db48f7d
    • Mohammed Agabaria's avatar
      [LV][X86] Support of AVX2 Gathers code generation and update the LV with this · 115f68ea
      Mohammed Agabaria authored
      This patch depends on: https://reviews.llvm.org/D35348
      
      Support of pattern selection of masked gathers of AVX2 (X86\AVX2 code gen)
      Update LoopVectorize to generate gathers for AVX2 processors.
      
      Reviewers: delena, zvi, RKSimon, craig.topper, aaboud, igorb
      
      Reviewed By: delena, RKSimon
      
      Differential Revision: https://reviews.llvm.org/D35772
      
      llvm-svn: 318641
      115f68ea
    • Craig Topper's avatar
      [X86] Regenerate a test with broadcast comments. NFC · 198f7d78
      Craig Topper authored
      llvm-svn: 318640
      198f7d78
    • Max Kazantsev's avatar
      [IRCE] Smart range intersection · 26846786
      Max Kazantsev authored
      In rL316552, we ban intersection of unsigned latch range with signed range check and vice
      versa, unless the entire range check iteration space is known positive. It was a correct
      functional fix that saved us from dealing with ambiguous values, but it also appeared
      to be a very restrictive limitation. In particular, in the following case:
      
        loop:
          %iv = phi i32 [ 0, %preheader ], [ %iv.next, %latch]
          %iv.offset = add i32 %iv, 10
          %rc = icmp slt i32 %iv.offset, %len
          br i1 %rc, label %latch, label %deopt
      
        latch:
          %iv.next = add i32 %iv, 11
          %cond = icmp i32 ult %iv.next, 100
          br it %cond, label %loop, label %exit
      
      Here, the unsigned iteration range is `[0, 100)`, and the safe range for range
      check is `[-10, %len - 10)`. For unsigned iteration spaces, we use unsigned
      min/max functions for range intersection. Given this, we wanted to avoid dealing
      with `-10` because it is interpreted as a very big unsigned value. Semantically, range
      check's safe range goes through unsigned border, so in fact it is two disjoint
      ranges in IV's iteration space. Intersection of such ranges is not trivial, so we prohibited
      this case saying that we are not allowed to intersect such ranges.
      
      What semantics of this safe range actually means is that we can start from `-10` and go
      up increasing the `%iv` by one until we reach `%len - 10` (for simplicity let's assume that
      `%len - 10`  is a reasonably big positive value).
      
      In particular, this safe iteration space includes `0, 1, 2, ..., %len - 11`. So if we were able to return
      safe iteration space `[0, %len - 10)`, we could safely intersect it with IV's iteration space. All
      values in this range are non-negative, so using signed/unsigned min/max for them is unambiguous.
      
      In this patch, we alter the algorithm of safe range calculation so that it returnes a subset of the
      original safe space which is represented by one continuous range that does not go through wrap.
      In order to reach this, we use modified SCEV substraction function. It can be imagined as a function
      that substracts by `1` (or `-1`) as long as the further substraction does not cause a wrap in IV iteration
      space. This allows us to perform IRCE in many situations when we deal with IV space and range check
      of different types (in terms of signed/unsigned).
      
      We apply this approach for both matching and not matching types of IV iteration space and the
      range check. One implication of this is that now IRCE became smarter in detection of empty safe
      ranges. For example, in this case:
        loop:
          %iv = phi i32 [ %begin, %preheader ], [ %iv.next, %latch]
          %iv.offset = sub i32 %iv, 10
          %rc = icmp ult i32 %iv.offset, %len
          br i1 %rc, label %latch, label %deopt
      
        latch:
          %iv.next = add i32 %iv, 11
          %cond = icmp i32 ult %iv.next, 100
          br it %cond, label %loop, label %exit
      
      If `%len` was less than 10 but SCEV failed to trivially prove that `%begin - 10 >u %len- 10`,
      we could end up executing entire loop in safe preloop while the main loop was still generated,
      but never executed. Now, cutting the ranges so that if both `begin - 10` and `%len - 10` overflow,
      we have a trivially empty range of `[0, 0)`. This in some cases prevents us from meaningless optimization.
      
      Differential Revision: https://reviews.llvm.org/D39954
      
      llvm-svn: 318639
      26846786
    • Serguei Katkov's avatar
      [CGP] Fix the crash caused by enable of complex addr mode · 505359f7
      Serguei Katkov authored
      We must collect all AddModes even if they are the same.
      This is due to Original value is different but we need all original
      values collected as they are used as anchors in common phi finding.
      
      Reviewers: john.brawn, reames
      Reviewed By: john.brawn
      Subscribers: llvm-commits
      Differential Revision: https://reviews.llvm.org/D40166
      
      llvm-svn: 318638
      505359f7
    • Craig Topper's avatar
      [X86] clzero check in getHostCPUFeatures should use getX86CpuIDAndInfo not getX86CpuIDAndInfoEx. · dcd69797
      Craig Topper authored
      This leaf doesn't take an additional argument.
      
      llvm-svn: 318634
      dcd69797
    • Craig Topper's avatar
      [X86] Reorder and reformat the feature bit checks in getHostCPUFeatues to keep... · 1af7e442
      Craig Topper authored
      [X86] Reorder and reformat the feature bit checks in getHostCPUFeatues to keep the bits in order per register and encourage future additions to be in order too.
      
      llvm-svn: 318633
      1af7e442
Loading