-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Collection of rebranch changes required for the compiler to build #72750
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
Conversation
include/swift/SIL/SILInstruction.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felipepiovezan I assume we probably want to have an iterator bit here?
lib/IRGen/IRGenDebugInfo.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felipepiovezan I assume this is the underlying cause of the crashes and that we should instead use the new (old) intrinsic functions (https://github.com/llvm/llvm-project/blob/main/llvm/docs/RemoveDIsDebugInfo.md):
LLVMDIBuilderInsertDeclareIntrinsicBefore # Insert a debug intrinsic (old debug info format).
LLVMDIBuilderInsertDeclareIntrinsicAtEnd # Same as above.
LLVMDIBuilderInsertDbgValueIntrinsicBefore # Same as above.
LLVMDIBuilderInsertDbgValueIntrinsicAtEnd # Same as above.
EDIT: No, that's just the C API. It calls the same underlying functions as here but with an extra assertion on top.
81f619a to
72f4e00
Compare
|
@beccadax / @egorzhdan I'd appreciate a review on the ClangImporter changes. @aschwaighofer could you take a look over the IRGen ones? And @eeckstein for the SIL/Opt changes. They're all generally pretty small. @jansvoboda11 I don't think there was anything particularly crazy with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClangImporter changes LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FileEntry to FileEntryRef changes LGTM. So does usage of the new LLVM_*_OPT_* macros, but note that you might need to ensure you use the /Zc:preprocessor flag with MSVC (and maybe bump the minimal supported version): https://reviews.llvm.org/D135128
Ooo thanks, good to know! |
`OptTable` was a source of consistent churn due to new arguments to the `OPTION` macro. LLVM 3f092f37b7362447cbb13f5502dae4bdd5762afd extracted the handling of the common option parts (eg. an ID and an info) out into separate macros to reduce this - use those here (since unsurprisingly, more arguments were added).
LLVM is gearing up to move to `std::endianness` and as part of that has moved `llvm::support::endianness` to `llvm::endianness` (bbdbcd83e6702f314d147a680247058a899ba261). Rename our uses.
A bunch of enums were moved to enum classes and slightly renamed. Fix up their references.
`ThreadPool` was split up in LLVM 6594f428de91e333c1cbea4f55e79b18d31024c4.
`erase_value` is now deprecated.
Ananas/CloudABI/Contiki/Minix have all been removed from LLVM (in various commits). Also adds minimal (ie. necessary for compiling) support for the new triples.
`CommandSetVector::takeVector` returns a `SmallVector` now.
The varargs method was removed in af74f06322410e867294ea3587e5884342564e5c (claimed NFC) and the `AddAllArgs` taking an `ArrayRef` was renamed to `addAllArgs` in 4eecfda50a4e7a05f448a59885d2572d0ea2f4a1. But the other `AddAllArgs` was left as is.
Two new unhandled types: `PackIndexingType` and `CountAttributedType`.
LLVM 9c89b29555a7ccfc3942340f558c3bbea8d10532 changed `mangleTypeName` to instead mangle the canonical type name and thus also changed the method name.
Presumably this was previously transitively included, who knows from where.
The constructor takes a new arg which `Create` now handles. Use it instead.
Removed in LLVM 3a3b84b180278207731451dfac24f47d02b50e84.
142f270c279f2576e4618fc0d1121181c7531fdf fixed a memory leak involving `APSInt`. It is now returned by value in `getInitVal`.
Renamed in LLVM e90e43fb9cd1d305f7196cd526aa503374e0f616.
Moved from `Sema` to `Token` in LLVM a8279a8bc541b6027087dd497daa63b6602b7f4b.
…nAttr` Renamed in our LLVM fork 628ee3b842b1fcc93afdebc646220e8ae6302ed6.
Add corresponding `readTypeCoupledDeclRefInfo` and `writeTypeCoupledDeclRefInfo`.
This was refactored in LLVM 90893a3b3f71524947cb041b2a25d0a02a8956d7, with `InstrProfiling` becoming implementation details.
LLVM did a bunch of opaque pointer cleanup. Migrate IRGen off the removed APIs.
Typed pointers are slowly being removed. There's a lot more cleanup to do here, since really all `IRGenModule::.*PtrTy` should just be `PtrTy`, but this at least gets us compiling for now.
The various `DIBuilder` inserts now return a `DbgInsertPtr`, update `DbgIntrinsicEmitter` to as well.
Renamed in LLVM 2d9d9a1a556a5f8845a7a9e19dc52346b825989e.
Added in 9434c083475e42f47383f3067fe2a155db5c6a30, seems to be HLSL specific.
There was a type overload added to these in LLVM 25bc999d1fb2efccc3ece398550af738aea7d310.
These were consolidated in LLVM in 64da0be1fc06ee2199bd27c980736986e0eccd9d.
This would be done automatically if the module was passed into `Function::Create`, but we're quite specific about its insert location, so just set it manually instead.
… list Originally added in LLVM in 088d272e83259a5d8e577a3d2e62012c42a9f9db behind a flag, but then the flag was removed in 92eaf036bf22ecc276146cd073208e6a867af8d4.
`BlockT *LoopBase<BlockT, LoopT>::getLoopPreheader()` was changed in LLVM 7243607867393a2b8ccd477e95e6f62d00f3206f to use `llvm::size` rather than the checking that `child_begin() + 1 == child_end()`. `llvm::size` requires that `std::distance` be O(1) and hence `TransformIterator` (`swift::SILBasicBlock::succblock_iterator` defined as the child iterator type in the graph traits for `SILBasicBlock *`) support random access. The change to `llvm::size` seems rather pointless, so we could probably also revert that if need be.
a4c2c42 to
0950285
Compare
|
@swift-ci please test |
|
Going to go ahead and merge to continue along. Thanks for reviewing @jansvoboda11 and @egorzhdan! @aschwaighofer / @eeckstein when you have the time I'd really appreciate a quick look over 🙏 |
This set of changes enables the compiler to build, but currently asserts when building the stdlib while creating intrinsics and also when running LLVM's verifier pass.
Verifier failure:
ie. the module has
IsNewDbgInfoFormatset but the function does not.Intrinsic assertion:
Possibly related to the above?