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 402
    • Issues 402
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1071
Closed
Open
Created Apr 26, 2010 by Robert Bernecky@rbeDeveloper

SelModArray() in CF broken when using -ecc/ -check c (SCCFprf_modarray11.sac)

Bugzilla Link 701
Created on Apr 26, 2010 16:49
Version svn
OS Linux
Architecture PC
Attachments SCCFprf_modarray11.sac

Extended Description

Created an attachment (id=689)
source code to reproduce fault
The SelModArray optimization in CF is intended to take this
common set of expressions:
    X = idx_modarray_AxVxS_( M, iv, q);
    z = idx_sel_VxA( iv, X);
and turn it into:
    z = q;
This optimization is of fundamental importance in loop 
fusion/array contraction, and WLF/AWLF, because it allows
us to eliminate intermediate array results.
When a function is compiled with -ecc (or -check c), however,
with my local mods to unroll guards, we end up with this sort
of pattern:
     lim = ...;
     p0... = {earlier guard(s)}
     iv = [ i ];
     q = 42;
     M' = _modarray_AxVxS_( M, iv, q);
     X  = _afterguard_( M' , p0...);
     i' , p1 = _val_lt_val_SxS_( i, lim);
     iv' = [ i'];
     z' = _sel_VxA_( iv', X);
     z  = _afterguard_( z', p1);
     We want to map this into:
     z  = _afterguard( q, p0, p1, ...);
There are several problems here:
1. We don't want to lose the afterguards on p0, p1.
   In fact, finding the afterguard on z is a bit of
   a problem, if we're looking at the z' computation...
2. We have to chase X back to the M' modarray computation,
   through the X afterguard.
3. We have to somehow match iv' and iv, through guards.
This is a unit test from CF, which fails reliably in my local code, if
compiled with:
sac2c  -docf -extrema -nowlf -doawlf -ecc SCCFprf_modarray11.sac
This with Build #rev 16795:16801:MODIFIED, which I hope to check in
soon, and fix this one later.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking