Skip to content
  1. Nov 20, 2017
    • 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
    • Peter Collingbourne's avatar
      COFF: Fix invalid comdat sections in test cases. · 8e820552
      Peter Collingbourne authored
      The comdat sections in these test cases do not comply with the COFF
      specification, and link.exe rejects them. I plan to make a change to
      how we handle comdat sections which would also cause us to reject them.
      
      llvm-svn: 318637
      8e820552
    • Peter Collingbourne's avatar
      5c7b467b
    • Peter Collingbourne's avatar
      COFF: Remove unused fields. NFC. · 38e3a1ea
      Peter Collingbourne authored
      llvm-svn: 318635
      38e3a1ea
    • 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
  2. Nov 19, 2017
  3. Nov 18, 2017
    • Eric Fiselier's avatar
      Fix use of config.h in public headers. · 1ed231de
      Eric Fiselier authored
      The CodeGenCoverage.h header is installed, but it references
      the build-only header "llvm/Config/config.h". This breaks use
      of the CodeGenCoverage.h header once it is installed, because config.h isn't
      available.
      
      This patch fixes the error by moving the config.h include from
      the CodeGenCoverage.h header (where it's not needed), to the
      CodeGenCoverage.cpp source file.
      
      llvm-svn: 318602
      1ed231de
    • Jonas Hahnfeld's avatar
      [OpenMP] Show error if VLAs are not supported · 87d44269
      Jonas Hahnfeld authored
      Some target devices (e.g. Nvidia GPUs) don't support dynamic stack
      allocation and hence no VLAs. Print errors with description instead
      of failing in the backend or generating code that doesn't work.
      
      This patch handles explicit uses of VLAs (local variable in target
      or declare target region) or implicitly generated (private) VLAs
      for reductions on VLAs or on array sections with non-constant size.
      
      Differential Revision: https://reviews.llvm.org/D39505
      
      llvm-svn: 318601
      87d44269
    • Jonas Toth's avatar
      [clang-tidy] Add new hicpp-multiway-paths-covered check for missing branches · 9b1dc4c2
      Jonas Toth authored
      Summary:
      This check searches for missing `else` branches in `if-else if`-chains and
      missing `default` labels in `switch` statements, that use integers as condition.
      
      It is very similar to -Wswitch, but concentrates on integers only, since enums are
      already covered.
      
      The option to warn for missing `else` branches is deactivated by default, since it is
      very noise on larger code bases.
      
      Running it on LLVM:
      {F5354858} for default configuration
      {F5354866} just for llvm/lib/Analysis/ScalarEvolution.cpp, the else-path checker is very noisy!
      
      Reviewers: alexfh, aaron.ballman, hokein
      
      Reviewed By: aaron.ballman
      
      Subscribers: lebedev.ri, Eugene.Zelenko, cfe-commits, mgorny, JDevlieghere, xazax.hun
      
      Tags: #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D37808
      
      llvm-svn: 318600
      9b1dc4c2
Loading