This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/18403] FAILs to vectorize testcases on ppc64-linux
- From: "dorit at il dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Mar 2005 12:58:55 -0000
- Subject: [Bug tree-optimization/18403] FAILs to vectorize testcases on ppc64-linux
- References: <20041109155001.18403.dorit@il.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dorit at il dot ibm dot com 2005-03-31 12:58 -------
Another testcase that exhibits a similar problem: vect-5.f90
(patch: http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02840.html)
On powerpc64-linux (lp64) the second loop is not vectorized because the data-
references analysis in the vectorizer can't extract the evolution from the
access_function returned by the evolution analyzer for the accesses to array b.
In lp32 mode the access function we get from the evolution analyzer is simpler,
and the loop gets vectorized.
==> Access function for each case:
lp64: (int8) {i_3, +, 1}_3 + -1
lp32: {i_3 + -1, +, 1}_3
==> Vectorizer dataref analysis report for each case:
vect-5.f90:3: note: Results of object analysis for: b
lp64: base_address: &b
offset: (<unnamed type>) ((int8) {i_3, +, 1}_3 * 4 + -4)
step: 0
base aligned 1
lp32: base_address: &b
offset: (<unnamed type>) (i_3 * 4 + -4)
step: 4
base aligned 1
==> Tree dump for each case:
lp64:
# j_5 = PHI <i_3(15), j_55(18)>;
<L32>:;
D.712_48 = (int8) j_5;
D.713_49 = D.712_48 + 7;
D.714_51 = D.712_48 + -1;
D.715_52 = b[D.714_51];
a[D.713_49] = D.715_52;
j_55 = j_5 + 1;
if (j_5 == D.688_44) goto <L46>; else goto <L47>;
lp32:
# j_6 = PHI <i_4(21), j_40(25)>;
<L34>:;
D.518_35 = j_6 + 7;
D.523_36 = a[D.518_35];
D.519_37 = j_6 + -1;
D.520_38 = b[D.519_37];
if (D.523_36 != D.520_38) goto <L19>; else goto <L52>;
==> Evolution analyzer dumps for each case:
lp64:
(analyze_array
(ref = b[D.714_51];
)
(analyze_scalar_evolution
(loop_nb = 3)
(scalar = D.714_51)
(get_scalar_evolution
(scalar = D.714_51)
(scalar_evolution = (int8) {i_3, +, 1}_3 + -1))
(set_scalar_evolution
(scalar = D.714_51)
(scalar_evolution = (int8) {i_3, +, 1}_3 + -1))
)
(instantiate_parameters
(loop_nb = 3)
(chrec = (int8) {i_3, +, 1}_3 + -1)
(analyze_scalar_evolution
(loop_nb = 2)
(scalar = i_3)
(get_scalar_evolution
(scalar = i_3)
(scalar_evolution = {1, +, 1}_2))
(set_scalar_evolution
(scalar = i_3)
(scalar_evolution = {1, +, 1}_2))
)
(res = (int8) {{1, +, 1}_2, +, 1}_3 + -1))
)
lp32:
(analyze_array
(ref = b[D.835_47];
)
(analyze_scalar_evolution
(loop_nb = 3)
(scalar = D.835_47)
(get_scalar_evolution
(scalar = D.835_47)
(scalar_evolution = {i_3 + -1, +, 1}_3))
(set_scalar_evolution
(scalar = D.835_47)
(scalar_evolution = {i_3 + -1, +, 1}_3))
)
(instantiate_parameters
(loop_nb = 3)
(chrec = {i_3 + -1, +, 1}_3)
(analyze_scalar_evolution
(loop_nb = 2)
(scalar = i_3)
(get_scalar_evolution
(scalar = i_3)
(scalar_evolution = {1, +, 1}_2))
(set_scalar_evolution
(scalar = i_3)
(scalar_evolution = {1, +, 1}_2))
)
(res = {{0, +, 1}_2, +, 1}_3))
)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18403