Commit 87d70eab authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[regalloc] Skip hint search when there are no hints

R=sigurds@chromium.org

Bug: v8:10533
Change-Id: I81756299c286801423fd0f5170046235c8e3dede
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2235117Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68230}
parent 25e0c83b
......@@ -391,8 +391,8 @@ LiveRange::LiveRange(int relative_id, MachineRepresentation rep,
next_(nullptr),
current_interval_(nullptr),
last_processed_use_(nullptr),
current_hint_position_(nullptr),
splitting_pointer_(nullptr) {
splitting_pointer_(nullptr),
current_hint_position_(nullptr) {
DCHECK(AllocatedOperand::IsSupportedRepresentation(rep));
bits_ = AssignedRegisterField::encode(kUnassignedRegister) |
RepresentationField::encode(rep) |
......@@ -474,6 +474,7 @@ RegisterKind LiveRange::kind() const {
}
UsePosition* LiveRange::FirstHintPosition(int* register_index) const {
if (!TopLevel()->current_hint_position()) return nullptr;
for (UsePosition* pos = first_pos_; pos != nullptr; pos = pos->next()) {
if (pos->HintRegister(register_index)) return pos;
}
......@@ -2407,6 +2408,8 @@ void LiveRangeBuilder::ProcessInstructions(const InstructionBlock* block,
if (to_range->is_phi()) {
phi_vreg = to_vreg;
if (to_range->is_non_loop_phi()) {
DCHECK_EQ(to_range->current_hint_position(),
to_range->FirstHintPosition());
hint = to_range->current_hint_position();
hint_type = hint == nullptr ? UsePositionHintType::kNone
: UsePositionHintType::kUsePos;
......
......@@ -625,7 +625,6 @@ class V8_EXPORT_PRIVATE LiveRange : public NON_EXPORTED_BASE(ZoneObject) {
}
UsePosition* current_hint_position() const {
DCHECK(current_hint_position_ == FirstHintPosition());
return current_hint_position_;
}
......@@ -701,10 +700,11 @@ class V8_EXPORT_PRIVATE LiveRange : public NON_EXPORTED_BASE(ZoneObject) {
mutable UseInterval* current_interval_;
// This is used as a cache, it doesn't affect correctness.
mutable UsePosition* last_processed_use_;
// This is used as a cache, it's invalid outside of BuildLiveRanges.
mutable UsePosition* current_hint_position_;
// Cache the last position splintering stopped at.
mutable UsePosition* splitting_pointer_;
// This is used as a cache in BuildLiveRanges, and to quickly check for the
// absence of hints during register allocation.
UsePosition* current_hint_position_;
LiveRangeBundle* bundle_ = nullptr;
// Next interval start, relative to the current linear scan position.
LifetimePosition next_start_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment