File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
test/Transforms/Scalarizer Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -1053,13 +1053,7 @@ Expected<ScalarizerPassOptions> parseScalarizerOptions(StringRef Params) {
10531053 StringRef ParamName;
10541054 std::tie (ParamName, Params) = Params.split (' ;' );
10551055
1056- bool Enable = !ParamName.consume_front (" no-" );
1057-
1058- if (ParamName == " load-store" )
1059- Result.ScalarizeLoadStore = Enable;
1060- else if (ParamName == " variable-insert-extract" )
1061- Result.ScalarizeVariableInsertExtract = Enable;
1062- else if (Enable && ParamName.consume_front (" min-bits=" )) {
1056+ if (ParamName.consume_front (" min-bits=" )) {
10631057 if (ParamName.getAsInteger (0 , Result.ScalarizeMinBits )) {
10641058 return make_error<StringError>(
10651059 formatv (" invalid argument to Scalarizer pass min-bits "
@@ -1068,6 +1062,16 @@ Expected<ScalarizerPassOptions> parseScalarizerOptions(StringRef Params) {
10681062 .str (),
10691063 inconvertibleErrorCode ());
10701064 }
1065+
1066+ continue ;
1067+ }
1068+
1069+ bool Enable = !ParamName.consume_front (" no-" );
1070+ if (ParamName == " load-store" )
1071+ Result.ScalarizeLoadStore = Enable;
1072+ else if (ParamName == " variable-insert-extract" )
1073+ Result.ScalarizeVariableInsertExtract = Enable;
1074+ else
10711075 } else {
10721076 return make_error<StringError>(
10731077 formatv (" invalid Scalarizer pass parameter '{0}' " , ParamName).str (),
Original file line number Diff line number Diff line change @@ -577,7 +577,7 @@ FUNCTION_PASS_WITH_PARAMS(
577577 [](ScalarizerPassOptions Opts) { return ScalarizerPass (Opts); },
578578 parseScalarizerOptions,
579579 " load-store;no-load-store;variable-insert-extract;"
580- " no-variable-insert-extract;no-min-bits=N; min-bits=N;" )
580+ " no-variable-insert-extract;min-bits=N;" )
581581FUNCTION_PASS_WITH_PARAMS (
582582 " separate-const-offset-from-gep" , " SeparateConstOffsetFromGEPPass" ,
583583 [](bool LowerGEP) { return SeparateConstOffsetFromGEPPass (LowerGEP); },
Original file line number Diff line number Diff line change 22; RUN: not opt -passes='scalarizer<;>' -disable-output %s 2>&1 | FileCheck -check-prefix=UNKNOWNERR %s
33; RUN: not opt -passes='scalarizer<min-bits=>' -disable-output %s 2>&1 | FileCheck -check-prefix=MINBITS-EMPTY-ERR %s
44; RUN: not opt -passes='scalarizer<min-bits=x>' -disable-output %s 2>&1 | FileCheck -check-prefix=MINBITS-NOTINT-ERR %s
5+ ; RUN: not opt -passes='scalarizer<no-min-bits=10>' -disable-output %s 2>&1 | FileCheck -check-prefix=UNKNOWNERR %s
56
67; UNKNOWNERR: invalid Scalarizer pass parameter '{{.*}}'
78; MINBITS-EMPTY-ERR: invalid argument to Scalarizer pass min-bits parameter: ''
You can’t perform that action at this time.
0 commit comments