[llvm-branch-commits] [llvm] llvm-reduce: Fix overly conservative operands-to-args user restriction (PR #133854)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Apr 1 18:43:26 PDT 2025


================
@@ -19,12 +19,9 @@
 
 using namespace llvm;
 
-static bool canReplaceFunction(Function *F) {
-  return all_of(F->uses(), [](Use &Op) {
-    if (auto *CI = dyn_cast<CallBase>(Op.getUser()))
-      return &CI->getCalledOperandUse() == &Op;
-    return false;
-  });
+static bool canReplaceFunction(const Function &F) {
+  // TODO: Add controls to avoid ABI breaks (e.g. don't break main)
----------------
arsenm wrote:

It shoul, but it would be useful to have a mode to opt out and avoid breaking anything needed to execute the function (bugpoint has a more primitive version of the option than the one I would like)

https://github.com/llvm/llvm-project/pull/133854


More information about the llvm-branch-commits mailing list