This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Remove inefficient branchless conditional negate optimization
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jiong Wang <jiong dot wang at arm dot com>
- Cc: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Sat, 7 Mar 2015 05:34:37 -0800
- Subject: Re: [PATCH] Remove inefficient branchless conditional negate optimization
- Authentication-results: sourceware.org; auth=none
- References: <000101d051e9$e923c610$bb6b5230$ at com> <54EF9C44 dot 7000207 at redhat dot com> <000401d05696$ce28d510$6a7a7f30$ at com> <54F73C7E dot 2050209 at redhat dot com> <000601d05828$44899db0$cd9cd910$ at com> <n99wq2ucca7 dot fsf at arm dot com>
On Fri, Mar 6, 2015 at 8:36 AM, Jiong Wang <jiong.wang@arm.com> wrote:
>
> Wilco Dijkstra writes:
>
>>> Jeff Law wrote:
>>> Can you move pr45685.c into gcc.target/i386?
>>>
>>> I know Richi said next stage1, but given this fixes a performance
>>> regression for ARM and it's reverting rather than adding new code, I
>>> think this is OK for the trunk with the testcase moved.
>>>
>>> So, OK with the testcase moved into gcc.target/i386/
>>
>> I've moved it and changed the compile condition:
>>
>> /* { dg-do compile { target { ! { ia32 } } } } */
>>
>> Jiong, can you commit this please?
>
> Done as 221246.
>
>>
>> Wilco
>>
>> 2015-03-06 Wilco Dijkstra <wdijkstr@arm.com>
>>
>> * gcc/tree-ssa-phiopt.c (neg_replacement): Remove.
>> (tree_ssa_phiopt_worker): Remove negate optimization.
>> * gcc/testsuite/gcc.dg/tree-ssa/pr45685.c: Move to gcc.target/i386.
>> * gcc/testsuite/gcc.target/aarch64/csneg-1.c (test_csneg_cmp):
>> New test.
>> * gcc/gcc.target/i386/pr45685.c: Moved test, check for conditional
>> move on x64.
>
I checked in this as an obvious fix to make it pass on x32.
--
H.J.
---
Index: ChangeLog
===================================================================
--- ChangeLog (revision 221254)
+++ ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2015-03-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/pr45685.c (uint64_t): Replace long with long
+ long.
+ (int64_t): Likewise.
+
2015-03-07 Marek Polacek <polacek@redhat.com>
Martin Uecker <uecker@eecs.berkeley.edu>
Index: gcc.target/i386/pr45685.c
===================================================================
--- gcc.target/i386/pr45685.c (revision 221254)
+++ gcc.target/i386/pr45685.c (working copy)
@@ -1,8 +1,8 @@
/* { dg-do compile { target { ! { ia32 } } } } */
/* { dg-options "-O3" } */
-typedef unsigned long int uint64_t;
-typedef long int int64_t;
+typedef unsigned long long int uint64_t;
+typedef long long int int64_t;
int summation_helper_1(int64_t* products, uint64_t count)
{
int s = 0;