Commit Graph

109 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
09f550f718 Handle exponential explosion of code-gen during first phase of compile.
Certain patterns with OpVectorShuffle (and probably others) will cascade
to so large, that they can cause OOM. After we have observed
force_recompile, don't spend unnecessary memory emitting code which will
never be used.
2018-01-24 18:12:41 +01:00
Hans-Kristian Arntzen
7d223b8987 Fix CFG for forwarded temporaries.
Forwarded temporaries would never declare a temporary.
Figure out all result types ahead of time so we can deal with those
temporaries as well.
2018-01-18 12:11:33 +01:00
Hans-Kristian Arntzen
168bcc7b3b Add unreachable tests for MSL/HLSL. 2018-01-15 09:39:15 +01:00
Hans-Kristian Arntzen
d4e470babd Analyze the CFG for temporaries as well.
Normally, temporary declaration must dominate any use of it,
so we generally did not need to analyze the CFG for these variables,
but there is an edge case where you have an inliner doing:

do {
	create_temporary;
	break;
} while(0);

use_temporary;

The inside of the loop dominates the outer scope, but we cannot emit
code like this in GLSL, so make sure we hoist these temporaries outside
the "loop".
2018-01-12 10:56:11 +01:00
Bill Hollings
12988801c4 Update reference shaders in reference/opt/shaders-msl.
Remove shaders-msl/comp/bake_gradient.comp, which now breaks spirv-opt.
2017-12-04 18:17:06 -05:00
Hans-Kristian Arntzen
65cd417630 Do not hoist OpUndef variables. 2017-11-23 09:59:25 +01:00
Hans-Kristian Arntzen
7238e57933 Enforce stable order for dominated phi variables. 2017-11-23 09:59:25 +01:00
Hans-Kristian Arntzen
c52776af78 Update to correct SPIRV-Tools revision. 2017-11-23 09:59:21 +01:00
Hans-Kristian Arntzen
b39e829fc2 Add reference output for --opt. 2017-11-23 09:50:11 +01:00