Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 393
    • Issues 393
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 24
    • Merge requests 24
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2415
Closed
Open
Created Apr 29, 2024 by Thomas Koopman@thomasDeveloper

Records do not optimise away selection

Replacing a multi-operator with-loop with an equivalent records formulation leads to extreme performance degradation as sacprelude_d::sel does not optimise to _idx_sel_. Attached are the two versions, relevant sections after bopt:

records.sac

  double[*] _pinl_735__dss_679 { , NN } ; 
  double[*] _pinl_734__dss_678 { , NN } ; 
  double[*] _pinl_733__dss_677 { , NN } ; 

  ...

  _dss_579__flat_20_x, _dss_579__flat_20_y, _dss_579__flat_20_z = with      /** FOLDABLE (all gen's const) **/
      /** REFERENCED: 3 (total num refs) **/
 {
        /* Partn */
        ([ 0 ] <= iv=[_eat_147] (IDXS:_wlidx_1475__dss_579__flat_20_x) < [ 100000 ] genwidth [ 100000 ])
        { 
          _pinl_733__dss_677 = sacprelude_d::sel( iv, _dss_578_px_x) ; 
          _pinl_734__dss_678 = sacprelude_d::sel( iv, _dss_578_px_y) ; 
          _pinl_735__dss_679 = sacprelude_d::sel( iv, _dss_578_px_z) ; 
          _pinl_729__dss_675__flat_84_x = _type_conv_( double, _pinl_733__dss_677); 
          _pinl_728__dss_675__flat_84_y = _type_conv_( double, _pinl_734__dss_678); 
          _pinl_727__dss_675__flat_84_z = _type_conv_( double, _pinl_735__dss_679); 
          _dss_582__flat_34_x, _dss_582__flat_34_y, _dss_582__flat_34_z = with              /** FOLDABLE (all gen's const) **/

multioperator.sac

  ax, ay, az = with      /** FOLDABLE (all gen's const) **/
      /** REFERENCED: 3 (total num refs) **/
 {
        /* Partn */
        ([ 0 ] <= iv=[_eat_71] (IDXS:_wlidx_2916_ax) < [ 100000 ] genwidth [ 100000 ])
        { 
          _ivesli_2932 = _idxs2offset_( [ 100000 ], _eat_71); 
          _pinl_302__flat_405 = _idx_sel_( _ivesli_2932, pz); 
          _pinl_313__flat_405 = _idx_sel_( _ivesli_2932, py); 
          _pinl_324__flat_405 = _idx_sel_( _ivesli_2932, px); 
          x, y, z = with              /** FOLDABLE (all gen's const) **/

It looks like the problem may be that the compiler cannot infer that double[*] _pinl_735__dss_679 is really double[.] _pinl_735__dss_679.multioperator.opt

record.opt

multioperator.sac

record.sac

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking