-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(loopextract): make loop into nd function
This modified LoopExtract pass does the following: 1. Extract all conformant loops into functions 2. Modify the function to set all outputs to ND values There are various ways the code can be improved: 1. Fix the todos 2. Instead of destructively modifying the function, create another function and point all calls to it For now, my inclination is to submit as-is since its utility is unknown and I want to avoid over engineering it. Tested: c-rust tinyvec-capacity-error job (now takes less than a second vis-a-vis 3 minutes earlier)
- Loading branch information
1 parent
7cabdad
commit ba69e31
Showing
5 changed files
with
142 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// A pass wrapper around the ExtractLoop() scalar transformation to extract each | ||
// top-level loop into its own new function. If the loop is the ONLY loop in a | ||
// given function, it is not touched. This is a pass most useful for debugging | ||
// via bugpoint. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H | ||
#define LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H | ||
|
||
#include "llvm/IR/PassManager.h" | ||
|
||
namespace llvm { | ||
|
||
struct SeaLoopExtractorPass : public PassInfoMixin<SeaLoopExtractorPass> { | ||
SeaLoopExtractorPass(unsigned NumLoops = ~0) : NumLoops(NumLoops) {} | ||
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); | ||
void printPipeline(raw_ostream &OS, | ||
function_ref<StringRef(StringRef)> MapClassName2PassName); | ||
|
||
private: | ||
unsigned NumLoops; | ||
}; | ||
} // namespace llvm | ||
|
||
#endif // LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
add_llvm_library(SeaLlvmIpo DISABLE_LLVM_LINK_LLVM_DYLIB | ||
PassManagerBuilder.cpp | ||
Annotation2Metadata.cpp | ||
LoopExtractor.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters