Add RegisterLegalizationPasses() into the interface
Add note to mention the use scenario. The original list came
from Glslang.
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp
index 9314adc..805132c 100644
--- a/include/spirv-tools/optimizer.hpp
+++ b/include/spirv-tools/optimizer.hpp
@@ -87,6 +87,16 @@
// from time to time.
Optimizer& RegisterSizePasses();
+ // Registers passes that attempt to legalize the generated code.
+ //
+ // Note: this recipe is specially for legalizing SPIR-V. It should be used
+ // by compilers after translating HLSL source code literally. It should
+ // *not* be used by general workloads for performance or size improvement.
+ //
+ // This sequence of passes is subject to constant review and will change
+ // from time to time.
+ Optimizer& RegisterLegalizationPasses();
+
// Optimizes the given SPIR-V module |original_binary| and writes the
// optimized binary into |optimized_binary|.
// Returns true on successful optimization, whether or not the module is