Hi,
This is a simple patch discarding simple element components earlier in predcom.
Bootstrap and test on x86_64 and AArch64, is it OK?
Thanks,
bin
2017-05-10 Bin Cheng <bin.ch...@arm.com>
* tree-predcom.c (determine_roots_comp): Skip single-elem chain.
From fd3dd235dca80671d1201098c9235a17b5a2f544 Mon Sep 17 00:00:00 2001
From: Bin Cheng <binch...@e108451-lin.cambridge.arm.com>
Date: Mon, 24 Apr 2017 14:47:25 +0100
Subject: [PATCH 4/6] skip-single-elem-component-20161221.txt
---
gcc/tree-predcom.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 96af63f..0b7811a 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1229,8 +1229,11 @@ determine_roots_comp (struct loop *loop,
return;
}
- comp->refs.qsort (order_drefs);
+ /* Trivial component. */
+ if (comp->refs.length () <= 1)
+ return;
+ comp->refs.qsort (order_drefs);
FOR_EACH_VEC_ELT (comp->refs, i, a)
{
if (!chain || DR_IS_WRITE (a->ref)
--
1.9.1