[llvm] 7f57c97 - [ThinLTOBitcodeWriter] Mark pass as required
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 6 14:47:46 PDT 2022
Author: Arthur Eubanks
Date: 2022-09-06T14:47:34-07:00
New Revision: 7f57c97d3083abd21e7bdc658f24e69405ef9199
URL: https://github.com/llvm/llvm-project/commit/7f57c97d3083abd21e7bdc658f24e69405ef9199
DIFF: https://github.com/llvm/llvm-project/commit/7f57c97d3083abd21e7bdc658f24e69405ef9199.diff
LOG: [ThinLTOBitcodeWriter] Mark pass as required
Or else with -opt-bisect-limit we don't write ThinLTO bitcode.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D133378
Added:
Modified:
llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
llvm/test/Other/opt-bisect-new-pass-manager.ll
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h b/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
index 469cf2bc50115..9bcb01c9dbe43 100644
--- a/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
+++ b/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
@@ -34,6 +34,8 @@ class ThinLTOBitcodeWriterPass
: OS(OS), ThinLinkOS(ThinLinkOS) {}
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
+
+ static bool isRequired() { return true; }
};
} // namespace llvm
diff --git a/llvm/test/Other/opt-bisect-new-pass-manager.ll b/llvm/test/Other/opt-bisect-new-pass-manager.ll
index 91450472398e0..ed6f973e761ab 100644
--- a/llvm/test/Other/opt-bisect-new-pass-manager.ll
+++ b/llvm/test/Other/opt-bisect-new-pass-manager.ll
@@ -99,6 +99,10 @@
; RUN: opt %s -opt-bisect-limit=0 -passes=early-cse -S | FileCheck %s -check-prefix=CHECK-OUTPUT
; CHECK-OUTPUT: define void @f1
+; Make sure we write ThinLTO bitcode
+; RUN: opt %s -opt-bisect-limit=0 -disable-verify -thinlto-bc -o /dev/null 2>&1 | FileCheck --allow-empty %s -check-prefix=CHECK-THINLTO
+; CHECK-THINLTO-NOT: NOT running pass
+
declare i32 @g()
define void @f1() {
More information about the llvm-commits
mailing list