aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-reduce/ReducerWorkItem.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-reduce/ReducerWorkItem.h')
-rw-r--r--llvm/tools/llvm-reduce/ReducerWorkItem.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/tools/llvm-reduce/ReducerWorkItem.h b/llvm/tools/llvm-reduce/ReducerWorkItem.h
index d20ca18..89330d2b 100644
--- a/llvm/tools/llvm-reduce/ReducerWorkItem.h
+++ b/llvm/tools/llvm-reduce/ReducerWorkItem.h
@@ -27,6 +27,15 @@ public:
void print(raw_ostream &ROS, void *p = nullptr) const;
operator Module &() const { return *M; }
+
+ /// Return a number to indicate whether there was any reduction progress.
+ uint64_t getComplexityScore() const {
+ return isMIR() ? computeMIRComplexityScore() : getIRSize();
+ }
+
+private:
+ uint64_t computeMIRComplexityScore() const;
+ uint64_t getIRSize() const;
};
std::unique_ptr<ReducerWorkItem>