Fixes 53 check-llvm tests under NPM.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D83633
/// Returns true if the pass name is the name of an alias analysis pass.
bool isAAPassName(StringRef PassName);
+ /// Returns true if the pass name is the name of a (non-alias) analysis pass.
+ bool isAnalysisPassName(StringRef PassName);
+
/// Register a callback for a default optimizer pipeline extension
/// point
///
#include "PassRegistry.def"
return false;
}
+
+bool PassBuilder::isAnalysisPassName(StringRef PassName) {
+#define MODULE_ANALYSIS(NAME, CREATE_PASS) \
+ if (PassName == NAME) \
+ return true;
+#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
+ if (PassName == NAME) \
+ return true;
+#define LOOP_ANALYSIS(NAME, CREATE_PASS) \
+ if (PassName == NAME) \
+ return true;
+#define CGSSC_ANALYSIS(NAME, CREATE_PASS) \
+ if (PassName == NAME) \
+ return true;
+#include "PassRegistry.def"
+ return false;
+}
}
}
for (auto PassName : NonAAPasses) {
- if (auto Err =
- PB.parsePassPipeline(MPM, PassName, VerifyEachPass, DebugPM)) {
+ std::string ModifiedPassName(PassName.begin(), PassName.end());
+ if (PB.isAnalysisPassName(PassName))
+ ModifiedPassName = "require<" + ModifiedPassName + ">";
+ if (auto Err = PB.parsePassPipeline(MPM, ModifiedPassName, VerifyEachPass,
+ DebugPM)) {
errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
return false;
}