]> granicus.if.org Git - llvm/commit
[AArch64] Consider widening instructions in cost calculations
authorMatthew Simpson <mssimpso@codeaurora.org>
Tue, 9 May 2017 20:18:12 +0000 (20:18 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Tue, 9 May 2017 20:18:12 +0000 (20:18 +0000)
commita4fa9d3a636fa01a43eb79de8e24830d099e9556
tree1685df1625a3259354d19ab0cdec2c7fcb7ab709
parentcf5da38c84393d7875273372ac3bc6d09320e56e
[AArch64] Consider widening instructions in cost calculations

The AArch64 instruction set has a few "widening" instructions (e.g., uaddl,
saddl, uaddw, etc.) that take one or more doubleword operands and produce
quadword results. The operands are automatically sign- or zero-extended as
appropriate. However, in LLVM IR, these extends are explicit. This patch
updates TTI to consider these widening instructions as single operations whose
cost is attached to the arithmetic instruction. It marks extends that are part
of a widening operation "free" and applies a sub-target specified overhead
(zero by default) to the arithmetic instructions.

Differential Revision: https://reviews.llvm.org/D32706

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302582 91177308-0d34-0410-b5e6-96231b3b80d8
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 [new file with mode: 0644]