Skip to content

Commit b950df7

Browse files
committed
Change RunEarly to be a boolean flag in ExternalAAWrapper
1 parent c82e2f5 commit b950df7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

llvm/include/llvm/Analysis/AliasAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ struct ExternalAAWrapperPass : ImmutablePass {
10231023
/// particularly useful when the external AA can provide more precise results
10241024
/// than Basic AA so that Basic AA does not need to spend time recomputing
10251025
/// them.
1026-
virtual bool runEarly() { return false; }
1026+
bool RunEarly = false;
10271027

10281028
void getAnalysisUsage(AnalysisUsage &AU) const override {
10291029
AU.setPreservesAll();

llvm/lib/Analysis/AliasAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ bool AAResultsWrapperPass::runOnFunction(Function &F) {
741741

742742
// Add any target-specific alias analyses that should be run early.
743743
auto *ExtWrapperPass = getAnalysisIfAvailable<ExternalAAWrapperPass>();
744-
if (ExtWrapperPass && ExtWrapperPass->runEarly() && ExtWrapperPass->CB) {
744+
if (ExtWrapperPass && ExtWrapperPass->RunEarly && ExtWrapperPass->CB) {
745745
LLVM_DEBUG(dbgs() << "AAResults register Early ExternalAA: "
746746
<< ExtWrapperPass->getPassName() << "\n");
747747
ExtWrapperPass->CB(*this, F, *AAR);
@@ -777,7 +777,7 @@ bool AAResultsWrapperPass::runOnFunction(Function &F) {
777777

778778
// If available, run an external AA providing callback over the results as
779779
// well.
780-
if (ExtWrapperPass && !ExtWrapperPass->runEarly() && ExtWrapperPass->CB) {
780+
if (ExtWrapperPass && !ExtWrapperPass->RunEarly && ExtWrapperPass->CB) {
781781
LLVM_DEBUG(dbgs() << "AAResults register Late ExternalAA: "
782782
<< ExtWrapperPass->getPassName() << "\n");
783783
ExtWrapperPass->CB(*this, F, *AAR);

llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ class NVPTXExternalAAWrapper : public ExternalAAWrapperPass {
9090
public:
9191
static char ID;
9292

93-
bool runEarly() override { return true; }
94-
9593
NVPTXExternalAAWrapper()
9694
: ExternalAAWrapperPass([](Pass &P, Function &, AAResults &AAR) {
9795
if (auto *WrapperPass =
9896
P.getAnalysisIfAvailable<NVPTXAAWrapperPass>())
9997
AAR.addAAResult(WrapperPass->getResult());
100-
}) {}
98+
}) {
99+
RunEarly = true;
100+
}
101101

102102
StringRef getPassName() const override {
103103
return "NVPTX Address space based Alias Analysis Wrapper";

0 commit comments

Comments
 (0)