[llvm] [AA] Change RunEarly to be a Boolean Flag in ExternalAAWrapper (PR #139158)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 04:55:31 PDT 2025


================
@@ -90,14 +90,14 @@ class NVPTXExternalAAWrapper : public ExternalAAWrapperPass {
 public:
   static char ID;
 
-  bool runEarly() override { return true; }
-
   NVPTXExternalAAWrapper()
       : ExternalAAWrapperPass([](Pass &P, Function &, AAResults &AAR) {
           if (auto *WrapperPass =
                   P.getAnalysisIfAvailable<NVPTXAAWrapperPass>())
             AAR.addAAResult(WrapperPass->getResult());
-        }) {}
+        }) {
+    RunEarly = true;
----------------
arsenm wrote:

> Do you mean making the constructor of ExternalAAWrapperPass to be

Yes

> What's the intent of doing this? To make it possible to use isa<> to determine whether an AA should run early?

No, passes don't do the RTTI thing. This is the minimal amount of typing for a pass to swap between the two forms 

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


More information about the llvm-commits mailing list