1. Feb 17, 2020
  2. Feb 16, 2020
    • Sanjay Patel's avatar
      [VectorCombine] fix cost calc for extract-cmp · 62dd44d7
      Sanjay Patel authored
      getOperationCost() is not the cost we wanted; that's not the
      throughput value that the rest of the calculation uses.
      
      We may want to switch everything in this code to use the
      getInstructionThroughput() wrapper to avoid these kinds of
      problems, but I'll look at that as a follow-up because that
      can create other logical diffs via using optional parameters
      (we'd need to speculatively create the vector instruction to
      make a fair(er) comparison).
      62dd44d7
    • Sanjay Patel's avatar
      [x86] form broadcast of scalar memop even with >1 use · e48b536b
      Sanjay Patel authored
      The unseen logic diff occurs because MayFoldLoad() is defined like this:
      
      static bool MayFoldLoad(SDValue Op) {
        return Op.hasOneUse() && ISD::isNormalLoad(Op.getNode());
      }
      
      The test diffs here all seem ok to me on screen/paper, but it's hard to know
      if that will lead to universally better perf for all targets. For example,
      if a target implements broadcast from mem as multiple uops, we would have to
      weigh the potential reduction of instructions and register pressure vs.
      possible increase in number of uops. I don't know if we can make a truly
      informed decision on this at compile-time.
      
      The motivating case that I'm looking at in PR42024:
      https://bugs.llvm.org/show_bug.cgi?id=42024
      ...resembles the diff in extract-concat.ll, but we're not going to change the
      larger example there without at least 1 other fix.
      
      Differential Revision: https://reviews.llvm.org/D74088
      e48b536b
    • Nikita Popov's avatar
      [InstCombine] Create new log2 intrinsic; NFCI · 893c630f
      Nikita Popov authored
      Rather than mixing creation of new instructions and in-place
      modification here, create a new log2 intrinsic. This should be
      NFC apart from worklist order changes.
      893c630f