Skip to content

Merge 2020-10-28 into swift/tensorflow #2056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 418 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
418 commits
Select commit Hold shift + click to select a range
5dad915
[Swift] Synthesized type alias should be implicit to avoid upsetting …
slavapestov Oct 7, 2020
6cdb2c3
Merge pull request #1892 from Teemperor/RunSwiftTestsOnlyWithEnabledS…
shahmishal Oct 7, 2020
c28fb2b
Merge branch 'swift/main' of github.com:apple/llvm-project into swift…
ainu-bot Oct 7, 2020
9a14690
Merge pull request #1893 from Teemperor/RunSwiftShellTestsOnlyWhenSwi…
shahmishal Oct 7, 2020
30a0cf4
Merge remote-tracking branch 'origin/apple/stable/20200714' into swif…
JDevlieghere Oct 7, 2020
adb227f
[lldb] Regenerate the static bindings
JDevlieghere Oct 7, 2020
eb20e57
[lldb] Implement TypeSystemSwiftTypeRef::CreateTupleType
kastiglione Oct 7, 2020
ba813dd
Use NDEBUG for inlined macro
kastiglione Oct 7, 2020
9ac059c
Merge pull request #1867 from JDevlieghere/🍒/bastille/e1ef7183c6f008f…
JDevlieghere Oct 7, 2020
aba7154
Merge commit '9ac059cf46a7' from apple/stable/20200714 into swift/main
Oct 8, 2020
254c6ff
[clang][Index] Add guard to IndexUnitReader module name reading
bnbarham Oct 7, 2020
0bb10e4
Merge pull request #1917 from apple/merge-bastille-into-main
fredriss Oct 8, 2020
c17f50a
Merge pull request #1921 from bnbarham/benb/cherry-pick-b89f7e8
bnbarham Oct 8, 2020
264500e
Merge pull request #1916 from slavapestov/implicit-typealias-astscope
slavapestov Oct 8, 2020
bd1dd36
[lldb][swift] Add missing swiftTest decorators
Teemperor Oct 8, 2020
a340d18
Merge commit 'c17f50a45bb0' from apple/stable/20200714 into swift/main
adrian-prantl Oct 8, 2020
d58b514
Rename test to give it a unique name
adrian-prantl Oct 8, 2020
bee6286
Rename test to give it a unique name
adrian-prantl Oct 8, 2020
f9c85c8
Merge pull request #1924 from adrian-prantl/rename-test
adrian-prantl Oct 8, 2020
5f90706
Add tests; Fix found bug; Add descriptive comment
kastiglione Oct 9, 2020
190f7a8
Test named tuple elements too
kastiglione Oct 9, 2020
faaf4b9
[AST] Fix crashes caused by redeclarations in hidden prototypes
bnbarham Oct 9, 2020
12424dd
[lldb] Format unix signal table (NFC)
JDevlieghere Oct 7, 2020
f27bb63
Change the default handling of SIGCONT to nosuppress/nostop/notify
jimingham Oct 8, 2020
216e87d
[lldb] Format remaining signal table (NFC)
JDevlieghere Oct 9, 2020
47a1b79
Merge commit '22c8171b1afe' from apple/stable/20200714 into swift/main
Oct 9, 2020
22c8171
Merge pull request #1929 from bnbarham/benb/cherry-pick-fbb499e
bnbarham Oct 9, 2020
7669e9d
Merge pull request #1922 from Teemperor/AddMissingSwiftDecorators
Teemperor Oct 9, 2020
16e3925
Merge pull request #1930 from JDevlieghere/🍒/bastille/0fcacefd1604942…
fredriss Oct 9, 2020
347e815
Add a Transform() utility for rewriting demangle trees. (NFC)
adrian-prantl Oct 9, 2020
f6c3c45
Remove the dynamic self replacement from canonicalization
adrian-prantl Oct 9, 2020
5a39dbd
Merge pull request #1919 from apple/lldb-Implement-TypeSystemSwiftTyp…
kastiglione Oct 9, 2020
91cfc6f
Merge commit '16e3925a831d' from apple/stable/20200714 into swift/main
Oct 9, 2020
cb1a6ae
Merge pull request #1926 from adrian-prantl/a-transformative-patch
adrian-prantl Oct 9, 2020
19e31c5
DirectoryWatcher: add an implementation for Windows
compnerd Oct 1, 2020
c377dba
Merge pull request #1933 from adrian-prantl/factor-out-dynamic-self
adrian-prantl Oct 9, 2020
a153c00
Merge commit 'd38d7b6c9ed0' from apple/stable/20200714 into swift/main
Oct 10, 2020
d38d7b6
Merge pull request #1936 from compnerd/watching
compnerd Oct 10, 2020
dbef9ec
[lldb] Update to match apple/swift#33935
beccadax Oct 11, 2020
9f1d8f2
Merge pull request #1937 from brentdax/these-imports-are-testing-my-p…
beccadax Oct 11, 2020
d85505d
[debugserver] Fix that debugserver's stop reply packets always return…
Teemperor Sep 3, 2020
a9014a9
[lldb] Remove debugserver specific string from TestAbortExitCode check
Teemperor Sep 3, 2020
ea40221
Merge commit '5288c94a7e3b' from apple/stable/20200714 into swift/main
Oct 12, 2020
5288c94
Merge pull request #1938 from Teemperor/cherry/f0699d9109143754088c26…
Teemperor Oct 12, 2020
c24d7bf
[lldb] Fix that C++ base name is only calculated when Swift plugin is…
Teemperor Oct 9, 2020
fa17d12
[lldb] Add SBModule::GarbageCollectAllocatedModules and clear modules…
Teemperor Aug 17, 2020
8239453
Merge pull request #1932 from Teemperor/FixModuleLookupInfoIfdefSwift
Teemperor Oct 12, 2020
5009d66
Merge pull request #1939 from Teemperor/cherry/c2f9454a16e45e1df09d8e…
Teemperor Oct 12, 2020
f02195f
[lldb] Alphabetically sort test categories (NFC)
JDevlieghere Oct 12, 2020
6735735
[lldb] Add instrumentation runtime category
JDevlieghere Oct 12, 2020
e5e1ec7
[lldb] Handle alternative output in TestAbortExitCode
kastiglione Oct 12, 2020
6aa44b3
Merge pull request #1942 from apple/lldb-Handle-alternative-output-in…
fredriss Oct 12, 2020
917a0e5
Merge pull request #1943 from JDevlieghere/🍒/bastille/e465ddac880228b…
fredriss Oct 12, 2020
4782156
[llvm] Export LLVM_USE_SPLIT_DWARF in LLVMConfig.cmake
JDevlieghere Oct 12, 2020
e3ec22d
Merge pull request #1944 from JDevlieghere/🍒/bastille/7f8dc347c9552f3…
JDevlieghere Oct 13, 2020
86d1260
[repl_swift] Delete codesigning override
vedantk Oct 13, 2020
59ea711
TypeSystem: silence a number of uncovered switch warnings
compnerd Oct 13, 2020
5931fab
Merge pull request #1945 from vedantk/eng/PR-70237254
vedantk Oct 13, 2020
ec01dd9
[repl_swift] Delete unused Xcode project
vedantk Oct 13, 2020
d776078
Revert "[repl_swift] Delete codesigning override"
vedantk Oct 13, 2020
a2e131a
Merge pull request #1946 from compnerd/covering-your-bases
compnerd Oct 13, 2020
a107763
[lldb/DWARF] Fix handling of variables with both location and const_v…
labath Aug 26, 2020
da9b7d8
[lldb/DWARF] Fix handling of variables with both location and const_v…
labath Aug 26, 2020
31031e6
Remove legacy Swift language constant support
adrian-prantl Oct 13, 2020
f6a1e30
Merge pull request #1947 from vedantk/delete-repl-swift-xcodeprj
vedantk Oct 13, 2020
0bebe9f
[llvm-cov] Warn when -arch spec is missing/invalid for universal bina…
vedantk Oct 13, 2020
ee91d80
[cmake] Unconditionally set the force flag when codesigning
vedantk Oct 13, 2020
523e6ec
Merge pull request #1948 from apple/revert-1945-eng/PR-70237254
vedantk Oct 13, 2020
d9e4ea4
[repl_swift] Add get-task-allow entitlement
vedantk Oct 13, 2020
bac4247
Merge pull request #1949 from adrian-prantl/D86615
adrian-prantl Oct 14, 2020
8a348eb
Move initialization of Variable::m_loc_is_const_data into constructor…
adrian-prantl Oct 14, 2020
9886422
Move initialization of Variable::m_loc_is_const_data into constructor…
adrian-prantl Oct 14, 2020
ed468a3
Merge pull request #1950 from adrian-prantl/D86615-main
adrian-prantl Oct 14, 2020
d449c81
[lldb] Reject redefinitions of persistent variables
Teemperor Oct 14, 2020
a2727a2
Merge commit '5009d66cabff' from apple/stable/20200714 into swift/main
Teemperor Oct 14, 2020
24d0a14
Merge pull request #1959 from Teemperor/cherry/cb81e662a58908913f3425…
Teemperor Oct 14, 2020
cd62e2a
[lldb] Fix Python syntax error in lldbtest.py
Teemperor Oct 14, 2020
40f9432
[lldb] Regenerate the static bindings
Teemperor Oct 14, 2020
c1548e8
Merge pull request #1951 from vedantk/wip/upstream-entitlement
vedantk Oct 14, 2020
31ff245
Merge pull request #1953 from apple/eng/PR-40312677
vedantk Oct 14, 2020
3fbce23
Merge pull request #1954 from apple/eng/PR-70237254
vedantk Oct 14, 2020
e31457a
Merge pull request #1956 from adrian-prantl/constant_loc-main
adrian-prantl Oct 14, 2020
678c6a1
Merge pull request #1955 from adrian-prantl/constant_data
adrian-prantl Oct 14, 2020
8642e64
Add accessors. (NFC)
adrian-prantl Oct 2, 2020
feab006
Merge pull request #1960 from adrian-prantl/access
adrian-prantl Oct 14, 2020
dee9c92
Merge pull request #1912 from apple/lldb-Remove-unused-version-defines
kastiglione Oct 14, 2020
812fd46
Merge commit '5009d66cabff' from apple/stable/20200714 into swift/main
Oct 14, 2020
4e85bc4
Make sure the Swift REPL is initialized with host OS availablity.
adrian-prantl Jul 31, 2020
e161d5c
Refactor LookupClangType to take a module holder rather than a module.
adrian-prantl Oct 10, 2020
cc23662
[lldb] Fix typo in disassemble_options_line description
JDevlieghere Aug 28, 2020
eaceb46
Use the dynamic type of self in the expression evaluator.
adrian-prantl Oct 10, 2020
2d0b083
Merge pull request #1965 from JDevlieghere/🍒/bastille/cdc18163cd1449c…
fredriss Oct 14, 2020
35a228e
Merge commit 'feab006e953a' from apple/stable/20200714 into swift/main
adrian-prantl Oct 14, 2020
bfe6989
Sort the cases in GetTypeClass (NFC)
adrian-prantl Jul 17, 2020
4863244
Appease older compilers
adrian-prantl Oct 14, 2020
cd779d2
Merge pull request #1963 from adrian-prantl/66928153
adrian-prantl Oct 14, 2020
2ea629d
Merge pull request #1966 from adrian-prantl/69020595
adrian-prantl Oct 15, 2020
8a243da
[dsymutil] Fix handling of aliases to private external symbols
JDevlieghere Oct 15, 2020
8fd6327
[lldb] Add swiftTest decorator to TestSwiftGenericClass.py
Teemperor Oct 15, 2020
482aea0
[lldb] Add REQUIRES swift to Availability.test
Teemperor Oct 15, 2020
d636cf1
[lldb][swift] Remove mydir calculation from lldbplaygroundrepl
Teemperor Oct 15, 2020
edbe9da
Merge pull request #1970 from JDevlieghere/🍒/bastille/f9fb9da36c34d27…
JDevlieghere Oct 15, 2020
2f79cf7
Merge pull request #1968 from adrian-prantl/66928085
adrian-prantl Oct 15, 2020
f5962ed
Merge pull request #1971 from Teemperor/AddSwiftTestToTestSwiftGeneri…
Teemperor Oct 15, 2020
83ebe86
Merge pull request #1973 from Teemperor/SwiftOnlyAvailability
Teemperor Oct 15, 2020
8d54827
Merge pull request #1975 from Teemperor/RemoveMyDirPlaygroundRepl
Teemperor Oct 15, 2020
d74692e
[ASTImporter] Modifying ImportDeclContext(...) to ensure that we also…
shafik Sep 21, 2020
6c474d2
Merge pull request #1981 from shafik/66810957_importdeclcontext_handl…
shafik Oct 16, 2020
3aaa717
Merge commit '35a228ec5316' from apple/stable/20200714 into swift/main
adrian-prantl Oct 16, 2020
d26ebfd
[lldb/Swift] Fix import attributes handing in expression evaluations
medismailben Oct 14, 2020
98050f7
Merge pull request #1978 from medismailben/swift/main
medismailben Oct 16, 2020
f6b1a6a
Add support for more OS types to AddClangModuleCompilationOptionsForS…
adrian-prantl Oct 16, 2020
ea50a44
Resolve merge conflict.
adrian-prantl Oct 16, 2020
f920543
Merge commit '3aaa71720ea5' from apple/stable/20200714 into swift/main
adrian-prantl Oct 16, 2020
0ac1051
Merge commit '6c474d2fcfa8' from apple/stable/20200714 into swift/main
Oct 17, 2020
0e87f35
[cmake] Limit missing external lit warning to be shown once
kastiglione Oct 14, 2020
75ccad1
Add an SB API to get the SBTarget from an SBBreakpoint
jimingham Oct 15, 2020
ef4906d
Only print validation warnings when actually triggering an assertion.
adrian-prantl Oct 16, 2020
590ecce
[lldb] Fix few easily correctable warnings
kastiglione Oct 16, 2020
e184b47
[cmake] Centralize LLVM_ENABLE_WARNINGS option
kastiglione Sep 21, 2020
9c80a3d
Merge pull request #1990 from apple/lldb-Fix-few-easily-correctable-w…
kastiglione Oct 17, 2020
9298450
Merge pull request #1984 from apple/cmake-Limit-missing-external-lit-…
kastiglione Oct 17, 2020
e509ca5
Merge pull request #1991 from apple/cmake-Centralize-LLVM_ENABLE_WARN…
kastiglione Oct 17, 2020
b6c965e
Merge commit 'e509ca5ee572' from apple/stable/20200714 into swift/main
Oct 17, 2020
0180055
TypeSystem: silence some errors identified by MSVC
compnerd Oct 17, 2020
782fc26
Merge commit '0efe2f4d6702' from apple/stable/20200714 into swift/main
Oct 20, 2020
0efe2f4
Merge pull request #1987 from jimingham/sbbreak-get-target
jimingham Oct 19, 2020
e6aba2f
[llvm] Make obj2yaml and yaml2obj LLVM utilities instead of tools
JDevlieghere Oct 19, 2020
5ec3814
Merge pull request #1998 from JDevlieghere/🍒/bastille/97b8e2c1f063
JDevlieghere Oct 20, 2020
020bdf7
Teach the swift calling convention about _Atomic types
aschwaighofer Aug 19, 2020
4308eeb
Merge pull request #1988 from adrian-prantl/less-verbose
adrian-prantl Oct 20, 2020
e0ff757
Merge commit '5ec381467b18' from apple/stable/20200714 into swift/main
Oct 20, 2020
386224a
[lldb][swift] Make swiftTest decorator not always skip
Teemperor Oct 19, 2020
603a944
[lldb][swift] Skip all failing tests
Teemperor Oct 20, 2020
1322305
Merge pull request #1983 from adrian-prantl/66927829
adrian-prantl Oct 20, 2020
e7b3fd9
Merge commit '1322305e1787' from apple/stable/20200714 into swift/main
Oct 20, 2020
caa575b
Use LLVM_TOOLCHAIN_UTILITIES to allow utils to be installed in the to…
JDevlieghere Oct 20, 2020
acf0294
[Apple-stage2] Install FileCheck and yaml2obj in the toolchain
JDevlieghere Oct 20, 2020
c82e10b
TypeSystem: Avoid the ISO646 spelling of the logical operators
compnerd Oct 20, 2020
bb018f4
Merge pull request #1997 from Teemperor/MakeSwiftTestDecoratorNotAlwa…
adrian-prantl Oct 20, 2020
9a8083d
Remove validation from GetTypeBitAlign.
adrian-prantl Oct 20, 2020
5c10c16
Remove obsolete early exit.
adrian-prantl Oct 20, 2020
9e8e885
delete commented-out code
adrian-prantl Oct 20, 2020
66359bb
unxfail passing tests
adrian-prantl Oct 20, 2020
e54f82c
Merge pull request #2000 from JDevlieghere/🍒/bastille/024921a5e165cc2…
JDevlieghere Oct 20, 2020
c51d693
Merge commit 'e54f82cc8a08' from apple/stable/20200714 into swift/main
Oct 21, 2020
33f81b5
[ORC] Add a LLJITWithThinLTOSummaries example in OrcV2Examples
weliveindetail Aug 14, 2020
3a62560
[ORC] Fix an endif comment.
lhames Aug 24, 2020
d07ed0c
[examples] Fix dependencies for OrcV2Examples/LLJITWithThinLTOSummaries.
lhames Aug 25, 2020
35de35d
[ORC][JITLink] Switch to unique ownership for EHFrameRegistrars.
lhames Aug 26, 2020
1171d1e
[ORC] Add getDFSLinkOrder / getReverseDFSLinkOrder methods to JITDylib.
lhames Aug 29, 2020
8ddd01a
[NFCI] Silent a build warning due to an extra semi-colon
SouraVX Aug 31, 2020
4f7c68d
[ORC] Remove a stray semicolon, silencing warnings. NFC.
mstorsjo Aug 31, 2020
100d3f9
[ORC] Remove an unused variable.
lhames Aug 31, 2020
c6fc120
[ORC] Add unit test for HasMaterializationSideEffectsOnly failure beh…
lhames Sep 1, 2020
b59c73a
[ORC] Fix MachOPlatform's synthetic symbol dependence registration.
lhames Sep 2, 2020
86642a4
[ORC] Add an early out for MachOPlatform's init-scraper plugin setup.
lhames Sep 2, 2020
ffed708
[ORC] Remove stray debugging output.
lhames Sep 2, 2020
8e6136f
[ORC] Fix some bugs in TPCDynamicLibrarySearchGenerator, use in llvm-…
lhames Sep 4, 2020
96219e1
[ORC] Make MaterializationResponsibility immovable, pass by unique_ptr.
lhames Sep 10, 2020
4999363
Revert "[ORC] Make MaterializationResponsibility immovable, pass by u…
fhahn Sep 11, 2020
b7ca38a
Re-apply "[ORC] Make MaterializationResponsibility immovable..." with…
lhames Sep 11, 2020
a426c69
[JITLink] Improve formatting for Edge, Block and Symbol debugging out…
lhames Sep 13, 2020
d578186
[ORC] Add operations to create and lookup JITDylibs to OrcV2 C bindings.
lhames Sep 16, 2020
e1e7f1d
Remove unnecessary forward declarations. NFCI.
RKSimon Sep 17, 2020
b2331f0
[ORC][examples] Add an OrcV2 example for IR optimization via IRTransf…
lhames Sep 20, 2020
9489860
[ORC][examples] Add missing library dependencies.
lhames Sep 22, 2020
dfeb5c7
[ORC][examples] Temporarily remove LLJITWithChildProcess until ORC TP…
weliveindetail Oct 1, 2020
1ff9f71
[JITLink][ELF] Handle BSS sections, improve some error messages.
lhames Oct 6, 2020
c963a10
[RuntimeDyld][COFF] Report fatal error on error, rather than emiting …
lhames Oct 6, 2020
5458c7c
[ORC] Remove OrcV1 APIs.
lhames Sep 8, 2020
973562e
[ORC] Add support for resource tracking/removal (removable code).
lhames Sep 11, 2020
c032b7e
[ORC][examples] Update Kaleidoscope and BuildingAJIT tutorial series …
lhames Sep 23, 2020
1bcd561
[ORC] Add a missing '&'.
lhames Oct 19, 2020
7ea775d
[ORC] Move SimpleResourceManager function object inits out of constru…
lhames Oct 19, 2020
4436be1
[ORC] Move MaterializationResponsibility methods to ExecutionSession.
lhames Oct 2, 2020
4cd25b5
[ORC] Move DefinitionGenerator out of JITDylib.
lhames Oct 1, 2020
b356e9a
[ORC] Update Symbol Lookup / DefinitionGenerator system.
lhames Oct 14, 2020
1f4a1fd
[ORC] Fix a memory leak in the OrcV2 C API (and some comment typos).
lhames Oct 1, 2020
703f9e9
[ORC] Add a C API function to set the ExecutionSession error reporter.
lhames Oct 1, 2020
e69bd68
[ORC] Add C API functions to obtain and clear the symbol string pool.
lhames Oct 2, 2020
46febcd
[ORC] Fix C API function name.
lhames Oct 14, 2020
bdd2866
[ORC] Rename LLVMOrcJITDylibDefinitionGeneratorRef.
lhames Oct 14, 2020
338abf1
[ORC] Add basic ResourceTracker support to the OrcV2 C Bindings.
lhames Oct 15, 2020
d81624b
[ORC] Add an OrcV2 ResourceTracker / Removable-code example.
lhames Oct 15, 2020
e2b7d59
[ORC] Add support for custom generators to the C bindings.
lhames Oct 16, 2020
5072a52
[ORC] Add C API support for defining absolute symbols.
lhames Oct 16, 2020
727fc8f
[ORC] Add function to get pool entry string.
lhames Oct 19, 2020
535d19b
[ORC] Break up C-API header Orc.h, and add JITEventListener support.
lhames Oct 16, 2020
c76854e
[ORC] Fix unused variable warning.
lhames Oct 19, 2020
fc29985
[ORC] Fix a missing include.
lhames Oct 19, 2020
68400f3
[ORC] Remove commented out methods accidentally left in in 069919c9ba3.
lhames Oct 20, 2020
ebb299f
Add override to fix -Winconsistent-missing-override warning.
echristo Aug 10, 2020
162a8bc
Merge pull request #2002 from adrian-prantl/unxfail-main
adrian-prantl Oct 21, 2020
3d74427
[lldb] Don't strip LLDB.framework on install
JDevlieghere Oct 21, 2020
f934d3e
Merge pull request #2006 from jimingham/missing_override
jimingham Oct 21, 2020
460ad31
Merge commit 'e66243499b46' from apple/stable/20200714 into swift/main
Oct 21, 2020
e662434
Merge pull request #2009 from JDevlieghere/🍒/bastille/c565f09f4b0d908…
fredriss Oct 21, 2020
bd7991c
Merge commit '8099dc6be2cc' from apple/stable/20200714 into swift/main
Oct 21, 2020
8099dc6
Merge pull request #1999 from aschwaighofer/rdar_67351073
aschwaighofer Oct 21, 2020
08dd9cc
[Clang] Add option to allow marking pass-by-value args as noalias.
fhahn Sep 12, 2020
a81d496
Merge pull request #2001 from apple/compnerd-iso646
compnerd Oct 21, 2020
23b3574
Merge commit '08dd9ccc53e0' from apple/stable/20200714 into swift/main
Oct 21, 2020
46fd0ae
Use the use_dynamic option to determine whether to dynamically resolve
adrian-prantl Oct 21, 2020
202bca8
Remove obsolote early exit. This fixes a regression hidden by 2c911bc…
adrian-prantl Oct 21, 2020
7a5a004
Enable passing tests
adrian-prantl Oct 21, 2020
c6d7adb
Merge pull request #2007 from adrian-prantl/dynamic-main
adrian-prantl Oct 21, 2020
a48c648
Bind generic types in the expression evaluator if dybamic types are r…
adrian-prantl Oct 21, 2020
ee9caf1
Fix various warnings.
adrian-prantl Oct 21, 2020
1a5ae14
[TypeSystemSwiftTypeRef] Collect type info for Builtin.Word
vedantk Oct 21, 2020
c481264
Re-enable change; was disabled to validate the testcase
vedantk Oct 21, 2020
6f82cde
[lldb] Pass --swift-compiler in lldb-dotest
JDevlieghere Oct 22, 2020
639d0aa
Fix .debug_aranges parsing. (#2019)
jasonmolenda Oct 22, 2020
1ddf96c
Merge pull request #2016 from vedantk/stsref-builtin-word
vedantk Oct 22, 2020
7818c62
Merge pull request #2018 from JDevlieghere/swift_compiler
JDevlieghere Oct 22, 2020
34b5645
[lldb] Fix a regression introduced by D75730
JDevlieghere Oct 22, 2020
751719a
Merge pull request #2020 from JDevlieghere/🍒/bastille/826997c46280351…
fredriss Oct 22, 2020
869ac11
[lldb/DWARF] Add support for DW_OP_implicit_value
medismailben Oct 21, 2020
ed01c1a
Merge pull request #2012 from adrian-prantl/nodeforprinting-main
adrian-prantl Oct 22, 2020
2add546
Merge pull request #2014 from adrian-prantl/binding-main
adrian-prantl Oct 22, 2020
6e091c1
[InstCombine] Remove dbg.values describing contents of dead allocas
vedantk Oct 20, 2020
cd56dfb
Merge pull request #2021 from medismailben/apple/stable/20200714
medismailben Oct 22, 2020
df10872
Remove print statement from test that resulted in a non-deterministic…
adrian-prantl Oct 22, 2020
3635cb0
Merge pull request #2017 from lhames/swift-stable-jit-updates
lhames Oct 22, 2020
e548751
Revert "[CodeExtractor] Don't create bitcasts when inserting lifetime…
vedantk Oct 22, 2020
d5be1aa
[test] HotColdSplit: cover use of opaque pointer type
vedantk Oct 22, 2020
986e88d
Merge pull request #2022 from vedantk/eng/PR-66592859
vedantk Oct 22, 2020
1bad10b
Merge pull request #2025 from vedantk/eng/PR-70560161
vedantk Oct 22, 2020
6292d40
[elfabi] Move llvm-elfabi related code to InterfaceStub library
zeroomega Aug 11, 2020
70820c4
Remove unnecessary HEADER_DIRS in lib/InterfaceStub/CMakeLists.txt
zeroomega Aug 13, 2020
e43af04
[llvm] Fix ODRViolations for VersionTuple YAML specializations NFC
cyndyishida Oct 21, 2020
af1f38c
[APINotes] remove out ScalarTraits<VersionTuple>
cyndyishida Oct 22, 2020
56a74d3
Merge commit 'af1f38c88612' from apple/stable/20200714 into swift/main
Oct 24, 2020
d56215d
Merge pull request #2023 from adrian-prantl/70531607
adrian-prantl Oct 22, 2020
bcffc98
Merge commit '639d0aa2f738' from apple/stable/20200714 into swift/main
Oct 23, 2020
44ca486
[lldb][swift] Re-enable TestSwiftUnknownSelf
Teemperor Oct 23, 2020
77608cd
[lldb] Update static bindings
Teemperor Oct 23, 2020
7e8ae7b
[lldb][swift] Use dynamic types as a fallback in AddVariableInfo
Teemperor Oct 23, 2020
f04e63e
Merge pull request #2030 from Teemperor/swift/main-bindings-update
Teemperor Oct 26, 2020
d8ee9f3
Merge pull request #2029 from Teemperor/ReenableTestSwiftUnknownSelf.py
Teemperor Oct 26, 2020
c872dd7
Merge pull request #2031 from Teemperor/FixGenericTypes
Teemperor Oct 26, 2020
46170cc
Merge pull request #1993 from compnerd/coverage
compnerd Oct 26, 2020
adb23f8
Add a TypeSystemSwiftTypeRef::GetTupleElementName() method.
adrian-prantl Oct 27, 2020
a2f7b7f
Fix compilation warnings
adrian-prantl Oct 27, 2020
83139ee
Merge branch 'swift/main' of github.com:apple/llvm-project into swift…
Oct 27, 2020
dcb770b
Merge branch 'swift/tensorflow' of github.com:apple/llvm-project into…
ainu-bot Oct 27, 2020
c7692c0
Merge pull request #2049 from adrian-prantl/tuple-elem
adrian-prantl Oct 27, 2020
60a18b5
Merge pull request #2052 from adrian-prantl/warnings
adrian-prantl Oct 27, 2020
af80886
Merge upstream/swift/main into swift/tensorflow-stage (using imerge)
Oct 27, 2020
6c50663
Merge branch 'swift/main' of github.com:apple/llvm-project into swift…
ainu-bot Oct 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ORC] Add a LLJITWithThinLTOSummaries example in OrcV2Examples
The example demonstrates how to use a module summary index file produced for ThinLTO to:
* find the module that defines the main entry point
* find all extra modules that are required for the build

A LIT test runs the example as part of the LLVM test suite [1] and shows how to create a module summary index file.
The code also provides two Error types that can be useful when working with ThinLTO summaries.

[1] if LLVM_BUILD_EXAMPLES=ON and platform is not Windows

Differential Revision: https://reviews.llvm.org/D85974
  • Loading branch information
weliveindetail authored and lhames committed Oct 20, 2020
commit 33f81b51e06b8527ce68127f24e6197319379ce4
1 change: 1 addition & 0 deletions llvm/examples/OrcV2Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_subdirectory(LLJITWithLazyReexports)
add_subdirectory(LLJITWithObjectCache)
add_subdirectory(LLJITWithObjectLinkingLayerPlugin)
add_subdirectory(LLJITWithTargetProcessControl)
add_subdirectory(LLJITWithThinLTOSummaries)
add_subdirectory(OrcV2CBindingsAddObjectFile)
add_subdirectory(OrcV2CBindingsBasicUsage)
add_subdirectory(OrcV2CBindingsReflectProcessSymbols)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(LLVM_LINK_COMPONENTS
Core
ExecutionEngine
IRReader
OrcJIT
Support
nativecodegen
)

add_llvm_example(LLJITWithThinLTOSummaries
LLJITWithThinLTOSummaries.cpp
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
//===--- LLJITWithThinLTOSummaries.cpp - Module summaries as LLJIT input --===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// In this example we will use a module summary index file produced for ThinLTO
// to (A) find the module that defines the main entry point and (B) find all
// extra modules that we need. We will do this in five steps:
//
// (1) Read the index file and parse the module summary index.
// (2) Find the path of the module that defines "main".
// (3) Parse the main module and create a matching LLJIT.
// (4) Add all modules to the LLJIT that are covered by the index.
// (5) Look up and run the JIT'd function.
//
// The index file name must be passed in as command line argument. Please find
// this test for instructions on creating the index file:
//
// llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
//
// If you use "build" as the build directory, you can run the test from the root
// of the monorepo like this:
//
// > build/bin/llvm-lit -a \
// llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
//
//===----------------------------------------------------------------------===//

#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/ExecutionEngine/Orc/Core.h"
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/ExecutionEngine/Orc/ThreadSafeModule.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_ostream.h"

#include <string>
#include <system_error>
#include <vector>

using namespace llvm;
using namespace llvm::orc;

// Path of the module summary index file.
cl::opt<std::string> IndexFile{cl::desc("<module summary index>"),
cl::Positional, cl::init("-")};

// Describe a fail state that is caused by the given ModuleSummaryIndex
// providing multiple definitions of the given global value name. It will dump
// name and GUID for the global value and list the paths of the modules covered
// by the index.
class DuplicateDefinitionInSummary
: public ErrorInfo<DuplicateDefinitionInSummary> {
public:
static char ID;

DuplicateDefinitionInSummary(std::string GlobalValueName, ValueInfo VI)
: GlobalValueName(std::move(GlobalValueName)) {
ModulePaths.reserve(VI.getSummaryList().size());
for (const auto &S : VI.getSummaryList())
ModulePaths.push_back(S->modulePath().str());
llvm::sort(ModulePaths);
}

void log(raw_ostream &OS) const override {
OS << "Duplicate symbol for global value '" << GlobalValueName
<< "' (GUID: " << GlobalValue::getGUID(GlobalValueName) << ") in:\n";
for (const std::string &Path : ModulePaths) {
OS << " " << Path << "\n";
}
}

std::error_code convertToErrorCode() const override {
return inconvertibleErrorCode();
}

private:
std::string GlobalValueName;
std::vector<std::string> ModulePaths;
};

// Describe a fail state where the given global value name was not found in the
// given ModuleSummaryIndex. It will dump name and GUID for the global value and
// list the paths of the modules covered by the index.
class DefinitionNotFoundInSummary
: public ErrorInfo<DefinitionNotFoundInSummary> {
public:
static char ID;

DefinitionNotFoundInSummary(std::string GlobalValueName,
ModuleSummaryIndex &Index)
: GlobalValueName(std::move(GlobalValueName)) {
ModulePaths.reserve(Index.modulePaths().size());
for (const auto &Entry : Index.modulePaths())
ModulePaths.push_back(Entry.first().str());
llvm::sort(ModulePaths);
}

void log(raw_ostream &OS) const override {
OS << "No symbol for global value '" << GlobalValueName
<< "' (GUID: " << GlobalValue::getGUID(GlobalValueName) << ") in:\n";
for (const std::string &Path : ModulePaths) {
OS << " " << Path << "\n";
}
}

std::error_code convertToErrorCode() const override {
return llvm::inconvertibleErrorCode();
}

private:
std::string GlobalValueName;
std::vector<std::string> ModulePaths;
};

char DuplicateDefinitionInSummary::ID = 0;
char DefinitionNotFoundInSummary::ID = 0;

// Lookup the a function in the ModuleSummaryIndex and return the path of the
// module that defines it. Paths in the ModuleSummaryIndex are relative to the
// build directory of the covered modules.
Expected<StringRef> getMainModulePath(StringRef FunctionName,
ModuleSummaryIndex &Index) {
// Summaries use unmangled names.
GlobalValue::GUID G = GlobalValue::getGUID(FunctionName);
ValueInfo VI = Index.getValueInfo(G);

// We need a unique definition, otherwise don't try further.
if (!VI || VI.getSummaryList().empty())
return make_error<DefinitionNotFoundInSummary>(FunctionName.str(), Index);
if (VI.getSummaryList().size() > 1)
return make_error<DuplicateDefinitionInSummary>(FunctionName.str(), VI);

GlobalValueSummary *S = VI.getSummaryList().front()->getBaseObject();
if (!isa<FunctionSummary>(S))
return createStringError(inconvertibleErrorCode(),
"Entry point is not a function: " + FunctionName);

// Return a reference. ModuleSummaryIndex owns the module paths.
return S->modulePath();
}

// Parse the bitcode module from the given path into a ThreadSafeModule.
Expected<ThreadSafeModule> loadModule(StringRef Path,
orc::ThreadSafeContext TSCtx) {
outs() << "About to load module: " << Path << "\n";

Expected<std::unique_ptr<MemoryBuffer>> BitcodeBuffer =
errorOrToExpected(MemoryBuffer::getFile(Path));
if (!BitcodeBuffer)
return BitcodeBuffer.takeError();

MemoryBufferRef BitcodeBufferRef = (**BitcodeBuffer).getMemBufferRef();
Expected<std::unique_ptr<Module>> M =
parseBitcodeFile(BitcodeBufferRef, *TSCtx.getContext());
if (!M)
return M.takeError();

return ThreadSafeModule(std::move(*M), std::move(TSCtx));
}

int main(int Argc, char *Argv[]) {
InitLLVM X(Argc, Argv);

InitializeNativeTarget();
InitializeNativeTargetAsmPrinter();

cl::ParseCommandLineOptions(Argc, Argv, "LLJITWithThinLTOSummaries");

ExitOnError ExitOnErr;
ExitOnErr.setBanner(std::string(Argv[0]) + ": ");

// (1) Read the index file and parse the module summary index.
std::unique_ptr<MemoryBuffer> SummaryBuffer =
ExitOnErr(errorOrToExpected(MemoryBuffer::getFile(IndexFile)));

std::unique_ptr<ModuleSummaryIndex> SummaryIndex =
ExitOnErr(getModuleSummaryIndex(SummaryBuffer->getMemBufferRef()));

// (2) Find the path of the module that defines "main".
std::string MainFunctionName = "main";
StringRef MainModulePath =
ExitOnErr(getMainModulePath(MainFunctionName, *SummaryIndex));

// (3) Parse the main module and create a matching LLJIT.
ThreadSafeContext TSCtx(std::make_unique<LLVMContext>());
ThreadSafeModule MainModule = ExitOnErr(loadModule(MainModulePath, TSCtx));

auto Builder = LLJITBuilder();

MainModule.withModuleDo([&](Module &M) {
if (M.getTargetTriple().empty()) {
Builder.setJITTargetMachineBuilder(
ExitOnErr(JITTargetMachineBuilder::detectHost()));
} else {
Builder.setJITTargetMachineBuilder(
JITTargetMachineBuilder(Triple(M.getTargetTriple())));
}
if (!M.getDataLayout().getStringRepresentation().empty())
Builder.setDataLayout(M.getDataLayout());
});

auto J = ExitOnErr(Builder.create());

// (4) Add all modules to the LLJIT that are covered by the index.
JITDylib &JD = J->getMainJITDylib();

for (const auto &Entry : SummaryIndex->modulePaths()) {
StringRef Path = Entry.first();
ThreadSafeModule M = (Path == MainModulePath)
? std::move(MainModule)
: ExitOnErr(loadModule(Path, TSCtx));
ExitOnErr(J->addIRModule(JD, std::move(M)));
}

// (5) Look up and run the JIT'd function.
auto MainSym = ExitOnErr(J->lookup(MainFunctionName));

using MainFnPtr = int (*)(int, char *[]);
MainFnPtr MainFunction =
jitTargetAddressToFunction<MainFnPtr>(MainSym.getAddress());

int Result = runAsMain(MainFunction, {}, MainModulePath);
outs() << "'" << MainFunctionName << "' finished with exit code: " << Result
<< "\n";

return 0;
}
7 changes: 7 additions & 0 deletions llvm/test/Examples/OrcV2Examples/Inputs/bar-mod.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define i32 @bar() {
ret i32 0
}

^0 = module: (path: "bar-mod.o", hash: (3482110761, 1514484043, 2322286514, 2767576375, 2807967785))
^1 = gv: (name: "bar", summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 1, funcFlags: (readNone: 0, readOnly: 0, noRecurse: 0, returnDoesNotAlias: 0, noInline: 1, alwaysInline: 0)))) ; guid = 16434608426314478903
^2 = blockcount: 0
7 changes: 7 additions & 0 deletions llvm/test/Examples/OrcV2Examples/Inputs/foo-mod.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define i32 @foo() {
ret i32 0
}

^0 = module: (path: "foo-mod.o", hash: (3133549885, 2087596051, 4175159200, 756405190, 968713858))
^1 = gv: (name: "foo", summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 1, funcFlags: (readNone: 0, readOnly: 0, noRecurse: 0, returnDoesNotAlias: 0, noInline: 1, alwaysInline: 0)))) ; guid = 6699318081062747564
^2 = blockcount: 0
27 changes: 27 additions & 0 deletions llvm/test/Examples/OrcV2Examples/Inputs/main-mod.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
define i32 @main(i32 %argc, i8** %argv) {
entry:
%and = and i32 %argc, 1
%tobool = icmp eq i32 %and, 0
br i1 %tobool, label %if.end, label %if.then

if.then: ; preds = %entry
%call = tail call i32 @foo() #2
br label %return

if.end: ; preds = %entry
%call1 = tail call i32 @bar() #2
br label %return

return: ; preds = %if.end, %if.then
%retval.0 = phi i32 [ %call, %if.then ], [ %call1, %if.end ]
ret i32 %retval.0
}

declare i32 @foo()
declare i32 @bar()

^0 = module: (path: "main-mod.o", hash: (1466373418, 2110622332, 1230295500, 3229354382, 2004933020))
^1 = gv: (name: "foo") ; guid = 6699318081062747564
^2 = gv: (name: "main", summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 22, funcFlags: (readNone: 0, readOnly: 0, noRecurse: 1, returnDoesNotAlias: 0, noInline: 1, alwaysInline: 0), calls: ((callee: ^1), (callee: ^3))))) ; guid = 15822663052811949562
^3 = gv: (name: "bar") ; guid = 16434608426314478903
^4 = blockcount: 0
12 changes: 12 additions & 0 deletions llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# RUN: opt -module-summary %p/Inputs/main-mod.ll -o main-mod.bc
# RUN: opt -module-summary %p/Inputs/foo-mod.ll -o foo-mod.bc
# RUN: opt -module-summary %p/Inputs/bar-mod.ll -o bar-mod.bc

# RUN: llvm-lto -thinlto -o main-foo-bar main-mod.bc foo-mod.bc bar-mod.bc

# RUN: LLJITWithThinLTOSummaries main-foo-bar.thinlto.bc 2>&1 | FileCheck %s

# CHECK: About to load module: main-mod.bc
# CHECK: About to load module: foo-mod.bc
# CHECK: About to load module: bar-mod.bc
# CHECK: 'main' finished with exit code: 0
5 changes: 4 additions & 1 deletion llvm/test/Examples/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
if not config.build_examples or sys.platform in ['win32']:
config.unsupported = True
config.unsupported = True

# Test discovery should ignore subdirectories that contain test inputs.
config.excludes = ['Inputs']