Skip to content

[Clang][Driver] Add new flags to control IR verification #68172

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

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

mizvekov
Copy link
Contributor

@mizvekov mizvekov commented Oct 4, 2023

Enables or disables verification of the generated LLVM IR.

Users can pass this to turn on extra verification to catch certain types of
compiler bugs at the cost of extra compile time.

@mizvekov mizvekov added the clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' label Oct 4, 2023
@mizvekov mizvekov self-assigned this Oct 4, 2023
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 4, 2023
@mizvekov mizvekov changed the title [CLang][Driver] Add new flags to control IR verification [Clang][Driver] Add new flags to control IR verification Oct 4, 2023
@mizvekov mizvekov force-pushed the clang_no-disable-llvm-verifier branch 3 times, most recently from 8a02263 to 634c0f8 Compare October 4, 2023 11:20
@mizvekov mizvekov force-pushed the clang_no-disable-llvm-verifier branch from 634c0f8 to a5414db Compare October 4, 2023 19:21
Copy link
Contributor

@aeubanks aeubanks left a comment

Choose a reason for hiding this comment

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

lgtm, I tried out the GH feature to directly edit a file in the PR to fix a spelling issue

@mizvekov mizvekov merged commit 6da382d into llvm:main Oct 4, 2023
@mizvekov mizvekov deleted the clang_no-disable-llvm-verifier branch October 4, 2023 22:50
@@ -5150,9 +5150,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
const bool IsAssertBuild = true;
#endif

// Disable the verification pass in -asserts builds.
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I might be missing something here, but doesn't this disable the verifier for builds without assertions?

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 edited the line to append the unless otherwise specified, since now we allow overriding that with the new flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants