-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LLD] [COFF] Port -lto-sample-profile to COFF version of LLD (#85701)
Following the commit of #83972 which added COFF support for SPGO, this patch ports the support of the option -lto-sample-profile that was only available in the ELF variant of LLD to the COFF variant to enable running the SPGO passes in the LTO/thinLTO pipelines.
- Loading branch information
1 parent
647d75d
commit a9fe23c
Showing
6 changed files
with
30 additions
and
0 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
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 @@ | ||
f:0:0 |
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,23 @@ | ||
; REQUIRES: x86 | ||
; RUN: opt -module-summary %s -o %t1.o | ||
; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o | ||
|
||
; RUN: rm -f %t1.o.4.opt.bc | ||
; RUN: lld-link /lto-sample-profile:%p/Inputs/lto-sample-profile.prof /lldsavetemps /entry:f /subsystem:console %t1.o %t2.o /out:%t3.exe | ||
; RUN: opt -S %t1.o.4.opt.bc | FileCheck %s | ||
|
||
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-pc-windows-msvc19.0.24215" | ||
|
||
; CHECK: ![[#]] = !{i32 1, !"ProfileSummary", ![[#]]} | ||
declare void @g(...) | ||
|
||
define void @h() { | ||
ret void | ||
} | ||
define void @f() { | ||
entry: | ||
call void (...) @g() | ||
call void (...) @h() | ||
ret void | ||
} |