This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][AArch64] Improve dup pattern
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: James Greenhalgh <James dot Greenhalgh at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Tue, 20 Jun 2017 15:19:13 +0000
- Subject: Re: [PATCH][AArch64] Improve dup pattern
- Authentication-results: sourceware.org; auth=none
- Authentication-results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com;
- Nodisclaimer: True
- References: <AM5PR0802MB2610D1E1D4DDB32F990C2F0583C50@AM5PR0802MB2610.eurprd08.prod.outlook.com>,<20170620111407.GA33842@arm.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
James Greenhalgh wrote:
> Have you tested this in cases where an integer dup is definitely the right
> thing to do?
Yes, this still generates:
void f(unsigned a, unsigned b, uint32x4_t *c)
c = vdupq_n_u32(a);
c = vdupq_n_u32(b);
dup v1.4s, w0
dup v0.4s, w1
str q1, [x2]
str q0, [x2, 16]
The reason is that the GP to FP register move cost is typically >= 5, while
the additional cost of '?' is just 1.
> And similar cases? If these still look good, then the patch is OK - though
> I'm still very nervous about the register allocator cost model!
Well it's complex and hard to get working well... However slightly preferring one
variant works alright (unlike using '*' which results in incorrect costs).