commit | b02787d33f24d83f1d5814c578b7b0fce7156382 | [log] [tgz] |
---|---|---|
author | Andres-Salamanca <andrealebarbaritos@gmail.com> | Fri Jul 18 16:13:34 2025 -0500 |
committer | GitHub <noreply@github.com> | Fri Jul 18 16:13:34 2025 -0500 |
tree | 814531fb048888a642e1157c721a335d1509e9ad | |
parent | d63ab5467dcae0492e2f4def336ddbb73ce10dc5 [diff] |
[CIR] Fix alignment when lowering set/get bitfield operations (#148999) This PR fixes incorrect alignment when lowering `set` and `getBitField` operations to LLVM IR. The issue occurred because during lowering, the function was being called with an alignment of 0, which caused it to default to the alignment of the packed member. For example, if the bitfield was packed inside a `u64i`, it would use an alignment of 8. With this change, the generated code now matches what the classic codegen produces. In the assembly format, I changed to be similar to how it's done in loadOp. If there's a better approach, please feel free to point it out.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.