Mingyao Yang | f384f88 | 2014-10-22 16:08:18 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ART_COMPILER_OPTIMIZING_BOUNDS_CHECK_ELIMINATION_H_ |
| 18 | #define ART_COMPILER_OPTIMIZING_BOUNDS_CHECK_ELIMINATION_H_ |
| 19 | |
| 20 | #include "optimization.h" |
| 21 | |
| 22 | namespace art { |
| 23 | |
Aart Bik | 4a34277 | 2015-11-30 10:17:46 -0800 | [diff] [blame] | 24 | class SideEffectsAnalysis; |
Aart Bik | 22af3be | 2015-09-10 12:50:58 -0700 | [diff] [blame] | 25 | class HInductionVarAnalysis; |
| 26 | |
Mingyao Yang | f384f88 | 2014-10-22 16:08:18 -0700 | [diff] [blame] | 27 | class BoundsCheckElimination : public HOptimization { |
| 28 | public: |
Aart Bik | 4a34277 | 2015-11-30 10:17:46 -0800 | [diff] [blame] | 29 | BoundsCheckElimination(HGraph* graph, |
| 30 | const SideEffectsAnalysis& side_effects, |
| 31 | HInductionVarAnalysis* induction_analysis) |
Aart Bik | 22af3be | 2015-09-10 12:50:58 -0700 | [diff] [blame] | 32 | : HOptimization(graph, kBoundsCheckEliminiationPassName), |
Aart Bik | 4a34277 | 2015-11-30 10:17:46 -0800 | [diff] [blame] | 33 | side_effects_(side_effects), |
Aart Bik | 22af3be | 2015-09-10 12:50:58 -0700 | [diff] [blame] | 34 | induction_analysis_(induction_analysis) {} |
Mingyao Yang | f384f88 | 2014-10-22 16:08:18 -0700 | [diff] [blame] | 35 | |
| 36 | void Run() OVERRIDE; |
| 37 | |
Andreas Gampe | 7c3952f | 2015-02-19 18:21:24 -0800 | [diff] [blame] | 38 | static constexpr const char* kBoundsCheckEliminiationPassName = "BCE"; |
| 39 | |
Mingyao Yang | f384f88 | 2014-10-22 16:08:18 -0700 | [diff] [blame] | 40 | private: |
Aart Bik | 4a34277 | 2015-11-30 10:17:46 -0800 | [diff] [blame] | 41 | const SideEffectsAnalysis& side_effects_; |
Aart Bik | 22af3be | 2015-09-10 12:50:58 -0700 | [diff] [blame] | 42 | HInductionVarAnalysis* induction_analysis_; |
| 43 | |
Mingyao Yang | f384f88 | 2014-10-22 16:08:18 -0700 | [diff] [blame] | 44 | DISALLOW_COPY_AND_ASSIGN(BoundsCheckElimination); |
| 45 | }; |
| 46 | |
| 47 | } // namespace art |
| 48 | |
| 49 | #endif // ART_COMPILER_OPTIMIZING_BOUNDS_CHECK_ELIMINATION_H_ |