diff --git a/Cargo.lock b/Cargo.lock index 89156b77ea..8cb520991c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,18 +168,18 @@ checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "bytemuck" -version = "1.7.3" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" +checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.0.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" +checksum = "5fe233b960f12f8007e3db2d136e3cb1c291bfd7396e384ee76025fc1a3932b4" dependencies = [ "proc-macro2", "quote", @@ -683,6 +683,16 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "elsa" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b4b5d23ed6b6948d68240aafa4ac98e568c9a020efd9d4201a6288bc3006e09" +dependencies = [ + "indexmap", + "stable_deref_trait", +] + [[package]] name = "encoding_rs" version = "0.8.30" @@ -1096,6 +1106,15 @@ dependencies = [ "web-sys", ] +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.8" @@ -1776,11 +1795,11 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2007,6 +2026,7 @@ dependencies = [ "serde", "serde_json", "smallvec", + "spirt", "spirv-tools", "syn", "tempfile", @@ -2190,6 +2210,9 @@ name = "smallvec" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +dependencies = [ + "serde", +] [[package]] name = "smithay-client-toolkit" @@ -2210,6 +2233,23 @@ dependencies = [ "wayland-protocols 0.29.1", ] +[[package]] +name = "spirt" +version = "0.1.0" +source = "git+https://github.com/EmbarkStudios/spirt.git#b586de479bd3f41536d3dd8116919f540e9eef5f" +dependencies = [ + "arrayvec", + "bytemuck", + "elsa", + "indexmap", + "itertools", + "lazy_static", + "rustc-hash", + "serde", + "serde_json", + "smallvec", +] + [[package]] name = "spirv" version = "0.2.0+1.5.4" @@ -2278,6 +2318,12 @@ dependencies = [ "cc", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.8.0" @@ -2344,13 +2390,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.84" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb2e6da8ee5eb9a61068762a32fa9619cc591ceb055b3687f4cd4051ec2e06b" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2459,6 +2505,12 @@ dependencies = [ "serde", ] +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + [[package]] name = "unicode-segmentation" version = "1.8.0" @@ -2471,12 +2523,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "unidiff" version = "0.3.3" diff --git a/crates/rustc_codegen_spirv/Cargo.toml b/crates/rustc_codegen_spirv/Cargo.toml index 0cb07cdd6f..19bedc4917 100644 --- a/crates/rustc_codegen_spirv/Cargo.toml +++ b/crates/rustc_codegen_spirv/Cargo.toml @@ -56,6 +56,7 @@ serde_json = "1.0" smallvec = { version = "1.6.1", features = ["union"] } spirv-tools = { version = "0.9", default-features = false } rustc_codegen_spirv-types.workspace = true +spirt = { git = "https://github.com/EmbarkStudios/spirt.git" } [dev-dependencies] pipe = "0.4" diff --git a/crates/rustc_codegen_spirv/src/linker/mod.rs b/crates/rustc_codegen_spirv/src/linker/mod.rs index fd2948e5f9..49c71fd316 100644 --- a/crates/rustc_codegen_spirv/src/linker/mod.rs +++ b/crates/rustc_codegen_spirv/src/linker/mod.rs @@ -129,10 +129,10 @@ pub fn link(sess: &Session, mut inputs: Vec, opts: &Options) -> Result, opts: &Options) -> Result, opts: &Options) -> Result, opts: &Options) -> Result { + pointer_to_pointee + .insert(inst.result_id.unwrap(), inst.operands[1].unwrap_id_ref()); + } + Op::TypeInt + if inst.operands[0].unwrap_literal_int32() == 32 + && inst.operands[1].unwrap_literal_int32() == 0 => + { + assert!(u32.is_none()); + u32 = Some(inst.result_id.unwrap()); + } + Op::Constant if u32.is_some() && inst.result_type == u32 => { + let value = inst.operands[0].unwrap_literal_int32(); + constants.insert(inst.result_id.unwrap(), value); + } + _ => {} + } + } + for func in &mut output.functions { + simple_passes::block_ordering_pass(func); + // Note: mem2reg requires functions to be in RPO order (i.e. block_ordering_pass) + mem2reg::mem2reg( + output.header.as_mut().unwrap(), + &mut output.types_global_values, + &pointer_to_pointee, + &constants, + func, + ); + destructure_composites::destructure_composites(func); + } + } + + { + let spv_bytes = { + let _timer = sess.timer("assemble-to-spv_bytes-for-spirt"); + spirv_tools::binary::from_binary(&output.assemble()).to_vec() + }; + let cx = std::rc::Rc::new(spirt::Context::new()); + let mut module = { + let _timer = sess.timer("spirt::Module::lower_from_spv_file"); + match spirt::Module::lower_from_spv_bytes(cx, spv_bytes) { + Ok(module) => module, + Err(e) => { + use rspirv::binary::Disassemble; + + return Err(sess + .struct_err(format!("{e}")) + .note(format!( + "while lowering this SPIR-V module to SPIR-T:\n{}", + output.disassemble() + )) + .emit()); + } + } + }; + if opts.structurize { + let _timer = sess.timer("spirt::legalize::structurize_func_cfgs"); + spirt::passes::legalize::structurize_func_cfgs(&mut module); + } + let spv_words = { + let _timer = sess.timer("spirt::Module::lift_to_spv_module_emitter"); + module.lift_to_spv_module_emitter().unwrap().words + }; + output = { + let _timer = sess.timer("parse-spv_words-from-spirt"); + let mut loader = Loader::new(); + rspirv::binary::parse_words(&spv_words, &mut loader).unwrap(); + loader.module() + }; + } + { let _timer = sess.timer("peephole_opts"); let types = peephole_opts::collect_types(&output); diff --git a/crates/rustc_codegen_spirv/src/linker/test.rs b/crates/rustc_codegen_spirv/src/linker/test.rs index efb7989cfd..733a7e02b0 100644 --- a/crates/rustc_codegen_spirv/src/linker/test.rs +++ b/crates/rustc_codegen_spirv/src/linker/test.rs @@ -474,26 +474,26 @@ fn use_exported_func_param_attr() { let result = assemble_and_link(&[&a, &b]).unwrap(); - let expect = r#"OpCapability Kernel - OpCapability Linkage + let expect = r#"OpCapability Linkage + OpCapability Kernel OpMemoryModel Logical OpenCL OpDecorate %1 FuncParamAttr Zext - OpDecorate %2 LinkageAttributes "HACK(eddyb) keep function alive" Export - OpDecorate %3 LinkageAttributes "foo" Export - OpDecorate %4 FuncParamAttr Sext + OpDecorate %2 FuncParamAttr Sext + OpDecorate %3 LinkageAttributes "HACK(eddyb) keep function alive" Export + OpDecorate %4 LinkageAttributes "foo" Export %5 = OpTypeVoid %6 = OpTypeInt 32 0 %7 = OpTypeFunction %5 %6 - %2 = OpFunction %5 None %7 + %3 = OpFunction %5 None %7 %1 = OpFunctionParameter %6 %8 = OpLabel %9 = OpLoad %6 %1 OpReturn OpFunctionEnd - %3 = OpFunction %5 None %7 - %4 = OpFunctionParameter %6 + %4 = OpFunction %5 None %7 + %2 = OpFunctionParameter %6 %10 = OpLabel - %11 = OpLoad %6 %4 + %11 = OpLoad %6 %2 OpReturn OpFunctionEnd"#; @@ -553,16 +553,16 @@ fn names_and_decorations() { let result = assemble_and_link(&[&a, &b]).unwrap(); - let expect = r#"OpCapability Kernel - OpCapability Linkage + let expect = r#"OpCapability Linkage + OpCapability Kernel OpMemoryModel Logical OpenCL OpName %1 "foo" OpName %2 "param" OpDecorate %3 Restrict OpDecorate %3 NonWritable + OpDecorate %2 Restrict OpDecorate %4 LinkageAttributes "HACK(eddyb) keep function alive" Export OpDecorate %1 LinkageAttributes "foo" Export - OpDecorate %2 Restrict %5 = OpTypeVoid %6 = OpTypeInt 32 0 %7 = OpTypePointer Function %6 diff --git a/deny.toml b/deny.toml index d0e5671f4a..cbf284509c 100644 --- a/deny.toml +++ b/deny.toml @@ -3,13 +3,10 @@ # https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html [advisories] vulnerability = "deny" +# FIXME(eddyb) `ansi_term` and `xml-rs` prevent this from being `deny`. unmaintained = "warn" -yanked = "warn" -notice = "warn" -ignore = [ - # Regex advisory, from some dependency - "RUSTSEC-2022-0013" -] +yanked = "deny" +notice = "deny" # This section is considered when running `cargo deny check bans`. # More documentation about the 'bans' section can be found here: @@ -60,6 +57,8 @@ allow = [ "ISC", "Zlib", + + "Unicode-DFS-2016", ] # Allow 1 or more licenses on a per-crate basis, so that particular licenses # aren't accepted for every possible crate as with the normal allow list diff --git a/tests/ui/arch/all_memory_barrier.stderr b/tests/ui/arch/all_memory_barrier.stderr index 6be03bb8e3..99a24af571 100644 --- a/tests/ui/arch/all_memory_barrier.stderr +++ b/tests/ui/arch/all_memory_barrier.stderr @@ -2,6 +2,6 @@ %4 = OpLabel OpLine %5 75 4 OpMemoryBarrier %6 %7 -OpLine %8 9 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/arch/all_memory_barrier_with_group_sync.stderr b/tests/ui/arch/all_memory_barrier_with_group_sync.stderr index bba4823a93..ce22a314ef 100644 --- a/tests/ui/arch/all_memory_barrier_with_group_sync.stderr +++ b/tests/ui/arch/all_memory_barrier_with_group_sync.stderr @@ -2,6 +2,6 @@ %4 = OpLabel OpLine %5 41 4 OpControlBarrier %6 %7 %8 -OpLine %9 9 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/arch/device_memory_barrier.stderr b/tests/ui/arch/device_memory_barrier.stderr index 6be03bb8e3..99a24af571 100644 --- a/tests/ui/arch/device_memory_barrier.stderr +++ b/tests/ui/arch/device_memory_barrier.stderr @@ -2,6 +2,6 @@ %4 = OpLabel OpLine %5 75 4 OpMemoryBarrier %6 %7 -OpLine %8 9 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/arch/device_memory_barrier_with_group_sync.stderr b/tests/ui/arch/device_memory_barrier_with_group_sync.stderr index bba4823a93..ce22a314ef 100644 --- a/tests/ui/arch/device_memory_barrier_with_group_sync.stderr +++ b/tests/ui/arch/device_memory_barrier_with_group_sync.stderr @@ -2,6 +2,6 @@ %4 = OpLabel OpLine %5 41 4 OpControlBarrier %6 %7 %8 -OpLine %9 9 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/arch/workgroup_memory_barrier.stderr b/tests/ui/arch/workgroup_memory_barrier.stderr index 30eaf51944..99a24af571 100644 --- a/tests/ui/arch/workgroup_memory_barrier.stderr +++ b/tests/ui/arch/workgroup_memory_barrier.stderr @@ -2,6 +2,6 @@ %4 = OpLabel OpLine %5 75 4 OpMemoryBarrier %6 %7 -OpLine %8 8 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/arch/workgroup_memory_barrier_with_group_sync.stderr b/tests/ui/arch/workgroup_memory_barrier_with_group_sync.stderr index 27bfbb9c74..37119b71c8 100644 --- a/tests/ui/arch/workgroup_memory_barrier_with_group_sync.stderr +++ b/tests/ui/arch/workgroup_memory_barrier_with_group_sync.stderr @@ -2,6 +2,6 @@ %4 = OpLabel OpLine %5 41 4 OpControlBarrier %6 %6 %7 -OpLine %8 8 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/add_two_ints.stderr b/tests/ui/dis/add_two_ints.stderr index 678a68ffc8..002d10ce6f 100644 --- a/tests/ui/dis/add_two_ints.stderr +++ b/tests/ui/dis/add_two_ints.stderr @@ -4,6 +4,6 @@ %6 = OpLabel OpLine %7 7 4 %8 = OpIAdd %2 %4 %5 -OpLine %7 8 1 +OpNoLine OpReturnValue %8 OpFunctionEnd diff --git a/tests/ui/dis/asm.stderr b/tests/ui/dis/asm.stderr index c61508e135..b0e55dbc55 100644 --- a/tests/ui/dis/asm.stderr +++ b/tests/ui/dis/asm.stderr @@ -2,6 +2,6 @@ %4 = OpLabel OpLine %5 9 8 OpMemoryBarrier %6 %7 -OpLine %5 16 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/asm_add_two_ints.stderr b/tests/ui/dis/asm_add_two_ints.stderr index 3bf27dbbc1..ca526c6105 100644 --- a/tests/ui/dis/asm_add_two_ints.stderr +++ b/tests/ui/dis/asm_add_two_ints.stderr @@ -4,6 +4,6 @@ %6 = OpLabel OpLine %7 10 8 %8 = OpIAdd %2 %4 %5 -OpLine %7 18 1 +OpNoLine OpReturnValue %8 OpFunctionEnd diff --git a/tests/ui/dis/asm_op_decorate.stderr b/tests/ui/dis/asm_op_decorate.stderr index 2f7f60b8f2..0eec323876 100644 --- a/tests/ui/dis/asm_op_decorate.stderr +++ b/tests/ui/dis/asm_op_decorate.stderr @@ -1,29 +1,29 @@ +OpCapability Shader OpCapability Float64 -OpCapability Int16 OpCapability Int64 +OpCapability Int16 OpCapability Int8 -OpCapability RuntimeDescriptorArray OpCapability ShaderClockKHR -OpCapability Shader +OpCapability RuntimeDescriptorArray OpExtension "SPV_EXT_descriptor_indexing" OpExtension "SPV_KHR_shader_clock" OpMemoryModel Logical Simple OpEntryPoint Fragment %1 "main" OpExecutionMode %1 OriginUpperLeft %2 = OpString "$OPSTRING_FILENAME/asm_op_decorate.rs" -OpName %3 "asm_op_decorate::add_decorate" -OpName %4 "asm_op_decorate::main" +OpName %3 "asm_op_decorate::main" +OpName %4 "asm_op_decorate::add_decorate" OpDecorate %5 ArrayStride 4 -OpDecorate %6 DescriptorSet 0 OpDecorate %6 Binding 0 +OpDecorate %6 DescriptorSet 0 %7 = OpTypeVoid %8 = OpTypeFunction %7 -%9 = OpTypeInt 32 0 -%10 = OpConstant %9 1 -%11 = OpTypeFloat 32 -%12 = OpTypeImage %11 2D 0 0 0 1 Unknown -%13 = OpTypeSampledImage %12 -%5 = OpTypeRuntimeArray %13 -%14 = OpTypePointer UniformConstant %5 -%6 = OpVariable %14 UniformConstant -%15 = OpTypePointer UniformConstant %13 +%9 = OpTypeFloat 32 +%10 = OpTypeImage %9 2D 0 0 0 1 Unknown +%11 = OpTypeSampledImage %10 +%12 = OpTypePointer UniformConstant %11 +%5 = OpTypeRuntimeArray %11 +%13 = OpTypePointer UniformConstant %5 +%6 = OpVariable %13 UniformConstant +%14 = OpTypeInt 32 0 +%15 = OpConstant %14 1 diff --git a/tests/ui/dis/complex_image_sample_inst.stderr b/tests/ui/dis/complex_image_sample_inst.stderr index 9994e1706a..2682527c58 100644 --- a/tests/ui/dis/complex_image_sample_inst.stderr +++ b/tests/ui/dis/complex_image_sample_inst.stderr @@ -9,6 +9,6 @@ OpLine %12 18 8 %13 = OpAccessChain %14 %15 %16 %17 = OpLoad %18 %13 %19 = OpImageSampleProjExplicitLod %2 %17 %4 Grad|ConstOffset %5 %7 %20 -OpLine %12 58 1 +OpNoLine OpReturnValue %19 OpFunctionEnd diff --git a/tests/ui/dis/custom_entry_point.stderr b/tests/ui/dis/custom_entry_point.stderr index 2881a9b4e5..e243af37f7 100644 --- a/tests/ui/dis/custom_entry_point.stderr +++ b/tests/ui/dis/custom_entry_point.stderr @@ -1,9 +1,9 @@ +OpCapability Shader OpCapability Float64 -OpCapability Int16 OpCapability Int64 +OpCapability Int16 OpCapability Int8 OpCapability ShaderClockKHR -OpCapability Shader OpExtension "SPV_KHR_shader_clock" OpMemoryModel Logical Simple OpEntryPoint Fragment %1 "hello_world" diff --git a/tests/ui/dis/entry-pass-mode-cast-array.stderr b/tests/ui/dis/entry-pass-mode-cast-array.stderr index 903414df87..5fd5cdd459 100644 --- a/tests/ui/dis/entry-pass-mode-cast-array.stderr +++ b/tests/ui/dis/entry-pass-mode-cast-array.stderr @@ -8,6 +8,6 @@ OpLine %5 14 4 %13 = OpCompositeInsert %7 %11 %6 0 OpLine %5 15 4 OpStore %14 %13 -OpLine %5 16 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/generic-fn-op-name.stderr b/tests/ui/dis/generic-fn-op-name.stderr index 53e5b57536..ea408d66ce 100644 --- a/tests/ui/dis/generic-fn-op-name.stderr +++ b/tests/ui/dis/generic-fn-op-name.stderr @@ -1,15 +1,15 @@ +OpCapability Shader OpCapability Float64 -OpCapability Int16 OpCapability Int64 +OpCapability Int16 OpCapability Int8 OpCapability ShaderClockKHR -OpCapability Shader OpExtension "SPV_KHR_shader_clock" OpMemoryModel Logical Simple OpEntryPoint Fragment %1 "main" OpExecutionMode %1 OriginUpperLeft %2 = OpString "$OPSTRING_FILENAME/generic-fn-op-name.rs" -OpName %3 "generic_fn_op_name::generic::" -OpName %4 "generic_fn_op_name::main" +OpName %3 "generic_fn_op_name::main" +OpName %4 "generic_fn_op_name::generic::" %5 = OpTypeVoid %6 = OpTypeFunction %5 diff --git a/tests/ui/dis/index_user_dst.stderr b/tests/ui/dis/index_user_dst.stderr index 540de9f32b..672942457f 100644 --- a/tests/ui/dis/index_user_dst.stderr +++ b/tests/ui/dis/index_user_dst.stderr @@ -5,30 +5,26 @@ OpLine %5 7 12 %10 = OpArrayLength %11 %8 0 OpLine %5 8 21 %12 = OpULessThan %13 %9 %10 -OpLine %5 8 21 +OpNoLine OpSelectionMerge %14 None OpBranchConditional %12 %15 %16 %15 = OpLabel OpLine %5 8 21 %17 = OpInBoundsAccessChain %18 %6 %9 %19 = OpLoad %20 %17 -OpLine %5 10 1 -OpReturn +OpNoLine +OpBranch %14 %16 = OpLabel -OpLine %5 8 21 OpBranch %21 %21 = OpLabel -OpBranch %22 +OpLoopMerge %22 %23 None +OpBranch %24 +%24 = OpLabel +OpBranch %23 +%23 = OpLabel +OpBranch %21 %22 = OpLabel -%23 = OpPhi %13 %24 %21 %24 %25 -OpLoopMerge %26 %25 None -OpBranchConditional %23 %27 %26 -%27 = OpLabel -OpBranch %25 -%25 = OpLabel -OpBranch %22 -%26 = OpLabel -OpUnreachable +OpBranch %14 %14 = OpLabel -OpUnreachable +OpReturn OpFunctionEnd diff --git a/tests/ui/dis/issue-373.stderr b/tests/ui/dis/issue-373.stderr index ab8e636257..53d36bd250 100644 --- a/tests/ui/dis/issue-373.stderr +++ b/tests/ui/dis/issue-373.stderr @@ -2,10 +2,9 @@ %4 = OpLabel OpLine %5 22 11 %6 = OpFunctionCall %7 %8 -OpLine %5 22 11 %9 = OpCompositeExtract %10 %6 0 OpLine %5 22 4 OpStore %11 %9 -OpLine %5 23 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/issue-723-output.stderr b/tests/ui/dis/issue-723-output.stderr index f1783caaf8..e6c4b35256 100644 --- a/tests/ui/dis/issue-723-output.stderr +++ b/tests/ui/dis/issue-723-output.stderr @@ -1,9 +1,9 @@ +OpCapability Shader OpCapability Float64 -OpCapability Int16 OpCapability Int64 +OpCapability Int16 OpCapability Int8 OpCapability ShaderClockKHR -OpCapability Shader OpExtension "SPV_KHR_shader_clock" OpMemoryModel Logical Simple OpEntryPoint Fragment %1 "main" %2 @@ -11,9 +11,9 @@ OpExecutionMode %1 OriginUpperLeft %3 = OpString "$OPSTRING_FILENAME/issue-723-output.rs" OpName %4 "issue_723_output::main" OpDecorate %2 Location 0 -%5 = OpTypeVoid -%6 = OpTypeFloat 32 -%7 = OpTypeVector %6 4 -%8 = OpTypePointer Output %7 -%9 = OpTypeFunction %5 -%2 = OpVariable %8 Output +%5 = OpTypeFloat 32 +%6 = OpTypeVector %5 4 +%7 = OpTypePointer Output %6 +%8 = OpTypeVoid +%9 = OpTypeFunction %8 +%2 = OpVariable %7 Output diff --git a/tests/ui/dis/issue-731.stderr b/tests/ui/dis/issue-731.stderr index 2a34bdd5f5..78fdc54539 100644 --- a/tests/ui/dis/issue-731.stderr +++ b/tests/ui/dis/issue-731.stderr @@ -8,6 +8,6 @@ OpLine %5 12 4 %13 = OpCompositeInsert %7 %11 %6 0 OpLine %5 13 4 OpStore %14 %13 -OpLine %5 14 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/pass-mode-cast-struct.stderr b/tests/ui/dis/pass-mode-cast-struct.stderr index 5c44a83105..6086516fea 100644 --- a/tests/ui/dis/pass-mode-cast-struct.stderr +++ b/tests/ui/dis/pass-mode-cast-struct.stderr @@ -12,11 +12,10 @@ OpLine %5 29 32 %16 = OpCompositeExtract %15 %9 2 OpLine %5 29 23 %17 = OpIAdd %15 %14 %16 -OpLine %5 29 23 %18 = OpUConvert %13 %17 OpLine %5 29 4 %19 = OpIAdd %13 %12 %18 OpStore %20 %19 -OpLine %5 30 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/ptr_copy.via_intrinsic.stderr b/tests/ui/dis/ptr_copy.via_intrinsic.stderr index 853cc30a95..cb2adb4cbb 100644 --- a/tests/ui/dis/ptr_copy.via_intrinsic.stderr +++ b/tests/ui/dis/ptr_copy.via_intrinsic.stderr @@ -4,6 +4,6 @@ %7 = OpLabel OpLine %8 17 17 OpCopyMemory %6 %4 -OpLine %8 30 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/ptr_read.stderr b/tests/ui/dis/ptr_read.stderr index c20975c585..c14146849d 100644 --- a/tests/ui/dis/ptr_read.stderr +++ b/tests/ui/dis/ptr_read.stderr @@ -6,6 +6,6 @@ OpLine %8 1139 8 %9 = OpLoad %10 %4 OpLine %11 7 13 OpStore %6 %9 -OpLine %11 8 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/ptr_read_method.stderr b/tests/ui/dis/ptr_read_method.stderr index c20975c585..c14146849d 100644 --- a/tests/ui/dis/ptr_read_method.stderr +++ b/tests/ui/dis/ptr_read_method.stderr @@ -6,6 +6,6 @@ OpLine %8 1139 8 %9 = OpLoad %10 %4 OpLine %11 7 13 OpStore %6 %9 -OpLine %11 8 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/ptr_write.stderr b/tests/ui/dis/ptr_write.stderr index a3442ed57d..6270410eba 100644 --- a/tests/ui/dis/ptr_write.stderr +++ b/tests/ui/dis/ptr_write.stderr @@ -6,6 +6,6 @@ OpLine %8 7 35 %9 = OpLoad %10 %4 OpLine %11 1336 8 OpStore %6 %9 -OpLine %8 8 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/dis/ptr_write_method.stderr b/tests/ui/dis/ptr_write_method.stderr index 8ea9dae2dc..ff22ea631f 100644 --- a/tests/ui/dis/ptr_write_method.stderr +++ b/tests/ui/dis/ptr_write_method.stderr @@ -6,6 +6,6 @@ OpLine %8 7 37 %9 = OpLoad %10 %4 OpLine %11 1336 8 OpStore %6 %9 -OpLine %8 8 1 +OpNoLine OpReturn OpFunctionEnd diff --git a/tests/ui/lang/core/unwrap_or.stderr b/tests/ui/lang/core/unwrap_or.stderr index 37b092466a..f5f65db51c 100644 --- a/tests/ui/lang/core/unwrap_or.stderr +++ b/tests/ui/lang/core/unwrap_or.stderr @@ -2,38 +2,30 @@ %4 = OpLabel OpLine %5 11 11 %6 = OpCompositeInsert %7 %8 %9 0 -OpLine %5 11 11 %10 = OpCompositeExtract %11 %6 1 OpLine %12 803 14 %13 = OpBitcast %14 %8 -OpLine %12 803 8 +OpNoLine OpSelectionMerge %15 None OpSwitch %13 %16 0 %17 1 %18 %16 = OpLabel -OpLine %12 803 14 -OpUnreachable +OpBranch %15 %17 = OpLabel -OpLine %12 805 20 OpBranch %15 %18 = OpLabel -OpLine %12 804 23 OpBranch %15 %15 = OpLabel -%19 = OpPhi %20 %21 %17 %22 %18 -%23 = OpPhi %11 %24 %17 %10 %18 -OpBranch %25 -%25 = OpLabel -OpLine %12 807 4 -OpSelectionMerge %26 None -OpBranchConditional %19 %27 %28 -%27 = OpLabel -OpLine %12 807 4 -OpBranch %26 +%19 = OpPhi %20 %21 %16 %22 %17 %23 %18 +%24 = OpPhi %11 %25 %16 %26 %17 %10 %18 +OpSelectionMerge %27 None +OpBranchConditional %19 %28 %29 %28 = OpLabel -OpBranch %26 -%26 = OpLabel +OpBranch %27 +%29 = OpLabel +OpBranch %27 +%27 = OpLabel OpLine %5 11 4 -OpStore %29 %23 -OpLine %5 12 1 +OpStore %30 %24 +OpNoLine OpReturn OpFunctionEnd