1. Jan 09, 2020
  2. Jan 08, 2020
    • Sanjay Patel's avatar
      [InstCombine] Adding testcase for Z / (1.0 / Y) => (Y * Z); NFC · 5dfd5239
      Sanjay Patel authored
      The added testcase shows the current transformation for the operation
      Z / (1.0 / Y), which remains unchanged. This will be updated to align
      with the transformed code (Y * Z) with D72319.
      
      The existing transformation Z / (X / Y) => (Y * Z) / X is not handling
      this case as there are multiple uses for (1.0 / Y) in this testcase.
      
      Patch by: @raghesh (Raghesh Aloor)
      
      Differential Revision: https://reviews.llvm.org/D72388
      5dfd5239
    • Sanjay Patel's avatar
      [DAGCombiner] clean up extract-of-concat fold; NFC · 780ba1f2
      Sanjay Patel authored
      This hopes to improve readability and adds an assert.
      The functional change noted by the TODO comment is
      proposed in:
      D72361
      780ba1f2
    • Alexey Bataev's avatar
      [OPENMP]Allow comma in combiner expression. · c74a8add
      Alexey Bataev authored
      Use ParseExpression() instead of ParseAssignmentExpression() to allow
      commas in combiner expressions.
      c74a8add
    • Kazu Hirata's avatar
      [JumpThreading] Thread jumps through two basic blocks · ead81592
      Kazu Hirata authored
      Summary:
      This patch teaches JumpThreading.cpp to thread through two basic
      blocks like:
      
        bb3:
          %var = phi i32* [ null, %bb1 ], [ @a, %bb2 ]
          %tobool = icmp eq i32 %cond, 0
          br i1 %tobool, label %bb4, label ...
      
        bb4:
          %cmp = icmp eq i32* %var, null
          br i1 %cmp, label bb5, label bb6
      
      by duplicating basic blocks like bb3 above.  Once we duplicate bb3 as
      bb3.dup and redirect edge bb2->bb3 to bb2->bb3.dup, we have:
      
        bb3:
          %var = phi i32* [ @a, %bb2 ]
          %tobool = icmp eq i32 %cond, 0
          br i1 %tobool, label %bb4, label ...
      
        bb3.dup:
          %var = phi i32* [ null, %bb1 ]
          %tobool = icmp eq i32 %cond, 0
          br i1 %tobool, label %bb4, label ...
      
        bb4:
          %cmp = icmp eq i32* %var, null
          br i1 %cmp, label bb5, label bb6
      
      Then the existing code in JumpThreading.cpp can thread edge
      bb3.dup->bb4 through bb4 and eventually create bb3.dup->bb5.
      
      Reviewers: wmi
      
      Subscribers: hiraditya, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70247
      ead81592
    • Simon Tatham's avatar
      [ARM,MVE] Intrinsics for variable shift instructions. · dac7b23c
      Simon Tatham authored
      This batch of intrinsics fills in all the shift instructions that take
      a variable shift distance in a register, instead of an immediate. Some
      of these instructions take a single shift distance in a scalar
      register and apply it to all lanes; others take a vector of per-lane
      distances.
      
      These instructions are all basically one family, varying in whether
      they saturate out-of-range values, and whether they round when bits
      are shifted off the bottom. I've implemented them at the IR level by a
      much smaller family of IR intrinsics, which take flag parameters to
      indicate saturating and/or rounding (along with the usual one to
      specify signed/unsigned integers).
      
      An oddity is that all of them are //left// shift instructions – but if
      you pass a negative shift count, they'll shift right. So the vector
      shift distances are always vectors of //signed// integers, regardless
      of whether you're considering the other input vector to be of signed
      or unsigned. Also, even the simplest `vshlq` instruction in this
      family (neither saturating nor rounding) has to be implemented as an
      IR intrinsic, because the ordinary LLVM IR `shl` operation would
      consider an out-of-range shift count to be undefined behavior.
      
      Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard
      
      Reviewed By: dmgreen
      
      Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D72329
      dac7b23c
    • Simon Tatham's avatar
      [ARM,MVE] Intrinsics for partial-overwrite imm shifts. · 31004809
      Simon Tatham authored
      This batch of intrinsics covers two sets of immediate shift
      instructions, which have in common that they only overwrite part of
      their output register and so they need an extra input giving its
      previous value.
      
      The VSLI and VSRI instructions shift each lane of the input vector
      left or right just as if they were normal immediate VSHL/VSHR, but
      then they only overwrite the output bits that correspond to actual
      shifted bits of the input. So VSLI will leave the low n bits of each
      output lane unchanged, and VSRI the same with the top n bits.
      
      The V[Q][R]SHR[U]N family are all narrowing shifts: they take an input
      vector of 2n-bit integers, shift each lane right by a constant, and
      then narrowing the shifted result to only n bits. So they only
      overwrite half of the n-bit lanes in the output register, and the B/T
      suffix indicates whether it's the bottom or top half of each 2n-bit
      lane.
      
      I've implemented the whole of the latter family using a single IR
      intrinsic `vshrn`, which takes a lot of i32 parameters indicating
      which instruction it expands to (by specifying signedness of the input
      and output types, whether it saturates and/or rounds, etc).
      
      Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard
      
      Reviewed By: dmgreen
      
      Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D72328
      31004809
    • Andi-Bogdan Postelnicu's avatar
      [clang-tidy] Disable match on `if constexpr` statements in template... · ba129c7d
      Andi-Bogdan Postelnicu authored
      [clang-tidy] Disable match on `if constexpr` statements in template instantiation for `readability-misleading-indentation` check.
      
      Summary: Fixes fixes `readability-misleading-identation` for `if constexpr`. This is very similar to D71980.
      
      Reviewers: alexfh
      
      Subscribers: xazax.hun, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D72333
      ba129c7d
    • Bevin Hansson's avatar
      [Intrinsic] Add fixed point division intrinsics. · 8e2b44f7
      Bevin Hansson authored
      Summary:
      This patch adds intrinsics and ISelDAG nodes for
      signed and unsigned fixed-point division:
      
        llvm.sdiv.fix.*
        llvm.udiv.fix.*
      
      These intrinsics perform scaled division on two
      integers or vectors of integers. They are required
      for the implementation of the Embedded-C fixed-point
      arithmetic in Clang.
      
      Patch by: ebevhan
      
      Reviewers: bjope, leonardchan, efriedma, craig.topper
      
      Reviewed By: craig.topper
      
      Subscribers: Ka-Ka, ilya, hiraditya, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70007
      8e2b44f7
    • Qiu Chaofan's avatar
      [NFC] Move InPQueue into arguments of releaseNode · b2c2fe72
      Qiu Chaofan authored
      This patch moves `InPQueue` into function arguments instead of template
      arguments of `releaseNode`, which is a cleaner approach.
      
      Differential Revision: https://reviews.llvm.org/D72125
      b2c2fe72
    • Aaron Ballman's avatar
      Fixing a formatting nit; NFC · 7a77ad14
      Aaron Ballman authored
      7a77ad14
    • LLVM GN Syncbot's avatar
      [gn build] Port 346f6b54 · 26ac7923
      LLVM GN Syncbot authored
      26ac7923
    • Anna Welker's avatar
      [ARM][MVE] Enable masked gathers from vector of pointers · 346f6b54
      Anna Welker authored
      Adds a pass to the ARM backend that takes a v4i32
      gather and transforms it into a call to MVE's
      masked gather intrinsics.
      
      Differential Revision: https://reviews.llvm.org/D71743
      346f6b54
    • Aaron Ballman's avatar
      Disallow an empty string literal in an asm label · 55a51e1c
      Aaron Ballman authored
      An empty string literal in an asm label does not make a whole lot of sense. GCC
      does not diagnose such a construct, but it also generates code that cannot be
      assembled by gas should two symbols have an empty asm label within the same TU.
      This does not affect an asm statement with an empty string literal, which is
      still a useful construct.
      55a51e1c
    • Nico Weber's avatar
      [gn build] (manually) merge 1cf11a4c · 111ec8c2
      Nico Weber authored
      111ec8c2