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

[GlobalISel] Add constant-folding of FP binops to combiner. #65230

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

aemerson
Copy link
Contributor

@aemerson aemerson commented Sep 3, 2023

No description provided.

@aemerson
Copy link
Contributor Author

aemerson commented Sep 5, 2023

@arsenm this PR is ready for review

@@ -2645,6 +2645,14 @@ void CombinerHelper::replaceInstWithConstant(MachineInstr &MI, APInt C) {
MI.eraseFromParent();
}

void CombinerHelper::replaceInstWithFConstant(MachineInstr &MI, ConstantFP *CFP) {
assert(MI.getNumDefs() == 1 && "Expected only one def?");
APFloat C = CFP->getValueAPF();
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't really need this temporary copy

void CombinerHelper::replaceInstWithFConstant(MachineInstr &MI, ConstantFP *CFP) {
assert(MI.getNumDefs() == 1 && "Expected only one def?");
APFloat C = CFP->getValueAPF();
Builder.setInstr(MI);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should really just fix the combiner to always set the insert point before the apply

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed.

@arsenm arsenm merged commit 1cc9f62 into llvm:main Sep 7, 2023
1 of 2 checks passed
@aemerson aemerson deleted the eng/gisel/opts-series-1 branch September 7, 2023 17:02
@aemerson
Copy link
Contributor Author

aemerson commented Sep 7, 2023

I was waiting for you to approve before merging.

@arsenm
Copy link
Contributor

arsenm commented Sep 7, 2023

I was waiting for you to approve before merging.

For some reason GitHub makes it more difficult to find the approve without merge option

avillega pushed a commit to avillega/llvm-project that referenced this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants