-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[CloneFunction] Remove check that is no longer necessary #92577
Conversation
We do not need to concern ourselves with CGSCC since all remaining CG related updates went away in fa6ea7a.
@llvm/pr-subscribers-llvm-transforms Author: Danila Malyutin (danilaml) ChangesWe do not need to concern ourselves with CGSCC since all remaining CG related updates went away in fa6ea7a as pointed out by @nikic in #87963 (comment). Full diff: https://github.com/llvm/llvm-project/pull/92577.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 981183682b8bf..1fef8bc461211 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -825,13 +825,6 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
if (!NewI)
continue;
- // Skip over non-intrinsic callsites, we don't want to remove any nodes
- // from the CGSCC.
- CallBase *CB = dyn_cast<CallBase>(NewI);
- if (CB && CB->getCalledFunction() &&
- !CB->getCalledFunction()->isIntrinsic())
- continue;
-
if (Value *V = simplifyInstruction(NewI, DL)) {
NewI->replaceAllUsesWith(V);
|
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.
Could you please add a test for the additional folding this enables?
@nikic have some downstream function calls that can be simplified but not constant folded. Will see if I can come up with a test for current main. |
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.
It looks like InstSimplify only does constant folding for non-intrinsics, so probably the only way to hit this with upstream LLVM is if it's constant folding that involves a loop phi in some way and thus only happens late?
Given that, constructing a test case may be tricky, so I'm fine with landing it as-is.
@nikic Yeah, wasn't able to come up with the test. Another thing is that upstream simplifyCall currently only handles poison/undef callee (wasn't skipped due to |
We do not need to concern ourselves with CGSCC since all remaining CG related updates went away in fa6ea7a as pointed out by @nikic in #87963 (comment).