[Mlir-commits] [mlir] [mlir][spirv] Allow disabling control flow structurization (PR #140561)

Lei Zhang llvmlistbot at llvm.org
Sun May 25 08:16:08 PDT 2025


================
@@ -51,17 +52,24 @@ deserializeModule(const llvm::MemoryBuffer *input, MLIRContext *context) {
 
   auto binary = llvm::ArrayRef(reinterpret_cast<const uint32_t *>(start),
                                size / sizeof(uint32_t));
-  return spirv::deserialize(binary, context);
+  return spirv::deserialize(binary, context, enableControlFlowStructurization);
 }
 
 namespace mlir {
 void registerFromSPIRVTranslation() {
+  static llvm::cl::opt<bool> noControlFlowStructurization(
+      "spirv-no-control-flow-structurization",
----------------
antiagainst wrote:

I think we can call it `spirv-structurize-control-flow` and make it default to true--typically positive mode reads more naturally for human.

https://github.com/llvm/llvm-project/pull/140561


More information about the Mlir-commits mailing list