Skip to content

Commit 660836c

Browse files
committed
Test another place
1 parent c9c45e0 commit 660836c

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,14 @@ void splitAndWriteThinLTOBitcode(
284284
ProfileSummaryInfo PSI(M);
285285
M.addModuleFlag(Module::Error, "ThinLTO", uint32_t(0));
286286
ModuleSummaryIndex Index = buildModuleSummaryIndex(M, nullptr, &PSI);
287-
WriteBitcodeToFile(M, OS, /*ShouldPreserveUseListOrder=*/false, &Index,
287+
WriteBitcodeToFile(M, OS, ShouldPreserveUseListOrder, &Index,
288288
/*UnifiedLTO=*/false);
289289

290290
if (ThinLinkOS)
291291
// We don't have a ThinLTO part, but still write the module to the
292292
// ThinLinkOS if requested so that the expected output file is produced.
293-
WriteBitcodeToFile(M, *ThinLinkOS, /*ShouldPreserveUseListOrder=*/false,
294-
&Index, /*UnifiedLTO=*/false);
293+
WriteBitcodeToFile(M, *ThinLinkOS, ShouldPreserveUseListOrder, &Index,
294+
/*UnifiedLTO=*/false);
295295

296296
return;
297297
}

llvm/test/Transforms/ThinLTOBitcodeWriter/unsplittable.ll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
; copy of the regular module.
66
; RUN: diff %t %t2
77

8+
9+
; Do it again, with preserved uselistorder
10+
; RUN: opt --preserve-bc-uselistorder -thinlto-bc -thin-link-bitcode-file=%t2 -thinlto-split-lto-unit -o %t %s
11+
; RUN: llvm-dis --preserve-ll-uselistorder -o - %t | FileCheck -check-prefixes=CHECK,USELISTORDER %s
12+
; RUN: llvm-bcanalyzer -dump %t | FileCheck --check-prefix=BCA %s
13+
; When not splitting the module, the thin link bitcode file should simply be a
14+
; copy of the regular module.
15+
; RUN: diff %t %t2
16+
17+
818
; BCA: <FULL_LTO_GLOBALVAL_SUMMARY_BLOCK
919
; BCA-NOT: <GLOBALVAL_SUMMARY_BLOCK
1020

@@ -18,6 +28,8 @@ declare void @sink(ptr)
1828

1929
; CHECK: define internal void @f()
2030
define internal void @f() {
31+
call void @sink(ptr @g)
32+
call void @sink(ptr @g)
2133
call void @sink(ptr @g)
2234
ret void
2335
}
@@ -28,6 +40,9 @@ define void @h() comdat {
2840
ret void
2941
}
3042

43+
uselistorder ptr @g, { 2, 1, 0}
44+
; USELISTORDER: uselistorder ptr @g, { 2, 1, 0 }
45+
3146
; CHECK: !llvm.module.flags = !{![[FLAG1:[0-9]+]], ![[FLAG2:[0-9]+]]}
3247
; CHECK: ![[FLAG1]] = !{i32 1, !"EnableSplitLTOUnit", i32 1}
3348
; CHECK: ![[FLAG2]] = !{i32 1, !"ThinLTO", i32 0}

0 commit comments

Comments
 (0)