1. Apr 13, 2020
  2. Apr 12, 2020
    • Jonathan Roelofs's avatar
      reland: [DAG] Fix PR45049: LegalizeTypes crash · 41f13f1f
      Jonathan Roelofs authored
      Sometimes LegalizeTypes knows about common subexpressions before SelectionDAG
      does, leading to accidental SDValue removal before its reference count was
      truly zero.
      
      Differential Revision: https://reviews.llvm.org/D76994
      
      Reviewed-By: bjope
      
      Fixes: https://bugs.llvm.org/show_bug.cgi?id=45049
      
      Reverted in 3ce77142 because the previous patch
      broke the expensive-checks bots. The new patch removes the broken check.
      41f13f1f
    • Mircea Trofin's avatar
      [llvm][NFC] Refactor uses of CallSite to CallBase - call promotion · d2f1cd5d
      Mircea Trofin authored
      Summary:
      Updated CallPromotionUtils and impacted sites. Parameters that are
      expected to be non-null, and return values that are guranteed non-null,
      were replaced with CallBase references rather than pointers.
      
      Left FIXME in places where more changes are facilitated by CallBase, but
      aren't CallSites: Instruction* parameters or return values, for example,
      where the contract that they are actually CallBase values.
      
      Reviewers: davidxl, dblaikie, wmi
      
      Reviewed By: dblaikie
      
      Subscribers: arsenm, jvesely, nhaehnle, eraman, hiraditya, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77930
      d2f1cd5d
    • Chris Lattner's avatar
      Refactor StringMap.h, splitting StringMapEntry out to its own header. · 617b08ff
      Chris Lattner authored
      Summary:
      StringMapEntry.h can have lower dependencies, than StringMap.h, which
      is useful for public headers that want to expose inline methods on
      StringMapEntry<> but don't need to expose all of StringMap.h.  One
      example of this is mlir's Identifier.h, another example is the existing
      LLVM StringPool.h.
      
      StringPool also could use a cleanup, I'll deal with that in a follow-on
      patch.
      
      Reviewers: rriddle
      
      Subscribers: hiraditya, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77963
      617b08ff
    • Sanjay Patel's avatar
      [x86] use vector instructions to lower FP->int->FP casts · d04db482
      Sanjay Patel authored
      As discussed in PR36617:
      https://bugs.llvm.org/show_bug.cgi?id=36617#c13
      ...we can avoid the likely slow round-trip from XMM to GPR to XMM
      by using the vector versions of the convert instructions.
      
      Based on experimental results from recent Intel/AMD chips, we don't
      need to worry about triggering denorm stalls while operating on
      garbage data in the high lanes with convert instructions, so this is
      expected to always be as good or better perf than the scalar
      instruction equivalent. FP exceptions are also not a concern because
      strict code should not be using the regular SDAG opcodes.
      
      Differential Revision: https://reviews.llvm.org/D77895
      d04db482
    • Sanjay Patel's avatar
      [VectorUtils] add IR-level analysis for widening of shuffle mask · c23cbefd
      Sanjay Patel authored
      This is similar to the recent move/addition of "scaleShuffleMask" (D76508),
      but there are a couple of differences:
      
      1. The existing x86 helper (canWidenShuffleElements) always tries to
         divide-by-2, so it gets called iteratively and wouldn't handle the
         general case of non-pow-2 length.
      2. The existing x86 code handles "SM_SentinelZero" - we don't have
         that in IR, but this code should be safe to use with that or other
         special (negative) values.
      
      The motivation is to enable shuffle folds in instcombine/vector-combine
      that are similar to D76844 and D76727, but in the reverse-bitcast direction.
      Those patterns are visible in the tests for D40633.
      
      Differential Revision: https://reviews.llvm.org/D77881
      c23cbefd