[PATCH] D76400: [X86] Attempt to more accurately model the cost of a bool reduction of wide vector type.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 18 18:28:40 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.
Herald added a subscriber: hiraditya.

Previously we multiplied the cost for the table entries by the number of splits needed. But that implies that each split goes through a reduction to scalar independently. I think what really happens is that the we AND/OR the split pieces until we're down to a single value with a legal type and then do special reduction sequence on that.

So to model that this patch takes the number of splits minus one multiplied by the cost of a AND/OR at the legal element count and adds that on top of the table lookup.


https://reviews.llvm.org/D76400

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76400.251238.patch
Type: text/x-patch
Size: 17662 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200319/f307109f/attachment.bin>


More information about the llvm-commits mailing list