From 46a9055740abe27a29500800709f53235f623b3a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 10 Dec 2021 05:41:47 +1000 Subject: [PATCH] retain compat with both ABIs --- 0001-optimizer-restore-previous-ABI.patch | 56 +++++------------------ spirv-tools.spec | 5 +- 2 files changed, 16 insertions(+), 45 deletions(-) diff --git a/0001-optimizer-restore-previous-ABI.patch b/0001-optimizer-restore-previous-ABI.patch index 41b9c17..49b1509 100644 --- a/0001-optimizer-restore-previous-ABI.patch +++ b/0001-optimizer-restore-previous-ABI.patch @@ -1,4 +1,4 @@ -From 76e9ab018c24eaed0bc83c83cf72bc4542e5f1ad Mon Sep 17 00:00:00 2001 +From 449c00f9b32ffb71be7e8274871e1f383b046ca2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 6 Dec 2021 13:49:10 +1000 Subject: [PATCH] optimizer: restore previous ABI. @@ -14,12 +14,12 @@ Broke the C++ ABI for spirv-tools shared libraries on Linux, for not a great rea Restore the previous ABI. --- - include/spirv-tools/optimizer.hpp | 3 ++- - source/opt/optimizer.cpp | 17 +++++++++++------ - 2 files changed, 13 insertions(+), 7 deletions(-) + include/spirv-tools/optimizer.hpp | 3 ++- + source/opt/optimizer.cpp | 5 +++++ + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp -index 21059cbe..a0314b5f 100644 +index 21059cbe..d9c511af 100644 --- a/include/spirv-tools/optimizer.hpp +++ b/include/spirv-tools/optimizer.hpp @@ -519,7 +519,8 @@ Optimizer::PassToken CreateDeadInsertElimPass(); @@ -28,58 +28,26 @@ index 21059cbe..a0314b5f 100644 // is not allowed. -Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface = false); +Optimizer::PassToken CreateAggressiveDCEPass(); -+Optimizer::PassToken CreateAggressiveDCEPassPreserveInterface(); ++Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface); // Creates a remove-unused-interface-variables pass. // Removes variables referenced on the |OpEntryPoint| instruction that are not diff --git a/source/opt/optimizer.cpp b/source/opt/optimizer.cpp -index e74db26f..d5534d08 100644 +index e74db26f..32a3d01e 100644 --- a/source/opt/optimizer.cpp +++ b/source/opt/optimizer.cpp -@@ -419,22 +419,22 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { - RegisterPass(CreateSimplificationPass()); - RegisterPass(CreateDeadBranchElimPass()); - RegisterPass(CreateBlockMergePass()); -- RegisterPass(CreateAggressiveDCEPass(true)); -+ RegisterPass(CreateAggressiveDCEPassPreserveInterface()); - } else if (pass_name == "inst-desc-idx-check") { - RegisterPass(CreateInstBindlessCheckPass(7, 23, true, true)); - RegisterPass(CreateSimplificationPass()); - RegisterPass(CreateDeadBranchElimPass()); - RegisterPass(CreateBlockMergePass()); -- RegisterPass(CreateAggressiveDCEPass(true)); -+ RegisterPass(CreateAggressiveDCEPassPreserveInterface()); - } else if (pass_name == "inst-buff-oob-check") { - RegisterPass(CreateInstBindlessCheckPass(7, 23, false, false, true, true)); - RegisterPass(CreateSimplificationPass()); - RegisterPass(CreateDeadBranchElimPass()); - RegisterPass(CreateBlockMergePass()); -- RegisterPass(CreateAggressiveDCEPass(true)); -+ RegisterPass(CreateAggressiveDCEPassPreserveInterface()); - } else if (pass_name == "inst-buff-addr-check") { - RegisterPass(CreateInstBuffAddrCheckPass(7, 23)); -- RegisterPass(CreateAggressiveDCEPass(true)); -+ RegisterPass(CreateAggressiveDCEPassPreserveInterface()); - } else if (pass_name == "convert-relaxed-to-half") { - RegisterPass(CreateConvertRelaxedToHalfPass()); - } else if (pass_name == "relax-float-ops") { -@@ -764,9 +764,14 @@ Optimizer::PassToken CreateLocalMultiStoreElimPass() { +@@ -764,6 +764,11 @@ Optimizer::PassToken CreateLocalMultiStoreElimPass() { MakeUnique()); } --Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface) { +Optimizer::PassToken CreateAggressiveDCEPass() { - return MakeUnique( -- MakeUnique(preserve_interface)); ++ return MakeUnique( + MakeUnique(false)); +} + -+Optimizer::PassToken CreateAggressiveDCEPassPreserveInterface() { -+ return MakeUnique( -+ MakeUnique(true)); - } - - Optimizer::PassToken CreateRemoveUnusedInterfaceVariablesPass() { + Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface) { + return MakeUnique( + MakeUnique(preserve_interface)); -- 2.33.1 diff --git a/spirv-tools.spec b/spirv-tools.spec index 7d06578..a67a5c3 100644 --- a/spirv-tools.spec +++ b/spirv-tools.spec @@ -7,7 +7,7 @@ Name: spirv-tools Version: 2021.4 -Release: 2%{?gitrel}%{?dist} +Release: 3%{?gitrel}%{?dist} Summary: API and commands for processing SPIR-V modules License: ASL 2.0 @@ -90,6 +90,9 @@ Development files for %{name} %{_libdir}/pkgconfig/SPIRV-Tools.pc %changelog +* Fri Dec 10 2021 Dave Airlie - 2021.4-3.20211110.git21e3f68 +- Retain compat with both ABIs + * Mon Dec 06 2021 Dave Airlie - 2021.4-2.20211110.git21e3f68 - Restore previous ABI