-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[MSVC] work-around for compile time issue 102513 #110986
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
Conversation
Disable optimizations when building with Microsoft's compiler as it has a bug that causes excessive build times. We do this only when NDEBUG is not defined on the assumption that building without asserts indicates that a user is strongly invested in runtime performance. Partially addresses: llvm#102513. Once the bug is addressed in the Microsoft compiler this can be removed.
@llvm/pr-subscribers-clang Author: bd1976bris (bd1976bris) ChangesDisable optimizations when building with Microsoft's compiler as it has a bug that causes excessive build times. We do this only when NDEBUG is not defined on the assumption that building without asserts indicates that a user is strongly invested in runtime performance. Partially addresses: #102513. Once the bug is addressed in the Microsoft compiler this can be removed. Full diff: https://github.com/llvm/llvm-project/pull/110986.diff 1 Files Affected:
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index fd9a256843a0ec..38d52e93181fbc 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1406,6 +1406,10 @@ bool handleFixedPointOverflow(InterpState &S, CodePtr OpPC,
return S.noteUndefinedBehavior();
}
+// https://github.com/llvm/llvm-project/issues/102513
+#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
+#pragma optimize("", off)
+#endif
bool Interpret(InterpState &S, APValue &Result) {
// The current stack frame when we started Interpret().
// This is being used by the ops to determine wheter
@@ -1430,6 +1434,10 @@ bool Interpret(InterpState &S, APValue &Result) {
}
}
}
+// https://github.com/llvm/llvm-project/issues/102513
+#if defined (_MSC_VER)
+#pragma optimize("", on)
+#endif
} // namespace interp
} // namespace clang
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Generally LGTM. |
/cherry-pick d205191 |
Failed to cherry-pick: d205191 https://github.com/llvm/llvm-project/actions/runs/11181614249 Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request |
Failed to cherry-pick: d205191 https://github.com/llvm/llvm-project/actions/runs/11181632525 Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request |
Manual cherry-pick of llvm#110986 to the LLVM 19 release branch.
For #102513 It should not be needed after llvm/llvm-project#110986. This reverts commit 73d07e0. This reverts commit d0f4769.
For #102513 It should not be needed after llvm/llvm-project#110986. This reverts commit 73d07e0. This reverts commit d0f4769.
…builds Similar to llvm#110986 - disabling inlining on MSVC release builds avoids an excessive build time issue affecting all recent versions of CL.EXE Fixes llvm#114425
…builds Similar to llvm#110986 - disabling inlining on MSVC release builds avoids an excessive build time issue affecting all recent versions of CL.EXE Fixes llvm#114425
…builds (llvm#115292) Similar to llvm#110986 - disabling inlining on MSVC release builds avoids an excessive build time issue affecting all recent versions of CL.EXE Fixes llvm#114425
Manual cherry-pick of #110986 to the LLVM 19 release branch.
Alter the #ifdef values from llvm#110986 and llvm#115292 to use _MSC_VER instead of _WIN32 to stop the pragmas being used on gcc/mingw builds Noticed by @mstorsjo
Manual cherry-pick of llvm#110986 to the LLVM 19 release branch.
Alter the #ifdef values from llvm#110986 and llvm#115292 to use _MSC_VER instead of _WIN32 to stop the pragmas being used on gcc/mingw builds Noticed by @mstorsjo
Disable optimizations when building clang/lib/AST/ByteCode/Interp.cpp with Microsoft's compiler as it has a bug that causes excessive build times. We do this only when NDEBUG is not defined on the assumption that building without asserts indicates that a user is strongly invested in runtime performance.
Partially addresses: #102513.
Once the bug is addressed in the Microsoft compiler this can be removed.