Bug 92758 - [10 regression] r278833 breaks gcc.target/powerpc/fold-vec-splat-floatdouble.c
Summary: [10 regression] r278833 breaks gcc.target/powerpc/fold-vec-splat-floatdouble.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: 10.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-02 19:37 UTC by seurer
Modified: 2019-12-03 15:29 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-12-03 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2019-12-02 19:37:40 UTC
FAIL: gcc.target/powerpc/fold-vec-splat-floatdouble.c scan-assembler-times xxpermdi 3

This is one of those tests that just counts assembler instructions and the count of xxpermdi changed

seurer@makalu-lp1:~/gcc/build/gcc-test2$ diff fold-vec-splat-floatdouble.s.r278832 fold-vec-splat-floatdouble.s.r278833
94c94,95
< 	xxpermdi 34,34,34,0
---
> 	xxlor 0,34,34
> 	xxpermdi 34,0,0,0
113c114,115
< 	xxpermdi 34,34,34,3
---
> 	xxpermdi 0,34,34,2
> 	xxpermdi 34,0,0,0

which in this case looks like missed optimization given the extra instructions are just copying things needlessly between registers.
Comment 1 Richard Biener 2019-12-03 10:23:23 UTC
OK, so the testcases look like

testf_00 (__vector float x)
{
  vector(4) int _1;
  vector(4) int _2;
  int _4;
  __vector float _5;

  <bb 2> :
  _1 = VIEW_CONVERT_EXPR<__vector signed int>(x_3(D));
  _4 = BIT_FIELD_REF <x_3(D), 32, 0>;
  _2 = {_4, _4, _4, _4};
  _5 = VIEW_CONVERT_EXPR<__vector float>(_2);
  return _5;

which we previously optimized to

  <bb 2> :
  _1 = VIEW_CONVERT_EXPR<__vector signed int>(x_3(D));
  _4 = BIT_FIELD_REF <x_3(D), 32, 0>;
  _7 = VIEW_CONVERT_EXPR<vector(4) int>(x_3(D));
  _8 = VEC_PERM_EXPR <_7, _7, { 0, 0, 0, 0 }>;
  _5 = VIEW_CONVERT_EXPR<__vector float>(_8);
  return _5;

so power doesn't have a special splat instruction then it seems.

I'll simply revert the change to not consider uniform vector CTORs.
Comment 2 Richard Biener 2019-12-03 14:47:33 UTC
Fixed.
Comment 3 Richard Biener 2019-12-03 14:47:55 UTC
Author: rguenth
Date: Tue Dec  3 14:47:24 2019
New Revision: 278938

URL: https://gcc.gnu.org/viewcvs?rev=278938&root=gcc&view=rev
Log:
2019-12-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92758
	* tree-ssa-forwprop.c (simplify_vector_constructor): Restore
	operation on uniform vectors.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-forwprop.c
Comment 4 seurer 2019-12-03 15:29:21 UTC
OK, thanks.

BTW, for reference this also affected a couple other test cases on LE power 8 and power 9.

FAIL: gcc.target/powerpc/swaps-p8-16.c scan-assembler vspltw
FAIL: gcc.target/powerpc/swaps-p8-27.c scan-assembler-times lxvd2x 2