[Mlir-commits] [mlir] [mlir][Pass] Handle escaped pipline option values (PR #97667)
Nikhil Kalra
llvmlistbot at llvm.org
Thu Jul 4 09:57:59 PDT 2024
================
@@ -7,6 +7,8 @@
// RUN: mlir-opt %s -verify-each=false -pass-pipeline='builtin.module(func.func(test-options-pass{string-list=a list=1,2,3,4 string-list=b,c list=5 string-list=d string=nested_pipeline{arg1=10 arg2=" {} " arg3=true}}))' -dump-pass-pipeline 2>&1 | FileCheck --check-prefix=CHECK_1 %s
// RUN: mlir-opt %s -verify-each=false -test-options-pass-pipeline='list=1 string-list=a,b enum=one' -dump-pass-pipeline 2>&1 | FileCheck --check-prefix=CHECK_2 %s
// RUN: mlir-opt %s -verify-each=false -pass-pipeline='builtin.module(builtin.module(func.func(test-options-pass{list=3}), func.func(test-options-pass{enum=one list=1,2,3,4})))' -dump-pass-pipeline 2>&1 | FileCheck --check-prefix=CHECK_3 %s
+// RUN: mlir-opt %s -verify-each=false -pass-pipeline='builtin.module(builtin.module(func.func(test-options-pass{list=3}), func.func(test-options-pass{enum=one list=1,2,3,4 string="foobarbaz"})))' -dump-pass-pipeline 2>&1 | FileCheck --check-prefix=CHECK_4 %s
----------------
nikalra wrote:
The parser correctly captures the escaped value, but then populates the options field with the value including the escaped characters.
Basically:
`option=foo` → option: `foo` (correct)
`option=foo bar` → option: `foo`, bar: `true` (correct)
`option="foo bar"` (or any of the other supported escape chars) → option: `"foo bar"` (incorrect, should be `foo bar`)
I'll update the test to include spaces to make it more clear!
https://github.com/llvm/llvm-project/pull/97667
More information about the Mlir-commits
mailing list