Commit 11f178b
committed
[LV] Teach the vectorizer to cost and vectorize llvm.sincos intrinsics
This teaches the loop vectorizer that `llvm.sincos` is trivially
vectorizable. Additionally, this patch updates the cost model to cost
intrinsics that return multiple values correctly. Previously, the cost
model only thought intrinsics that return `VectorType` need scalarizing,
which meant it cost intrinsics that return multiple vectors (that need
scalarizing) way too cheap (giving it the cost of a single function
call).
The `llvm.sincos` intrinsic also has a custom cost when a vector
function library is available, as certain VFs can be expanded (later in
code-gen) to a vector function, reducing the cost to a single call (+
the possible loads from the vector function returns values via output
pointers).1 parent 3f8e280 commit 11f178b
File tree
7 files changed
+256
-28
lines changed- llvm
- include/llvm
- Analysis
- CodeGen
- lib
- Analysis
- Transforms/Vectorize
- test/Transforms/LoopVectorize/AArch64
7 files changed
+256
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
148 | | - | |
| 149 | + | |
| 150 | + | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
1725 | 1726 | | |
1726 | 1727 | | |
1727 | 1728 | | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
1731 | 1732 | | |
1732 | 1733 | | |
1733 | 1734 | | |
| |||
1995 | 1996 | | |
1996 | 1997 | | |
1997 | 1998 | | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
1998 | 2042 | | |
1999 | 2043 | | |
2000 | 2044 | | |
| |||
2003 | 2047 | | |
2004 | 2048 | | |
2005 | 2049 | | |
2006 | | - | |
2007 | | - | |
2008 | | - | |
2009 | | - | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
2010 | 2057 | | |
2011 | 2058 | | |
2012 | 2059 | | |
| |||
2678 | 2725 | | |
2679 | 2726 | | |
2680 | 2727 | | |
2681 | | - | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
2682 | 2731 | | |
2683 | | - | |
2684 | | - | |
2685 | | - | |
| 2732 | + | |
| 2733 | + | |
2686 | 2734 | | |
2687 | 2735 | | |
2688 | | - | |
2689 | | - | |
2690 | | - | |
2691 | | - | |
2692 | | - | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2693 | 2745 | | |
2694 | | - | |
| 2746 | + | |
2695 | 2747 | | |
2696 | 2748 | | |
2697 | 2749 | | |
2698 | 2750 | | |
2699 | 2751 | | |
2700 | 2752 | | |
2701 | | - | |
| 2753 | + | |
2702 | 2754 | | |
2703 | 2755 | | |
2704 | 2756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2919 | 2919 | | |
2920 | 2920 | | |
2921 | 2921 | | |
2922 | | - | |
| 2922 | + | |
| 2923 | + | |
2923 | 2924 | | |
2924 | 2925 | | |
2925 | 2926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
1183 | | - | |
| 1183 | + | |
| 1184 | + | |
1184 | 1185 | | |
1185 | 1186 | | |
1186 | 1187 | | |
| |||
0 commit comments