[PATCH] D137149: Use PassGate from LLVMContext if any otherwise global one

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 11:02:38 PST 2022


aeubanks added a comment.

lg other than one comment + formatting



================
Comment at: llvm/include/llvm/Passes/StandardInstrumentations.h:81
 public:
-  OptBisectInstrumentation() = default;
+  OptPassGateInstrumentation(LLVMContext &Context) : Context(Context){};
+  bool shouldRun(StringRef PassName, Any IR);
----------------
clang-format?


================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:771
+  OptPassGate &PassGate = Context.getOptPassGate();
+  if (!PassGate.isEnabled())
+    return true;
----------------
this should be in `OptPassGateInstrumentation::registerCallbacks` gating `registerShouldRunOptionalPassCallback` to avoid an extra callback per pass run


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137149/new/

https://reviews.llvm.org/D137149



More information about the llvm-commits mailing list