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 403
    • Issues 403
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1124
Closed
Open
Created Jul 06, 2012 by Robert Bernecky@rbeDeveloper

val_lt_val guard causes AWLF failure

Bugzilla Link 989
Created on Jul 06, 2012 18:54
Version svn
OS Linux
Architecture PC

Extended Description

This is a day-0 problem with guards, affecting those guards having
two arguments. As an example, this AWLF unit test:
use Array: {iota,sum};
int[*] id(int[*] y)
{
 return(y);
}
int main()
{
  N = _max_SxS_( 1, id(20));
  ZZ = with { ([1] <= iv=[i] <= .)
          { temp = iota( i); 
            offset = _sub_SxS_( i, 1);
            el = _sel_VxA_( [offset], temp);
          } : el;
        } : genarray( [ N], 42);
  ZZZ = sum(ZZ);
  z = _sub_SxS_(ZZZ, 213);
  return(z);
}
If compiled with:
sac2c ~/sac/testsuite/optimizations/awlf/selInWL.sac -doawlf -nowlf -bopt:uglf
this fails to AWLF the iota() out of existence, because we have, essentially:
  offset = i - 1;
  p, offset' = val_lt_val( offset, i);
This can not be rewritten a la CTZ, because the guard result must be
PRF_ARG1, so we must not tinker with offset.
We can, however, rewrite it as:
   p = offset < i;
   offset' = guard( offset, all(p));
I'll put it on my list to write a traversal for this, unless someone
is keen to do it first.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking