Repository navigation
xls/jit: Synthesize llvm::DataLayout from TargetLayoutInfo on demand. - #5557
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
`JitRuntime` previously stored a copy of the target `llvm::DataLayout` solely for the deprecated `JitRuntime::data_layout()` accessor, which crashed on AOT runtimes constructed from `TargetLayoutInfo` and could not be inlined into callers to retire the accessor. Add `DataLayoutFromTargetLayoutInfo` and have `JitRuntime::data_layout()` (`ABSL_DEPRECATE_AND_INLINE()`) return a synthesized `llvm::DataLayout` by value on both JIT and AOT runtimes instead of storing one in `JitRuntime`. Because `TargetLayoutInfo` captures only XLS-relevant alignment and endianness rules, non-XLS `llvm::DataLayout` properties (pointer, float, vector, and mangling specs) use defaults while `LlvmTypeConverter` and struct-layout queries on XLS types match the target layout. PiperOrigin-RevId: 1029357972
copybara-service
Bot
force-pushed
the
test_1029357972
branch
from
November 25, 2026 06:07
9198d22 to
001a369
Compare
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
xls/jit: Synthesize llvm::DataLayout from TargetLayoutInfo on demand.
JitRuntimepreviously stored a copy of the targetllvm::DataLayoutsolely for the deprecatedJitRuntime::data_layout()accessor, which crashed on AOT runtimes constructed fromTargetLayoutInfoand could not be inlined into callers to retire the accessor.Add
DataLayoutFromTargetLayoutInfoand haveJitRuntime::data_layout()(ABSL_DEPRECATE_AND_INLINE()) return a synthesizedllvm::DataLayoutby value on both JIT and AOT runtimes instead of storing one inJitRuntime. BecauseTargetLayoutInfocaptures only XLS-relevant alignment and endianness rules, non-XLSllvm::DataLayoutproperties (pointer, float, vector, and mangling specs) use defaults whileLlvmTypeConverterand struct-layout queries on XLS types match the target layout.