[all-commits] [llvm/llvm-project] 201877: [CostModel][X86] Improve accuracy of vXi8 multiply...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Apr 6 03:53:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 201877d57264543d8ac5ca48f15bc0bc7c80b8ce
      https://github.com/llvm/llvm-project/commit/201877d57264543d8ac5ca48f15bc0bc7c80b8ce
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-04-06 (Tue, 06 Apr 2021)

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

  Log Message:
  -----------
  [CostModel][X86] Improve accuracy of vXi8 multiply reduction costs

After rG47321c311bdbe0145b9bf45d822185c37b19fa50 we promote vXi8 reductions to vXi16 to create a much faster PMULLW mul reduction, followed by a (free) truncation. This avoids the high cost of repeated vXi8 multiplications (which extend+multiply+truncate to/from vXi16 types....).

Fixes the missing vXi8 mul reduction vectorization in PR42674 (Comment #20) 'mul16' test case.




More information about the All-commits mailing list