Commit 22e18bcc by Nicolas Capens

Fix loading uninitialized data in loops.

When we have an uninitialized variable that is declared outside of a loop and is read and written to inside the loop, we should not eliminate the load and replace it with an undefined value, because in the next iteration we want the value from the previous iteration. Change-Id: Ic996c796307f62fc835079af6c58adf1eb288259 Reviewed-on: https://swiftshader-review.googlesource.com/8488Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 3e7062b9
...@@ -328,7 +328,10 @@ namespace ...@@ -328,7 +328,10 @@ namespace
continue; continue;
} }
replace(load, storeValue); if(storeValue)
{
replace(load, storeValue);
}
} }
} }
} }
......
Markdown is supported
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