116 |
116 |
117 return Flag::SUCCESS; |
117 return Flag::SUCCESS; |
118 } |
118 } |
119 |
119 |
120 Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) { |
120 Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) { |
121 if (value < 1 || value > max_jint) { |
121 intx max_value = 512; |
|
122 if (value < 1 || value > max_value) { |
122 CommandLineError::print(verbose, |
123 CommandLineError::print(verbose, |
123 "AllocatePrefetchStepSize (" INTX_FORMAT ") " |
124 "AllocatePrefetchStepSize (" INTX_FORMAT ") " |
124 "must be between 1 and %d\n", |
125 "must be between 1 and %d\n", |
125 AllocatePrefetchStepSize, |
126 AllocatePrefetchStepSize, |
126 max_jint); |
127 max_value); |
127 return Flag::VIOLATES_CONSTRAINT; |
128 return Flag::VIOLATES_CONSTRAINT; |
128 } |
129 } |
129 |
130 |
130 if (AllocatePrefetchDistance % AllocatePrefetchStepSize != 0) { |
131 if (AllocatePrefetchDistance % AllocatePrefetchStepSize != 0) { |
131 CommandLineError::print(verbose, |
132 CommandLineError::print(verbose, |
132 "AllocatePrefetchDistance (" INTX_FORMAT ") " |
133 "AllocatePrefetchDistance (" INTX_FORMAT ") " |
133 "%% AllocatePrefetchStepSize (" INTX_FORMAT ") " |
134 "%% AllocatePrefetchStepSize (" INTX_FORMAT ") " |
134 "= " INTX_FORMAT " " |
135 "= " INTX_FORMAT " " |
135 "must be 0\n", |
136 "must be 0\n", |
136 AllocatePrefetchDistance, AllocatePrefetchStepSize, |
137 AllocatePrefetchDistance, AllocatePrefetchStepSize, |
137 AllocatePrefetchDistance % AllocatePrefetchStepSize); |
138 AllocatePrefetchDistance % AllocatePrefetchStepSize); |
138 return Flag::VIOLATES_CONSTRAINT; |
139 return Flag::VIOLATES_CONSTRAINT; |
139 } |
140 } |
140 |
141 |
141 return Flag::SUCCESS; |
142 /* The limit of 64 for the quotient of AllocatePrefetchDistance and AllocatePrefetchSize |
|
143 * originates from the limit of 64 for AllocatePrefetchLines/AllocateInstancePrefetchLines. |
|
144 * If AllocatePrefetchStyle == 2, the quotient from above is used in PhaseMacroExpand::prefetch_allocation() |
|
145 * to determine the number of lines to prefetch. For other values of AllocatePrefetchStyle, |
|
146 * AllocatePrefetchDistance and AllocatePrefetchSize is used. For consistency, all these |
|
147 * quantities must have the same limit (64 in this case). |
|
148 */ |
|
149 if (AllocatePrefetchDistance / AllocatePrefetchStepSize > 64) { |
|
150 CommandLineError::print(verbose, |
|
151 "AllocatePrefetchDistance (" INTX_FORMAT ") too large or " |
|
152 "AllocatePrefetchStepSize (" INTX_FORMAT ") too small; " |
|
153 "try decreasing/increasing values so that " |
|
154 "AllocatePrefetchDistance / AllocatePrefetchStepSize <= 64\n", |
|
155 AllocatePrefetchDistance, AllocatePrefetchStepSize, |
|
156 AllocatePrefetchDistance % AllocatePrefetchStepSize); |
|
157 return Flag::VIOLATES_CONSTRAINT; |
|
158 } |
|
159 |
|
160 return Flag::SUCCESS; |
142 } |
161 } |
143 |
162 |
144 Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) { |
163 Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) { |
145 if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) { |
164 if (value < 0 || value > INT_MAX >> InvocationCounter::count_shift) { |
146 CommandLineError::print(verbose, |
165 CommandLineError::print(verbose, |