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

support more names from MS #1338

Merged
merged 8 commits into from
Aug 30, 2023
Merged

support more names from MS #1338

merged 8 commits into from
Aug 30, 2023

Conversation

tthsqe12
Copy link
Contributor

@tthsqe12 tthsqe12 commented Jul 18, 2023

How do you feel about in Enzyme.cpp replacing all of the
metaString->startswith("enzyme_")
by
metaString->contains("enzyme_")
?
These can be mangled too.

@tthsqe12
Copy link
Contributor Author

tthsqe12 commented Jul 27, 2023

@wsmoses If you can figure out how to run the .ll file attached in 06af6af through the CI, then I suppose this is good to from my end.

@tthsqe12
Copy link
Contributor Author

tthsqe12 commented Aug 6, 2023

@wsmoses This pr allows enzyme to work better with MS's ABI. Please let me know anything I can do further to get this merged. I am not sure how the testing system expects to process the attached ll file.

@tthsqe12
Copy link
Contributor Author

@wsmoses If this last commit is not the way to run the integration, please let me know. This PR should be close to being over the line.

@tthsqe12
Copy link
Contributor Author

@wsmoses I see that the CI for LLVM 15 has failed with the error message
error: no check strings found with prefix 'CHECK:'
Please advise on what to put after these CHECKs. I do not understand the existing examples.

@wsmoses
Copy link
Member

wsmoses commented Aug 16, 2023 via email

@wsmoses
Copy link
Member

wsmoses commented Aug 16, 2023 via email

@tthsqe12
Copy link
Contributor Author

The output file has about 400 lines. From the other examples I saw, it looks like not all lines need to be included. Is this correct, that is, can I just select a few choice lines and include those in the check?

} else if (auto arg = dyn_cast<GlobalVariable>(oval)) {
if (arg->getName() == "_ZTVN10__cxxabiv120__si_class_type_infoE" ||
arg->getName() == "_ZTVN10__cxxabiv117__class_type_infoE" ||
arg->getName() == "_ZTVN10__cxxabiv121__vmi_class_type_infoE")
arg->getName() == "_ZTVN10__cxxabiv121__vmi_class_type_infoE" ||
arg->getName().startswith("??_R")) // any of the MS RTTI manglings
Copy link
Member

Choose a reason for hiding this comment

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

Should all MS mangled globals have this treatment though? What about user defined globals!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't like this either but there were too many, and I didn't know how many more there could be. I think this is not a problem because the closest an MS user can get from C/C++ is ?_R... which has one question mark and comes from _R. Besides, such Identifiers are reserved and shouldn't be used anyways.

!17 = !{!18, !10, i64 8}
!18 = !{!"?AUObject@@", !10, i64 8}

; CHECK: %rtti.CompleteObjectLocator = type { i32, i32, i32, i32, i32, i32 }
Copy link
Member

Choose a reason for hiding this comment

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

I would change the check lines to be the generated derivative functions

@wsmoses wsmoses merged commit b2f1190 into EnzymeAD:main Aug 30, 2023
@ZuseZ4
Copy link
Member

ZuseZ4 commented Sep 1, 2023

MilesCranmer pushed a commit to MilesCranmer/Enzyme that referenced this pull request Jul 24, 2024
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.

3 participants