-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 LLVM 10 in GC checker #37153
Conversation
Did a run with LLVM 10 and the GCChecker https://build.julialang.org/#/builders/65/builds/2239/steps/4/logs/stdio |
The only failure I got locally is due to LLVM not able to infer that diff --git a/src/llvm-alloc-opt.cpp b/src/llvm-alloc-opt.cpp
index 6f2a69dea9..eb1abe932d 100644
--- a/src/llvm-alloc-opt.cpp
+++ b/src/llvm-alloc-opt.cpp
@@ -1318,6 +1318,7 @@ void Optimizer::splitOnStack(CallInst *orig_inst)
}
else if (auto call = dyn_cast<CallInst>(user)) {
auto callee = call->getCalledOperand();
+ assert(callee);
if (auto intrinsic = dyn_cast<IntrinsicInst>(call)) {
if (Intrinsic::ID id = intrinsic->getIntrinsicID()) {
if (id == Intrinsic::memset) { |
Hm, I am getting the same failure locally.
@Keno |
Running with the core checker excluded I also get the following failure:
|
It thinks the In |
Actually I can reproduce it too if core check is disabled. It seems that the return statement was diff --git a/src/clangsa/GCChecker.cpp b/src/clangsa/GCChecker.cpp
index 4e7d708a67..8bba1d37d2 100644
--- a/src/clangsa/GCChecker.cpp
+++ b/src/clangsa/GCChecker.cpp
@@ -727,7 +727,7 @@ void GCChecker::checkEndFunction(const clang::ReturnStmt *RS,
C.addTransition(State);
if (!C.inTopFrame())
return;
- if (C.getState()->get<GCDepth>() > 0)
+ if (RS && C.getState()->get<GCDepth>() > 0)
report_error(C, "Non-popped GC frame present at end of function");
} seems to fix it and also seems correct in general (there are other cases where a NULL is passed here and this just seem to be the only case where it actually trigger an error...) |
Ref llvm/llvm-project@2f169e7 Ref llvm/llvm-project@6b85f8e Also handle noreturn function call in GC frame counting, and remove some old code for LLVM <= 7
This is not user facing code and I believe there shouldn't be regression on LLVM 9 at least so I'll merge soon to make it easier for me to test a few other changes. I also removed some old code for LLVM <= 7 support. It also seems that the core analyzer might be responsible for handling no-return function in general. Even with the NULL return statement case factored out there are other related issues from the caller of the function. Still not sure why the core analyzer complains what it does. I have a non-asserting and release build of LLVM maybe that makes a difference? |
I am just running the Yggdrasil build, so that is also non-asserting and release. It's weird that we are also seeing it on CI otherwise I might blame a header difference. |
Ref llvm/llvm-project@2f169e7 Ref llvm/llvm-project@6b85f8e Also handle noreturn function call in GC frame counting, and remove some old code for LLVM <= 7
Ref llvm/llvm-project@2f169e7
Ref llvm/llvm-project@6b85f8e
Also handle noreturn function call in GC frame counting,
and remove some old code for LLVM <= 7