mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-21 22:34:34 +00:00
Run DCE twice (#556)
This commit is contained in:
parent
5e429866da
commit
d6ff9cd439
@ -277,7 +277,10 @@ pub fn link(sess: &Session, mut inputs: Vec<Module>, opts: &Options) -> Result<L
|
||||
.write_all(spirv_tools::binary::from_binary(&output.assemble()))
|
||||
.unwrap();
|
||||
}
|
||||
if opts.dce && opts.emit_multiple_modules {
|
||||
// Run DCE again, even if emit_multiple_modules==false - the first DCE ran before
|
||||
// structurization and mem2reg (for perf reasons), and mem2reg may remove references to
|
||||
// invalid types, so we need to DCE again.
|
||||
if opts.dce {
|
||||
let _timer = sess.timer("link_dce_2");
|
||||
dce::dce(output);
|
||||
}
|
||||
|
@ -189,15 +189,14 @@ OpDecorate %5 Binding 0
|
||||
%6 = OpTypeVoid
|
||||
%7 = OpTypeFunction %6
|
||||
%8 = OpTypeInt 32 0
|
||||
%9 = OpTypePointer Function %8
|
||||
%10 = OpConstant %8 1
|
||||
%11 = OpTypeFloat 32
|
||||
%12 = OpTypeImage %11 2D 0 0 0 1 Unknown
|
||||
%13 = OpTypeSampledImage %12
|
||||
%4 = OpTypeRuntimeArray %13
|
||||
%14 = OpTypePointer UniformConstant %4
|
||||
%5 = OpVariable %14 UniformConstant
|
||||
%15 = OpTypePointer UniformConstant %13"#,
|
||||
%9 = OpConstant %8 1
|
||||
%10 = OpTypeFloat 32
|
||||
%11 = OpTypeImage %10 2D 0 0 0 1 Unknown
|
||||
%12 = OpTypeSampledImage %11
|
||||
%4 = OpTypeRuntimeArray %12
|
||||
%13 = OpTypePointer UniformConstant %4
|
||||
%5 = OpVariable %13 UniformConstant
|
||||
%14 = OpTypePointer UniformConstant %12"#,
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user