Commit ec84e926 authored by Sven-Bodo Scholz's avatar Sven-Bodo Scholz
Browse files

Merge branch 'hans-fix-emrl-again' into 'develop'

fix emrl lifting in CUDA backend

See merge request !195
parents 631edeb7 6d00b16d
......@@ -1585,6 +1585,7 @@ EMALlet (node *arg_node, info *arg_info)
break;
case EA_fillnoop:
/*
* a = alloc (...); // see code for F_noop below in EMALprf
* b = prf (a);
*
* is transferred into:
......@@ -1602,9 +1603,6 @@ EMALlet (node *arg_node, info *arg_info)
LET_EXPR (arg_node)
= TCmakePrf2 (F_fill, TCmakePrf1 (F_noop, TBmakeId (avis)),
TBmakeId (avis));
/* make sure to allocate N_avis */
INFO_ALLOCLIST (arg_info)->avis = avis;
break;
case EA_nofill:
/* do nothing */
......@@ -2134,9 +2132,13 @@ EMALprf (node *arg_node, info *arg_info)
* the alternative fill/alloc insertion in EMALlet (see EA_fillnoop). This
* elides the host2device prf, instead using fill (noop (...), ...).
*/
INFO_MUSTFILL (arg_info) = AVIS_ISALLOCLIFT (ID_AVIS (PRF_ARG1 (arg_node)))
? EA_fillnoop
: INFO_MUSTFILL (arg_info);
if (AVIS_ISALLOCLIFT (ID_AVIS (PRF_ARG1 (arg_node))))
{
INFO_MUSTFILL (arg_info) = EA_fillnoop;
/* we perform no allocation of the lhs */
INFO_ALLOCLIST (arg_info) = FreeALS (INFO_ALLOCLIST (arg_info));
break;
}
/* Fall-through */
case F_device2host:
case F_device2host_start:
......@@ -2198,7 +2200,7 @@ EMALprf (node *arg_node, info *arg_info)
*
* a = alloc (...);
*
* a is *always* AKS, so shape and dim can be static evaluated.
* a is *always* AKS, so shape and dim can be staticly evaluated.
*
*/
if (AVIS_ISALLOCLIFT (als->avis))
......@@ -2208,7 +2210,6 @@ EMALprf (node *arg_node, info *arg_info)
arg_node = FREEdoFreeNode (arg_node);
arg_node = new_node;
AVIS_SSAASSIGN (als->avis) = INFO_ASSIGN (arg_info);
//AVIS_ISALLOCLIFT (als->avis) = FALSE;
/* we've changed the prf to an alloc, so we don't need another alloc */
INFO_ALLOCLIST (arg_info) = FreeALS (INFO_ALLOCLIST (arg_info));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment