Skip to content

Commit 7f57c97

Browse files
committed
[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
1 parent 7440e22 commit 7f57c97

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class ThinLTOBitcodeWriterPass
3434
: OS(OS), ThinLinkOS(ThinLinkOS) {}
3535

3636
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
37+
38+
static bool isRequired() { return true; }
3739
};
3840

3941
} // namespace llvm

llvm/test/Other/opt-bisect-new-pass-manager.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@
9999
; RUN: opt %s -opt-bisect-limit=0 -passes=early-cse -S | FileCheck %s -check-prefix=CHECK-OUTPUT
100100
; CHECK-OUTPUT: define void @f1
101101

102+
; Make sure we write ThinLTO bitcode
103+
; RUN: opt %s -opt-bisect-limit=0 -disable-verify -thinlto-bc -o /dev/null 2>&1 | FileCheck --allow-empty %s -check-prefix=CHECK-THINLTO
104+
; CHECK-THINLTO-NOT: NOT running pass
105+
102106
declare i32 @g()
103107

104108
define void @f1() {

0 commit comments

Comments
 (0)