[all-commits] [llvm/llvm-project] 103968: [X86] Lower the cost of avx512 horizontal bool and...

topperc via All-commits all-commits at lists.llvm.org
Mon Nov 4 23:13:29 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 103968d147b135ebfcee69d6d7a1428163e66aaa
      https://github.com/llvm/llvm-project/commit/103968d147b135ebfcee69d6d7a1428163e66aaa
  Author: Craig Topper <craig.topper at gmail.com>
  Date:   2019-11-04 (Mon, 04 Nov 2019)

  Changed paths:
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/X86/reduce-and.ll
    M llvm/test/Analysis/CostModel/X86/reduce-or.ll

  Log Message:
  -----------
  [X86] Lower the cost of avx512 horizontal bool and/or reductions to 2*log2(bitwidth)+1 for legal types.

This better represents the kshift+binop we'd get for each stage
before the final extract. Its likely we'll do even better by
doing a kmov and a cmp with a GPR, but this is a good start.

The default handling was costing a worst case single source
permute shuffle of the vector before the binop. This worst
case assumes the shuffle might have to be emulated with
extracts and inserts. But since we know we're doing a reduction
we can assume we'll get kshift lowering.

There's still some room for improvement here, but this is
much better than it was.




More information about the All-commits mailing list