[PATCH] D32706: [AArch64] Consider widening instructions in cast cost calculation

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 12:15:01 PDT 2017


mssimpso updated this revision to Diff 97995.
mssimpso added a subscriber: gberry.
mssimpso added a comment.
Herald added subscribers: javed.absar, mzolotukhin.

Addressed Evandro's concerns.

Hey Evando,

I appreciate all the feedback. After discussing your concerns with @gberry, he suggested an alternative solution, which I've implemented in this updated version of the patch. The basic idea is to treat the widening instructions as single operations (rather than operations composed of two or three instructions), whose cost is attached to the arithmetic instruction. This design conceptually better matches the code that we generate.

I've rearranged the patch so that we (1) mark the extends as "free" and (2) apply a sub-target specified overhead to the arithmetic instructions that are widening. I've left the default overhead zero (so this version of the patch is functionally the same as the last one), but sub-targets will now have the flexibility to increase this overhead to better match the capabilities of their hardware. Thus, an "add" ultimately mapping to UADDL can have a different cost than an "add" mapping to ADD, for example. Does this make sense?

Please let me know what you think.


https://reviews.llvm.org/D32706

Files:
  lib/Target/AArch64/AArch64Subtarget.h
  lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  lib/Target/AArch64/AArch64TargetTransformInfo.h
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Analysis/CostModel/AArch64/free-widening-casts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32706.97995.patch
Type: text/x-patch
Size: 34752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170505/678c124e/attachment.bin>


More information about the llvm-commits mailing list