Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [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_LOCATIONS_H_ |
| 18 | #define ART_COMPILER_OPTIMIZING_LOCATIONS_H_ |
| 19 | |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 20 | #include "base/arena_containers.h" |
Mathieu Chartier | b666f48 | 2015-02-18 14:33:14 -0800 | [diff] [blame] | 21 | #include "base/arena_object.h" |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 22 | #include "base/bit_field.h" |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 23 | #include "base/bit_vector.h" |
Ian Rogers | 0279ebb | 2014-10-08 17:27:48 -0700 | [diff] [blame] | 24 | #include "base/value_object.h" |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 25 | |
| 26 | namespace art { |
| 27 | |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 28 | class HConstant; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 29 | class HInstruction; |
Nicolas Geoffray | 424f676 | 2014-11-03 14:51:25 +0000 | [diff] [blame] | 30 | class Location; |
| 31 | |
| 32 | std::ostream& operator<<(std::ostream& os, const Location& location); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * A Location is an abstraction over the potential location |
| 36 | * of an instruction. It could be in register or stack. |
| 37 | */ |
Vladimir Marko | 76c92ac | 2015-09-17 15:39:16 +0100 | [diff] [blame] | 38 | class Location : public ValueObject { |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 39 | public: |
Nicolas Geoffray | 6c2dff8 | 2015-01-21 14:56:54 +0000 | [diff] [blame] | 40 | enum OutputOverlap { |
Roland Levillain | 3d31242 | 2016-06-23 13:53:42 +0100 | [diff] [blame^] | 41 | // The liveness of the output overlaps the liveness of one or |
| 42 | // several input(s); the register allocator cannot reuse an |
| 43 | // input's location for the output's location. |
Nicolas Geoffray | 6c2dff8 | 2015-01-21 14:56:54 +0000 | [diff] [blame] | 44 | kOutputOverlap, |
Roland Levillain | 3d31242 | 2016-06-23 13:53:42 +0100 | [diff] [blame^] | 45 | // The liveness of the output does not overlap the liveness of any |
| 46 | // input; the register allocator is allowed to reuse an input's |
| 47 | // location for the output's location. |
Nicolas Geoffray | 6c2dff8 | 2015-01-21 14:56:54 +0000 | [diff] [blame] | 48 | kNoOutputOverlap |
| 49 | }; |
Nicolas Geoffray | 9ae0daa | 2014-09-30 22:40:23 +0100 | [diff] [blame] | 50 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 51 | enum Kind { |
| 52 | kInvalid = 0, |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 53 | kConstant = 1, |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 54 | kStackSlot = 2, // 32bit stack slot. |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 55 | kDoubleStackSlot = 3, // 64bit stack slot. |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 56 | |
| 57 | kRegister = 4, // Core register. |
| 58 | |
| 59 | // We do not use the value 5 because it conflicts with kLocationConstantMask. |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 60 | kDoNotUse5 = 5, |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 61 | |
Nicolas Geoffray | 1ba0f59 | 2014-10-27 15:14:55 +0000 | [diff] [blame] | 62 | kFpuRegister = 6, // Float register. |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 63 | |
Nicolas Geoffray | 1ba0f59 | 2014-10-27 15:14:55 +0000 | [diff] [blame] | 64 | kRegisterPair = 7, // Long register. |
| 65 | |
| 66 | kFpuRegisterPair = 8, // Double register. |
| 67 | |
| 68 | // We do not use the value 9 because it conflicts with kLocationConstantMask. |
| 69 | kDoNotUse9 = 9, |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 70 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 71 | // Unallocated location represents a location that is not fixed and can be |
| 72 | // allocated by a register allocator. Each unallocated location has |
| 73 | // a policy that specifies what kind of location is suitable. Payload |
| 74 | // contains register allocation policy. |
Mark Mendell | 3e6a3bf | 2015-01-19 14:09:22 -0500 | [diff] [blame] | 75 | kUnallocated = 10, |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 76 | }; |
| 77 | |
Vladimir Marko | 76c92ac | 2015-09-17 15:39:16 +0100 | [diff] [blame] | 78 | Location() : ValueObject(), value_(kInvalid) { |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 79 | // Verify that non-constant location kinds do not interfere with kConstant. |
Andreas Gampe | 785d2f2 | 2014-11-03 22:57:30 -0800 | [diff] [blame] | 80 | static_assert((kInvalid & kLocationConstantMask) != kConstant, "TagError"); |
| 81 | static_assert((kUnallocated & kLocationConstantMask) != kConstant, "TagError"); |
| 82 | static_assert((kStackSlot & kLocationConstantMask) != kConstant, "TagError"); |
| 83 | static_assert((kDoubleStackSlot & kLocationConstantMask) != kConstant, "TagError"); |
| 84 | static_assert((kRegister & kLocationConstantMask) != kConstant, "TagError"); |
Andreas Gampe | 785d2f2 | 2014-11-03 22:57:30 -0800 | [diff] [blame] | 85 | static_assert((kFpuRegister & kLocationConstantMask) != kConstant, "TagError"); |
| 86 | static_assert((kRegisterPair & kLocationConstantMask) != kConstant, "TagError"); |
| 87 | static_assert((kFpuRegisterPair & kLocationConstantMask) != kConstant, "TagError"); |
| 88 | static_assert((kConstant & kLocationConstantMask) == kConstant, "TagError"); |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 89 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 90 | DCHECK(!IsValid()); |
| 91 | } |
| 92 | |
Vladimir Marko | fa6b93c | 2015-09-15 10:15:55 +0100 | [diff] [blame] | 93 | Location(const Location& other) : value_(other.value_) {} |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 94 | |
| 95 | Location& operator=(const Location& other) { |
| 96 | value_ = other.value_; |
| 97 | return *this; |
| 98 | } |
| 99 | |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 100 | bool IsConstant() const { |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 101 | return (value_ & kLocationConstantMask) == kConstant; |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | static Location ConstantLocation(HConstant* constant) { |
| 105 | DCHECK(constant != nullptr); |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 106 | return Location(kConstant | reinterpret_cast<uintptr_t>(constant)); |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | HConstant* GetConstant() const { |
| 110 | DCHECK(IsConstant()); |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 111 | return reinterpret_cast<HConstant*>(value_ & ~kLocationConstantMask); |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 112 | } |
| 113 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 114 | bool IsValid() const { |
| 115 | return value_ != kInvalid; |
| 116 | } |
| 117 | |
| 118 | bool IsInvalid() const { |
| 119 | return !IsValid(); |
| 120 | } |
| 121 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 122 | // Empty location. Used if there the location should be ignored. |
| 123 | static Location NoLocation() { |
| 124 | return Location(); |
| 125 | } |
| 126 | |
| 127 | // Register locations. |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 128 | static Location RegisterLocation(int reg) { |
| 129 | return Location(kRegister, reg); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 130 | } |
| 131 | |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 132 | static Location FpuRegisterLocation(int reg) { |
| 133 | return Location(kFpuRegister, reg); |
| 134 | } |
| 135 | |
| 136 | static Location RegisterPairLocation(int low, int high) { |
| 137 | return Location(kRegisterPair, low << 16 | high); |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 138 | } |
| 139 | |
Nicolas Geoffray | 1ba0f59 | 2014-10-27 15:14:55 +0000 | [diff] [blame] | 140 | static Location FpuRegisterPairLocation(int low, int high) { |
| 141 | return Location(kFpuRegisterPair, low << 16 | high); |
| 142 | } |
| 143 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 144 | bool IsRegister() const { |
| 145 | return GetKind() == kRegister; |
| 146 | } |
| 147 | |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 148 | bool IsFpuRegister() const { |
| 149 | return GetKind() == kFpuRegister; |
| 150 | } |
| 151 | |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 152 | bool IsRegisterPair() const { |
| 153 | return GetKind() == kRegisterPair; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 154 | } |
| 155 | |
Nicolas Geoffray | 1ba0f59 | 2014-10-27 15:14:55 +0000 | [diff] [blame] | 156 | bool IsFpuRegisterPair() const { |
| 157 | return GetKind() == kFpuRegisterPair; |
| 158 | } |
| 159 | |
Nicolas Geoffray | da02afe | 2015-02-11 02:29:42 +0000 | [diff] [blame] | 160 | bool IsRegisterKind() const { |
| 161 | return IsRegister() || IsFpuRegister() || IsRegisterPair() || IsFpuRegisterPair(); |
| 162 | } |
| 163 | |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 164 | int reg() const { |
| 165 | DCHECK(IsRegister() || IsFpuRegister()); |
| 166 | return GetPayload(); |
| 167 | } |
| 168 | |
Nicolas Geoffray | 840e546 | 2015-01-07 16:01:24 +0000 | [diff] [blame] | 169 | int low() const { |
| 170 | DCHECK(IsPair()); |
| 171 | return GetPayload() >> 16; |
| 172 | } |
| 173 | |
| 174 | int high() const { |
| 175 | DCHECK(IsPair()); |
| 176 | return GetPayload() & 0xFFFF; |
| 177 | } |
| 178 | |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 179 | template <typename T> |
Roland Levillain | 271ab9c | 2014-11-27 15:23:57 +0000 | [diff] [blame] | 180 | T AsRegister() const { |
| 181 | DCHECK(IsRegister()); |
| 182 | return static_cast<T>(reg()); |
| 183 | } |
| 184 | |
| 185 | template <typename T> |
| 186 | T AsFpuRegister() const { |
| 187 | DCHECK(IsFpuRegister()); |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 188 | return static_cast<T>(reg()); |
| 189 | } |
| 190 | |
| 191 | template <typename T> |
| 192 | T AsRegisterPairLow() const { |
| 193 | DCHECK(IsRegisterPair()); |
Nicolas Geoffray | 840e546 | 2015-01-07 16:01:24 +0000 | [diff] [blame] | 194 | return static_cast<T>(low()); |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | template <typename T> |
| 198 | T AsRegisterPairHigh() const { |
| 199 | DCHECK(IsRegisterPair()); |
Nicolas Geoffray | 840e546 | 2015-01-07 16:01:24 +0000 | [diff] [blame] | 200 | return static_cast<T>(high()); |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 201 | } |
| 202 | |
Nicolas Geoffray | 1ba0f59 | 2014-10-27 15:14:55 +0000 | [diff] [blame] | 203 | template <typename T> |
| 204 | T AsFpuRegisterPairLow() const { |
| 205 | DCHECK(IsFpuRegisterPair()); |
Nicolas Geoffray | 840e546 | 2015-01-07 16:01:24 +0000 | [diff] [blame] | 206 | return static_cast<T>(low()); |
Nicolas Geoffray | 1ba0f59 | 2014-10-27 15:14:55 +0000 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | template <typename T> |
| 210 | T AsFpuRegisterPairHigh() const { |
| 211 | DCHECK(IsFpuRegisterPair()); |
Nicolas Geoffray | 840e546 | 2015-01-07 16:01:24 +0000 | [diff] [blame] | 212 | return static_cast<T>(high()); |
| 213 | } |
| 214 | |
| 215 | bool IsPair() const { |
| 216 | return IsRegisterPair() || IsFpuRegisterPair(); |
| 217 | } |
| 218 | |
| 219 | Location ToLow() const { |
Nicolas Geoffray | 234d69d | 2015-03-09 10:28:50 +0000 | [diff] [blame] | 220 | if (IsRegisterPair()) { |
| 221 | return Location::RegisterLocation(low()); |
| 222 | } else if (IsFpuRegisterPair()) { |
| 223 | return Location::FpuRegisterLocation(low()); |
| 224 | } else { |
| 225 | DCHECK(IsDoubleStackSlot()); |
| 226 | return Location::StackSlot(GetStackIndex()); |
| 227 | } |
Nicolas Geoffray | 840e546 | 2015-01-07 16:01:24 +0000 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | Location ToHigh() const { |
Nicolas Geoffray | 234d69d | 2015-03-09 10:28:50 +0000 | [diff] [blame] | 231 | if (IsRegisterPair()) { |
| 232 | return Location::RegisterLocation(high()); |
| 233 | } else if (IsFpuRegisterPair()) { |
| 234 | return Location::FpuRegisterLocation(high()); |
| 235 | } else { |
| 236 | DCHECK(IsDoubleStackSlot()); |
| 237 | return Location::StackSlot(GetHighStackIndex(4)); |
| 238 | } |
Nicolas Geoffray | 1ba0f59 | 2014-10-27 15:14:55 +0000 | [diff] [blame] | 239 | } |
| 240 | |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 241 | static uintptr_t EncodeStackIndex(intptr_t stack_index) { |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 242 | DCHECK(-kStackIndexBias <= stack_index); |
| 243 | DCHECK(stack_index < kStackIndexBias); |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 244 | return static_cast<uintptr_t>(kStackIndexBias + stack_index); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | static Location StackSlot(intptr_t stack_index) { |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 248 | uintptr_t payload = EncodeStackIndex(stack_index); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 249 | Location loc(kStackSlot, payload); |
| 250 | // Ensure that sign is preserved. |
| 251 | DCHECK_EQ(loc.GetStackIndex(), stack_index); |
| 252 | return loc; |
| 253 | } |
| 254 | |
| 255 | bool IsStackSlot() const { |
| 256 | return GetKind() == kStackSlot; |
| 257 | } |
| 258 | |
| 259 | static Location DoubleStackSlot(intptr_t stack_index) { |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 260 | uintptr_t payload = EncodeStackIndex(stack_index); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 261 | Location loc(kDoubleStackSlot, payload); |
| 262 | // Ensure that sign is preserved. |
| 263 | DCHECK_EQ(loc.GetStackIndex(), stack_index); |
| 264 | return loc; |
| 265 | } |
| 266 | |
| 267 | bool IsDoubleStackSlot() const { |
| 268 | return GetKind() == kDoubleStackSlot; |
| 269 | } |
| 270 | |
| 271 | intptr_t GetStackIndex() const { |
| 272 | DCHECK(IsStackSlot() || IsDoubleStackSlot()); |
| 273 | // Decode stack index manually to preserve sign. |
| 274 | return GetPayload() - kStackIndexBias; |
| 275 | } |
| 276 | |
| 277 | intptr_t GetHighStackIndex(uintptr_t word_size) const { |
| 278 | DCHECK(IsDoubleStackSlot()); |
| 279 | // Decode stack index manually to preserve sign. |
| 280 | return GetPayload() - kStackIndexBias + word_size; |
| 281 | } |
| 282 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 283 | Kind GetKind() const { |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 284 | return IsConstant() ? kConstant : KindField::Decode(value_); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | bool Equals(Location other) const { |
| 288 | return value_ == other.value_; |
| 289 | } |
| 290 | |
Nicolas Geoffray | f7a0c4e | 2015-02-10 17:08:47 +0000 | [diff] [blame] | 291 | bool Contains(Location other) const { |
| 292 | if (Equals(other)) { |
| 293 | return true; |
Zheng Xu | ad4450e | 2015-04-17 18:48:56 +0800 | [diff] [blame] | 294 | } else if (IsPair() || IsDoubleStackSlot()) { |
| 295 | return ToLow().Equals(other) || ToHigh().Equals(other); |
Nicolas Geoffray | f7a0c4e | 2015-02-10 17:08:47 +0000 | [diff] [blame] | 296 | } |
| 297 | return false; |
| 298 | } |
| 299 | |
Zheng Xu | ad4450e | 2015-04-17 18:48:56 +0800 | [diff] [blame] | 300 | bool OverlapsWith(Location other) const { |
| 301 | // Only check the overlapping case that can happen with our register allocation algorithm. |
| 302 | bool overlap = Contains(other) || other.Contains(*this); |
| 303 | if (kIsDebugBuild && !overlap) { |
| 304 | // Note: These are also overlapping cases. But we are not able to handle them in |
| 305 | // ParallelMoveResolverWithSwap. Make sure that we do not meet such case with our compiler. |
| 306 | if ((IsPair() && other.IsPair()) || (IsDoubleStackSlot() && other.IsDoubleStackSlot())) { |
| 307 | DCHECK(!Contains(other.ToLow())); |
| 308 | DCHECK(!Contains(other.ToHigh())); |
| 309 | } |
| 310 | } |
| 311 | return overlap; |
| 312 | } |
| 313 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 314 | const char* DebugString() const { |
| 315 | switch (GetKind()) { |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 316 | case kInvalid: return "I"; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 317 | case kRegister: return "R"; |
| 318 | case kStackSlot: return "S"; |
| 319 | case kDoubleStackSlot: return "DS"; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 320 | case kUnallocated: return "U"; |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 321 | case kConstant: return "C"; |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 322 | case kFpuRegister: return "F"; |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 323 | case kRegisterPair: return "RP"; |
Nicolas Geoffray | 1ba0f59 | 2014-10-27 15:14:55 +0000 | [diff] [blame] | 324 | case kFpuRegisterPair: return "FP"; |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 325 | case kDoNotUse5: // fall-through |
| 326 | case kDoNotUse9: |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 327 | LOG(FATAL) << "Should not use this location kind"; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 328 | } |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 329 | UNREACHABLE(); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 330 | return "?"; |
| 331 | } |
| 332 | |
| 333 | // Unallocated locations. |
| 334 | enum Policy { |
| 335 | kAny, |
| 336 | kRequiresRegister, |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 337 | kRequiresFpuRegister, |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 338 | kSameAsFirstInput, |
| 339 | }; |
| 340 | |
| 341 | bool IsUnallocated() const { |
| 342 | return GetKind() == kUnallocated; |
| 343 | } |
| 344 | |
| 345 | static Location UnallocatedLocation(Policy policy) { |
| 346 | return Location(kUnallocated, PolicyField::Encode(policy)); |
| 347 | } |
| 348 | |
| 349 | // Any free register is suitable to replace this unallocated location. |
| 350 | static Location Any() { |
| 351 | return UnallocatedLocation(kAny); |
| 352 | } |
| 353 | |
| 354 | static Location RequiresRegister() { |
| 355 | return UnallocatedLocation(kRequiresRegister); |
| 356 | } |
| 357 | |
Nicolas Geoffray | 7fb49da | 2014-10-06 09:12:41 +0100 | [diff] [blame] | 358 | static Location RequiresFpuRegister() { |
| 359 | return UnallocatedLocation(kRequiresFpuRegister); |
| 360 | } |
| 361 | |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 362 | static Location RegisterOrConstant(HInstruction* instruction); |
Mark Mendell | ea5af68 | 2015-10-22 17:35:49 -0400 | [diff] [blame] | 363 | static Location RegisterOrInt32Constant(HInstruction* instruction); |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 364 | static Location ByteRegisterOrConstant(int reg, HInstruction* instruction); |
Mark Mendell | ea5af68 | 2015-10-22 17:35:49 -0400 | [diff] [blame] | 365 | static Location FpuRegisterOrConstant(HInstruction* instruction); |
| 366 | static Location FpuRegisterOrInt32Constant(HInstruction* instruction); |
Nicolas Geoffray | 96f89a2 | 2014-07-11 10:57:49 +0100 | [diff] [blame] | 367 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 368 | // The location of the first input to the instruction will be |
| 369 | // used to replace this unallocated location. |
| 370 | static Location SameAsFirstInput() { |
| 371 | return UnallocatedLocation(kSameAsFirstInput); |
| 372 | } |
| 373 | |
| 374 | Policy GetPolicy() const { |
| 375 | DCHECK(IsUnallocated()); |
| 376 | return PolicyField::Decode(GetPayload()); |
| 377 | } |
| 378 | |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 379 | uintptr_t GetEncoding() const { |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 380 | return GetPayload(); |
| 381 | } |
| 382 | |
| 383 | private: |
| 384 | // Number of bits required to encode Kind value. |
| 385 | static constexpr uint32_t kBitsForKind = 4; |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 386 | static constexpr uint32_t kBitsForPayload = kBitsPerIntPtrT - kBitsForKind; |
| 387 | static constexpr uintptr_t kLocationConstantMask = 0x3; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 388 | |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 389 | explicit Location(uintptr_t value) : value_(value) {} |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 390 | |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 391 | Location(Kind kind, uintptr_t payload) |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 392 | : value_(KindField::Encode(kind) | PayloadField::Encode(payload)) {} |
| 393 | |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 394 | uintptr_t GetPayload() const { |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 395 | return PayloadField::Decode(value_); |
| 396 | } |
| 397 | |
| 398 | typedef BitField<Kind, 0, kBitsForKind> KindField; |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 399 | typedef BitField<uintptr_t, kBitsForKind, kBitsForPayload> PayloadField; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 400 | |
| 401 | // Layout for kUnallocated locations payload. |
| 402 | typedef BitField<Policy, 0, 3> PolicyField; |
| 403 | |
| 404 | // Layout for stack slots. |
| 405 | static const intptr_t kStackIndexBias = |
| 406 | static_cast<intptr_t>(1) << (kBitsForPayload - 1); |
| 407 | |
| 408 | // Location either contains kind and payload fields or a tagged handle for |
| 409 | // a constant locations. Values of enumeration Kind are selected in such a |
| 410 | // way that none of them can be interpreted as a kConstant tag. |
Ian Rogers | 1373595 | 2014-10-08 12:43:28 -0700 | [diff] [blame] | 411 | uintptr_t value_; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 412 | }; |
Ian Rogers | 6a3c1fc | 2014-10-31 00:33:20 -0700 | [diff] [blame] | 413 | std::ostream& operator<<(std::ostream& os, const Location::Kind& rhs); |
| 414 | std::ostream& operator<<(std::ostream& os, const Location::Policy& rhs); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 415 | |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 416 | class RegisterSet : public ValueObject { |
| 417 | public: |
| 418 | RegisterSet() : core_registers_(0), floating_point_registers_(0) {} |
| 419 | |
| 420 | void Add(Location loc) { |
Nicolas Geoffray | 56b9ee6 | 2014-10-09 11:47:51 +0100 | [diff] [blame] | 421 | if (loc.IsRegister()) { |
| 422 | core_registers_ |= (1 << loc.reg()); |
| 423 | } else { |
| 424 | DCHECK(loc.IsFpuRegister()); |
| 425 | floating_point_registers_ |= (1 << loc.reg()); |
| 426 | } |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 427 | } |
| 428 | |
Nicolas Geoffray | 19a19cf | 2014-10-22 16:07:05 +0100 | [diff] [blame] | 429 | void Remove(Location loc) { |
| 430 | if (loc.IsRegister()) { |
| 431 | core_registers_ &= ~(1 << loc.reg()); |
| 432 | } else { |
Nicolas Geoffray | 424f676 | 2014-11-03 14:51:25 +0000 | [diff] [blame] | 433 | DCHECK(loc.IsFpuRegister()) << loc; |
Nicolas Geoffray | 19a19cf | 2014-10-22 16:07:05 +0100 | [diff] [blame] | 434 | floating_point_registers_ &= ~(1 << loc.reg()); |
| 435 | } |
| 436 | } |
| 437 | |
Nicolas Geoffray | 45b83af | 2015-07-06 15:12:53 +0000 | [diff] [blame] | 438 | bool ContainsCoreRegister(uint32_t id) const { |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 439 | return Contains(core_registers_, id); |
| 440 | } |
| 441 | |
Nicolas Geoffray | 45b83af | 2015-07-06 15:12:53 +0000 | [diff] [blame] | 442 | bool ContainsFloatingPointRegister(uint32_t id) const { |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 443 | return Contains(floating_point_registers_, id); |
| 444 | } |
| 445 | |
| 446 | static bool Contains(uint32_t register_set, uint32_t reg) { |
| 447 | return (register_set & (1 << reg)) != 0; |
| 448 | } |
| 449 | |
Nicolas Geoffray | 87d0376 | 2014-11-19 15:17:56 +0000 | [diff] [blame] | 450 | size_t GetNumberOfRegisters() const { |
| 451 | return __builtin_popcount(core_registers_) + __builtin_popcount(floating_point_registers_); |
| 452 | } |
| 453 | |
Nicolas Geoffray | 9889396 | 2015-01-21 12:32:32 +0000 | [diff] [blame] | 454 | uint32_t GetCoreRegisters() const { |
| 455 | return core_registers_; |
| 456 | } |
| 457 | |
| 458 | uint32_t GetFloatingPointRegisters() const { |
| 459 | return floating_point_registers_; |
| 460 | } |
| 461 | |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 462 | private: |
| 463 | uint32_t core_registers_; |
| 464 | uint32_t floating_point_registers_; |
| 465 | |
| 466 | DISALLOW_COPY_AND_ASSIGN(RegisterSet); |
| 467 | }; |
| 468 | |
Andreas Gampe | 878d58c | 2015-01-15 23:24:00 -0800 | [diff] [blame] | 469 | static constexpr bool kIntrinsified = true; |
| 470 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 471 | /** |
| 472 | * The code generator computes LocationSummary for each instruction so that |
| 473 | * the instruction itself knows what code to generate: where to find the inputs |
| 474 | * and where to place the result. |
| 475 | * |
| 476 | * The intent is to have the code for generating the instruction independent of |
| 477 | * register allocation. A register allocator just has to provide a LocationSummary. |
| 478 | */ |
Vladimir Marko | 5233f93 | 2015-09-29 19:01:15 +0100 | [diff] [blame] | 479 | class LocationSummary : public ArenaObject<kArenaAllocLocationSummary> { |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 480 | public: |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 481 | enum CallKind { |
| 482 | kNoCall, |
| 483 | kCallOnSlowPath, |
| 484 | kCall |
| 485 | }; |
| 486 | |
Andreas Gampe | 71fb52f | 2014-12-29 17:43:08 -0800 | [diff] [blame] | 487 | LocationSummary(HInstruction* instruction, |
| 488 | CallKind call_kind = kNoCall, |
| 489 | bool intrinsified = false); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 490 | |
Nicolas Geoffray | 8e3964b | 2014-10-17 11:06:38 +0100 | [diff] [blame] | 491 | void SetInAt(uint32_t at, Location location) { |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 492 | inputs_[at] = location; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | Location InAt(uint32_t at) const { |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 496 | return inputs_[at]; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 497 | } |
| 498 | |
| 499 | size_t GetInputCount() const { |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 500 | return inputs_.size(); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 501 | } |
| 502 | |
Roland Levillain | 3d31242 | 2016-06-23 13:53:42 +0100 | [diff] [blame^] | 503 | // Set the output location. Argument `overlaps` tells whether the |
| 504 | // output overlaps any of the inputs (if so, it cannot share the |
| 505 | // same register as one of the inputs); it is set to |
| 506 | // `Location::kOutputOverlap` by default for safety. |
Nicolas Geoffray | 6c2dff8 | 2015-01-21 14:56:54 +0000 | [diff] [blame] | 507 | void SetOut(Location location, Location::OutputOverlap overlaps = Location::kOutputOverlap) { |
Nicolas Geoffray | 829280c | 2015-01-28 10:20:37 +0000 | [diff] [blame] | 508 | DCHECK(output_.IsInvalid()); |
Nicolas Geoffray | 8e3964b | 2014-10-17 11:06:38 +0100 | [diff] [blame] | 509 | output_overlaps_ = overlaps; |
Nicolas Geoffray | f43083d | 2014-11-07 10:48:10 +0000 | [diff] [blame] | 510 | output_ = location; |
| 511 | } |
| 512 | |
| 513 | void UpdateOut(Location location) { |
Nicolas Geoffray | 829280c | 2015-01-28 10:20:37 +0000 | [diff] [blame] | 514 | // There are two reasons for updating an output: |
| 515 | // 1) Parameters, where we only know the exact stack slot after |
| 516 | // doing full register allocation. |
| 517 | // 2) Unallocated location. |
| 518 | DCHECK(output_.IsStackSlot() || output_.IsDoubleStackSlot() || output_.IsUnallocated()); |
Nicolas Geoffray | f43083d | 2014-11-07 10:48:10 +0000 | [diff] [blame] | 519 | output_ = location; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 520 | } |
| 521 | |
| 522 | void AddTemp(Location location) { |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 523 | temps_.push_back(location); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 524 | } |
| 525 | |
| 526 | Location GetTemp(uint32_t at) const { |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 527 | return temps_[at]; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | void SetTempAt(uint32_t at, Location location) { |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 531 | DCHECK(temps_[at].IsUnallocated() || temps_[at].IsInvalid()); |
| 532 | temps_[at] = location; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 533 | } |
| 534 | |
| 535 | size_t GetTempCount() const { |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 536 | return temps_.size(); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 537 | } |
| 538 | |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 539 | bool HasTemps() const { return !temps_.empty(); } |
Nicolas Geoffray | 94015b9 | 2015-06-04 18:21:04 +0100 | [diff] [blame] | 540 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 541 | Location Out() const { return output_; } |
| 542 | |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 543 | bool CanCall() const { return call_kind_ != kNoCall; } |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 544 | bool WillCall() const { return call_kind_ == kCall; } |
| 545 | bool OnlyCallsOnSlowPath() const { return call_kind_ == kCallOnSlowPath; } |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 546 | bool NeedsSafepoint() const { return CanCall(); } |
| 547 | |
| 548 | void SetStackBit(uint32_t index) { |
| 549 | stack_mask_->SetBit(index); |
| 550 | } |
| 551 | |
Nicolas Geoffray | 3c04974 | 2014-09-24 18:10:46 +0100 | [diff] [blame] | 552 | void ClearStackBit(uint32_t index) { |
| 553 | stack_mask_->ClearBit(index); |
| 554 | } |
| 555 | |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 556 | void SetRegisterBit(uint32_t reg_id) { |
| 557 | register_mask_ |= (1 << reg_id); |
| 558 | } |
| 559 | |
Nicolas Geoffray | 9889396 | 2015-01-21 12:32:32 +0000 | [diff] [blame] | 560 | uint32_t GetRegisterMask() const { |
| 561 | return register_mask_; |
| 562 | } |
| 563 | |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 564 | bool RegisterContainsObject(uint32_t reg_id) { |
| 565 | return RegisterSet::Contains(register_mask_, reg_id); |
| 566 | } |
| 567 | |
| 568 | void AddLiveRegister(Location location) { |
| 569 | live_registers_.Add(location); |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 570 | } |
| 571 | |
| 572 | BitVector* GetStackMask() const { |
| 573 | return stack_mask_; |
| 574 | } |
| 575 | |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 576 | RegisterSet* GetLiveRegisters() { |
| 577 | return &live_registers_; |
| 578 | } |
| 579 | |
Nicolas Geoffray | 87d0376 | 2014-11-19 15:17:56 +0000 | [diff] [blame] | 580 | size_t GetNumberOfLiveRegisters() const { |
| 581 | return live_registers_.GetNumberOfRegisters(); |
| 582 | } |
| 583 | |
Nicolas Geoffray | 829280c | 2015-01-28 10:20:37 +0000 | [diff] [blame] | 584 | bool OutputUsesSameAs(uint32_t input_index) const { |
| 585 | return (input_index == 0) |
Nicolas Geoffray | 8e3964b | 2014-10-17 11:06:38 +0100 | [diff] [blame] | 586 | && output_.IsUnallocated() |
Nicolas Geoffray | 829280c | 2015-01-28 10:20:37 +0000 | [diff] [blame] | 587 | && (output_.GetPolicy() == Location::kSameAsFirstInput); |
| 588 | } |
| 589 | |
| 590 | bool IsFixedInput(uint32_t input_index) const { |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 591 | Location input = inputs_[input_index]; |
Nicolas Geoffray | 829280c | 2015-01-28 10:20:37 +0000 | [diff] [blame] | 592 | return input.IsRegister() |
Nicolas Geoffray | 9889396 | 2015-01-21 12:32:32 +0000 | [diff] [blame] | 593 | || input.IsFpuRegister() |
| 594 | || input.IsPair() |
| 595 | || input.IsStackSlot() |
Nicolas Geoffray | 829280c | 2015-01-28 10:20:37 +0000 | [diff] [blame] | 596 | || input.IsDoubleStackSlot(); |
Nicolas Geoffray | 7690562 | 2014-09-25 14:39:26 +0100 | [diff] [blame] | 597 | } |
| 598 | |
Nicolas Geoffray | 829280c | 2015-01-28 10:20:37 +0000 | [diff] [blame] | 599 | bool OutputCanOverlapWithInputs() const { |
Nicolas Geoffray | 6c2dff8 | 2015-01-21 14:56:54 +0000 | [diff] [blame] | 600 | return output_overlaps_ == Location::kOutputOverlap; |
Nicolas Geoffray | 8e3964b | 2014-10-17 11:06:38 +0100 | [diff] [blame] | 601 | } |
| 602 | |
Andreas Gampe | 71fb52f | 2014-12-29 17:43:08 -0800 | [diff] [blame] | 603 | bool Intrinsified() const { |
| 604 | return intrinsified_; |
| 605 | } |
| 606 | |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 607 | void SetIntrinsified(bool intrinsified) { |
| 608 | intrinsified_ = intrinsified; |
| 609 | } |
| 610 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 611 | private: |
Vladimir Marko | 2aaa4b5 | 2015-09-17 17:03:26 +0100 | [diff] [blame] | 612 | ArenaVector<Location> inputs_; |
| 613 | ArenaVector<Location> temps_; |
Nicolas Geoffray | 8e3964b | 2014-10-17 11:06:38 +0100 | [diff] [blame] | 614 | // Whether the output overlaps with any of the inputs. If it overlaps, then it cannot |
| 615 | // share the same register as the inputs. |
Nicolas Geoffray | 6c2dff8 | 2015-01-21 14:56:54 +0000 | [diff] [blame] | 616 | Location::OutputOverlap output_overlaps_; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 617 | Location output_; |
Nicolas Geoffray | 3946844 | 2014-09-02 15:17:15 +0100 | [diff] [blame] | 618 | const CallKind call_kind_; |
| 619 | |
| 620 | // Mask of objects that live in the stack. |
| 621 | BitVector* stack_mask_; |
| 622 | |
| 623 | // Mask of objects that live in register. |
| 624 | uint32_t register_mask_; |
| 625 | |
| 626 | // Registers that are in use at this position. |
Nicolas Geoffray | 3bca0df | 2014-09-19 11:01:00 +0100 | [diff] [blame] | 627 | RegisterSet live_registers_; |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 628 | |
Andreas Gampe | 71fb52f | 2014-12-29 17:43:08 -0800 | [diff] [blame] | 629 | // Whether these are locations for an intrinsified call. |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 630 | bool intrinsified_; |
Andreas Gampe | 71fb52f | 2014-12-29 17:43:08 -0800 | [diff] [blame] | 631 | |
Nicolas Geoffray | f43083d | 2014-11-07 10:48:10 +0000 | [diff] [blame] | 632 | ART_FRIEND_TEST(RegisterAllocatorTest, ExpectedInRegisterHint); |
| 633 | ART_FRIEND_TEST(RegisterAllocatorTest, SameAsFirstInputHint); |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 634 | DISALLOW_COPY_AND_ASSIGN(LocationSummary); |
| 635 | }; |
| 636 | |
Nicolas Geoffray | 76716a6 | 2014-05-23 10:14:19 +0100 | [diff] [blame] | 637 | } // namespace art |
| 638 | |
| 639 | #endif // ART_COMPILER_OPTIMIZING_LOCATIONS_H_ |