Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regalloc #16

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Regalloc #16

merged 1 commit into from
Mar 5, 2024

Conversation

techie-mike
Copy link
Owner

  • Added liveness analyzer
  • Improved linear order
  • Fixed GCM

@techie-mike techie-mike force-pushed the regalloc branch 3 times, most recently from 0ff7fcf to 1a3a203 Compare March 5, 2024 11:21
+ Added liveness analyzer
+ Improved linear order
+ Fixed GCM
@techie-mike techie-mike merged commit 49aaa48 into master Mar 5, 2024
1 check passed
Comment on lines +48 to +93
// OldBegin OldEnd
// ||-----------||
// ||-----------------||
// begin end
// ==============RESULT==============
// ||---------------------------||
// NewBegin NewEnd
if (begin < begin_ && end < end_) {
begin_ = begin;
return;
}

// OldBegin OldEnd
// ||-----------||
// ||--------------------------||
// begin end
// ==============RESULT==============
// ||--------------------------||
// NewBegin NewEnd
if (begin < begin_ && end > end_) {
begin_ = begin;
end_ = end;
return;
}

// OldBegin OldEnd
// ||--------------------------||
// ||-----------||
// begin end
// ==============RESULT==============
// ||--------------------------||
// NewBegin NewEnd
if (begin > begin_ && end < end_) {
return;
}

// OldBegin OldEnd
// ||---------||
// ||-----------||
// begin end
// ==============RESULT==============
// ||---------------------||
// NewBegin NewEnd
if (begin > begin_ && end > end_) {
return;
}
Copy link

@ober-man ober-man Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG man just use std::min, std::max.......

}
inst->SetLinearNumber(linear_number++);
if (inst->GetOpcode() != Opcode::Phi) {
life_number += 2; // +2 reserved for create spill-fill inst. It isn't necessary for Phi inst
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAGIC CONSTANT!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants