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

[bolt] Support arm64 FP register spills #73021

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

eleviant
Copy link
Contributor

At the moment llvm-bolt fails when analyzing jump tables on aarch64 in case FP register spill/reload is used.

@yota9
Copy link
Member

yota9 commented Nov 21, 2023

Hi. I would check it later. That time: is it necessary to create yaml test instead of asm? Do we need to check output after bolt?

@eleviant
Copy link
Contributor Author

Hi. I would check it later. That time: is it necessary to create yaml test instead of asm?

I have to emit ELF executable (with reloc), not just object so I need either both asm and linker or yaml that's why I've chosen the latter.

Do we need to check output after bolt?

No. This is minimal code snippet to trigger crash in bolt, not a real jump table. The output of bolt is no different from input here.

@yota9
Copy link
Member

yota9 commented Nov 21, 2023

I have to emit ELF executable (with reloc), not just object so I need either both asm and linker or yaml that's why I've chosen the latter.

Fill free to use lld linker. Normally we're trying to avoid such yaml tests, it seems to be unnecessary here.

No. This is minimal code snippet to trigger crash in bolt, not a real jump table. The output of bolt is no different from input here.

I see, thanks. I would try to reproduce crash later.

@eleviant
Copy link
Contributor Author

Switched to lld and llvm-mc in test case

@eleviant
Copy link
Contributor Author

eleviant commented Dec 1, 2023

Any comments on this?

Copy link
Member

@yota9 yota9 left a comment

Choose a reason for hiding this comment

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

Hi! Sorry for late review. Overall LGTM, please fix couple on nits in comments and I would approve it. Thanks!

From = Inst.getOperand(1).getReg();
To = Inst.getOperand(0).getReg();
return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

new line please after }

@@ -0,0 +1,17 @@
# REQUIRES: system-linux
Copy link
Member

Choose a reason for hiding this comment

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

Please add test scription at the beginning of the file

At the moment llvm-bolt fails when analyzing jump tables on aarch64
in case FP register spill/reload is used.
@eleviant
Copy link
Contributor Author

eleviant commented Dec 5, 2023

Addressed comments

Copy link
Member

@yota9 yota9 left a comment

Choose a reason for hiding this comment

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

Thanks

@eleviant eleviant merged commit f20af73 into llvm:main Dec 5, 2023
4 checks passed
Comment on lines +1 to +2
# Check that we correctly handle arm64 fp register spills in
# bolt when we are processing jump tables.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for jumping in late after the change landed. This test checks that BOLT doesn't crash, but it doesn't really check for the correct handling of the jump table. You'll need to add FileCheck checks for --print-cfg dumps or other checks for the output.

Copy link
Member

Choose a reason for hiding this comment

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

The idea behind the test was not to check the jump table (although it would be nice), but the previous bolt assertion during analyzation. So the test is good-enough I think

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

3 participants