[Bug tree-optimization/92772] wrong code vectorizing masked max

2019-12-17 Thread ams at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92772 Andrew Stubbs changed: What|Removed |Added Priority|P3 |P5 Severity|critical

[Bug tree-optimization/92772] wrong code vectorizing masked max

2019-12-04 Thread ams at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92772 --- Comment #6 from Andrew Stubbs --- (In reply to Richard Biener from comment #4) > Btw, isn't the issue that the reduction looks at all lanes? That is, > I think the code simply assumes that for fully masked loops at least > one iteration is p

[Bug tree-optimization/92772] wrong code vectorizing masked max

2019-12-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92772 --- Comment #5 from Richard Biener --- And the issue is to be fixed in vect_create_epilog_for_reduction where we create the index IV: /* For cond reductions we want to create a new vector (INDEX_COND_EXPR) which is updated with the curren

[Bug tree-optimization/92772] wrong code vectorizing masked max

2019-12-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92772 --- Comment #4 from Richard Biener --- IIRC AVX512 also implements fully masked loops so the testcase should fail there, too, if we adjust N accordingly (to 15 or 31). Hmm, can't seem to trigger the fully masked support here, maybe I misremember

[Bug tree-optimization/92772] wrong code vectorizing masked max

2019-12-04 Thread ams at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92772 --- Comment #3 from Andrew Stubbs --- The GCN architecture can handle the masking, but I don't know how we'd represent or apply that in the middle end? I can probably implement extract_last, and that might be more efficient, but I don't see how

[Bug tree-optimization/92772] wrong code vectorizing masked max

2019-12-04 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92772 --- Comment #2 from rsandifo at gcc dot gnu.org --- (In reply to Richard Biener from comment #1) > Looks like cond-reduction cannot handle fully masked loops unless we'd > somehow mask the condition operation itself? Yeah, looks like it. We'd

[Bug tree-optimization/92772] wrong code vectorizing masked max

2019-12-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92772 Richard Biener changed: What|Removed |Added Keywords||wrong-code Target|