public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stefaan dot deroeck at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/21998] New: (cond ? result1 : result2) is vectorized, where equivalent if-syntax isn't
Date: Fri, 10 Jun 2005 13:22:00 -0000	[thread overview]
Message-ID: <20050610132159.21998.stefaan.deroeck@gmail.com> (raw)

The following two procedures are functionally equivalent, but the first (more
complicated) syntax is vectorized though the second isn't.

typedef int __attribute ((aligned (16))) aint;
void test(aint * __restrict a1, int const v1, int const v2) {
	for (int i=0; i<640; ++i)
		a1[i] = (a1[i] == v1 ? v2 : a1[i]);
}
void test2(aint * __restrict a1, int const v1, int const v2) {
	for (int i=0; i<640; ++i)
		if (a1[i] == v1) a1[i] = v2;
}

vecttest.cpp:7: note: === vect_analyze_loop_form ===
vecttest.cpp:7: note: not vectorized: too many BBs in loop.
vecttest.cpp:6: note: bad loop form.
vecttest.cpp:6: note: vectorized 0 loops in function.

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /esat/alexandria1/sderoeck/src/gcc/main/configure
--prefix=/esat/olympia/install --program-suffix=-cvs --enable-languages=c,c++ :
(reconfigured) /esat/alexandria1/sderoeck/src/gcc/main/configure
--prefix=/esat/olympia/install --program-suffix=-cvs --enable-languages=c,c++ :
(reconfigured) /esat/alexandria1/sderoeck/src/gcc/main/configure
--prefix=/esat/olympia/install --program-suffix=-cvs --enable-languages=c,c++
--no-create --no-recursion : (reconfigured)
/esat/alexandria1/sderoeck/src/gcc/main/configure --prefix=/esat/olympia/install
--program-suffix=-cvs --enable-languages=c,c++ --no-create --no-recursion
Thread model: posix
gcc version 4.1.0 20050610 (experimental)
 /esat/olympia/install/libexec/gcc/i686-pc-linux-gnu/4.1.0/cc1plus -quiet -v
-D_GNU_SOURCE vecttest.cpp -quiet -dumpbase vecttest.cpp -march=pentium4
-auxbase-strip vecttest-gcc.s -O9 -version -fverbose-asm -ftree-vectorize
-fdump-tree-vect-details -fdump-tree-vect-stats -o vecttest-gcc.s
-- cut --
GNU C++ version 4.1.0 20050610 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 3cb76b13917ca148a15d77c9a1fb678d

-- 
           Summary: (cond ? result1 : result2) is vectorized, where
                    equivalent if-syntax isn't
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stefaan dot deroeck at gmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21998


             reply	other threads:[~2005-06-10 13:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-10 13:22 stefaan dot deroeck at gmail dot com [this message]
2005-06-10 13:26 ` [Bug tree-optimization/21998] " pinskia at gcc dot gnu dot org
2005-06-19 14:24 ` [Bug tree-optimization/21998] (cond ? result1 : result2) is vectorized, where equivalent if-syntax isn't (store) pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050610132159.21998.stefaan.deroeck@gmail.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).