This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/78604] [7 regression] test case gcc.target/powerpc/p8vector-vectorize-1.c fails starting with r242750


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78604

--- Comment #3 from amker at gcc dot gnu.org ---
For function sign_lt and uns_lt, the change causes worse code generation
unfortunately.  Take uns_lt as example, the difference in optimized dump is as
like:

529,530c529,530
<   vect_cst__32 = {val1_8(D), val1_8(D)};
<   vect_cst__33 = {val2_7(D), val2_7(D)};
---
>   vect_cst__32 = {val2_7(D), val2_7(D)};
>   vect_cst__33 = {val1_8(D), val1_8(D)};
536c536
<   vect_iftmp.412_34 = VEC_COND_EXPR <vect__1.408_28 < vect__2.411_31,
vect_cst__32, vect_cst__33>;
---
>   vect_iftmp.412_34 = VEC_COND_EXPR <vect__1.408_28 >= vect__2.411_31, vect_cst__32, vect_cst__33>;


Condition "<" is transformed into ">=" with the change, which results in more
insns after expanding:
***************
*** 1014,1024 ****
        REG_EQUAL `uc'
     49: r199:V2DI=[r195:SI+r167:SI]
     50: r200:V2DI=[r197:SI+r167:SI]
!    51: r202:V2DI=gtu(r200:V2DI,r199:V2DI)
!    52: r201:V2DI={(r202:V2DI!=const_vector)?r170:V2DI:r171:V2DI}
!    53: [r193:SI+r167:SI]=r201:V2DI
!    54: r167:SI=r167:SI+0x10
!    56: r203:CCUNS=cmp(r167:SI,0x2000)
!    57: pc={(r203:CCUNS!=0)?L55:pc}
        REG_BR_PROB 9899
!    58: NOTE_INSN_BASIC_BLOCK 5
--- 1016,1028 ----
        REG_EQUAL `uc'
     49: r199:V2DI=[r195:SI+r167:SI]
     50: r200:V2DI=[r197:SI+r167:SI]
!    51: r202:V2DI=gtu(r199:V2DI,r200:V2DI)
!    52: r203:V2DI=r199:V2DI==r200:V2DI
!    53: r204:V2DI=r202:V2DI|r203:V2DI
!    54: r201:V2DI={(r204:V2DI!=const_vector)?r170:V2DI:r171:V2DI}
!    55: [r193:SI+r167:SI]=r201:V2DI
!    56: r167:SI=r167:SI+0x10
!    58: r205:CCUNS=cmp(r167:SI,0x2000)
!    59: pc={(r205:CCUNS!=0)?L57:pc}
        REG_BR_PROB 9899
!    60: NOTE_INSN_BASIC_BLOCK 5

So "<" is expanded into instruction (51), but ">=" is expanded into
instructions (51~53).

So powerpc has to compute ">=" with "> || =="?  Apart from this, the change
itself only introduces additional canonicalization during tree-ifcvt,
transforming "<" to "<=".  If the former form is more efficient on powerpc,
shall we take this into consideration when canonicalization?

Thanks.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]