File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -700,6 +700,10 @@ struct LLVMRustSanitizerOptions {
700
700
#ifdef ENZYME
701
701
extern " C" void registerEnzymeAndPassPipeline (llvm::PassBuilder &PB,
702
702
/* augmentPassBuilder */ bool );
703
+
704
+ extern " C" {
705
+ extern llvm::cl::opt<std::string> EnzymeFunctionToAnalyze;
706
+ }
703
707
#endif
704
708
705
709
extern " C" LLVMRustResult LLVMRustOptimize (
@@ -1069,6 +1073,15 @@ extern "C" LLVMRustResult LLVMRustOptimize(
1069
1073
return LLVMRustResult::Failure;
1070
1074
}
1071
1075
1076
+ // Check if PrintTAFn was used and add type analysis pass if needed
1077
+ if (!EnzymeFunctionToAnalyze.empty ()) {
1078
+ if (auto Err = PB.parsePassPipeline (MPM, " print-type-analysis" )) {
1079
+ std::string ErrMsg = toString (std::move (Err));
1080
+ LLVMRustSetLastError (ErrMsg.c_str ());
1081
+ return LLVMRustResult::Failure;
1082
+ }
1083
+ }
1084
+
1072
1085
if (PrintAfterEnzyme) {
1073
1086
// Handle the Rust flag `-Zautodiff=PrintModAfter`.
1074
1087
std::string Banner = " Module after EnzymeNewPM" ;
You can’t perform that action at this time.
0 commit comments