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) {
1053
1053
StringRef ParamName;
1054
1054
std::tie (ParamName, Params) = Params.split (' ;' );
1055
1055
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=" )) {
1063
1057
if (ParamName.getAsInteger (0 , Result.ScalarizeMinBits )) {
1064
1058
return make_error<StringError>(
1065
1059
formatv (" invalid argument to Scalarizer pass min-bits "
@@ -1068,6 +1062,16 @@ Expected<ScalarizerPassOptions> parseScalarizerOptions(StringRef Params) {
1068
1062
.str (),
1069
1063
inconvertibleErrorCode ());
1070
1064
}
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
1071
1075
} else {
1072
1076
return make_error<StringError>(
1073
1077
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(
577
577
[](ScalarizerPassOptions Opts) { return ScalarizerPass (Opts); },
578
578
parseScalarizerOptions,
579
579
" 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;" )
581
581
FUNCTION_PASS_WITH_PARAMS (
582
582
" separate-const-offset-from-gep" , " SeparateConstOffsetFromGEPPass" ,
583
583
[](bool LowerGEP) { return SeparateConstOffsetFromGEPPass (LowerGEP); },
Original file line number Diff line number Diff line change 2
2
; RUN: not opt -passes='scalarizer<;>' -disable-output %s 2>&1 | FileCheck -check-prefix=UNKNOWNERR %s
3
3
; RUN: not opt -passes='scalarizer<min-bits=>' -disable-output %s 2>&1 | FileCheck -check-prefix=MINBITS-EMPTY-ERR %s
4
4
; 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
5
6
6
7
; UNKNOWNERR: invalid Scalarizer pass parameter '{{.*}}'
7
8
; MINBITS-EMPTY-ERR: invalid argument to Scalarizer pass min-bits parameter: ''
You can’t perform that action at this time.
0 commit comments