Summary: | gcc fails to auto-vectorise the multiplicative reduction of an array of complex floats | ||
---|---|---|---|
Product: | gcc | Reporter: | Raphael C <drraph> |
Component: | tree-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | normal | CC: | tnfchris |
Priority: | P3 | Keywords: | missed-optimization |
Version: | 7.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2023-07-27 00:00:00 | |
Bug Depends on: | |||
Bug Blocks: | 53947 |
Description
Raphael C
2017-01-16 14:10:44 UTC
The issue is we do not support reduction of _Complex vars. The vectorizer sees <bb 3> [99.00%]: # i_16 = PHI <i_11(4), 0(2)> # p$real_13 = PHI <_21(4), 1.0e+0(2)> # p$imag_14 = PHI <_22(4), 0.0(2)> # ivtmp_48 = PHI <ivtmp_47(4), 128(2)> _1 = (long unsigned int) i_16; _2 = _1 * 8; _3 = x_9(D) + _2; _7 = REALPART_EXPR <*_3>; _12 = IMAGPART_EXPR <*_3>; _17 = _7 * p$real_13; _18 = _12 * p$imag_14; _19 = _7 * p$imag_14; _20 = _12 * p$real_13; _21 = _17 - _18; _22 = _19 + _20; i_11 = i_16 + 1; ivtmp_47 = ivtmp_48 - 1; if (ivtmp_47 != 0) goto <bb 4>; [98.99%] else goto <bb 5>; [1.01%] <bb 4> [98.00%]: goto <bb 3>; [100.00%] <bb 5> [1.00%]: # _50 = PHI <_21(3)> # _49 = PHI <_22(3)> p_10 = COMPLEX_EXPR <_50, _49>; return p_10; which would need to be detected as a single reduction with two components. I guess not lowering complex operations would help here (with its own complications of course). Not sinking the COMPLEX_EXPR and having it as loop carried dep would eventually help as well. |