about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/common.rs
AgeCommit message (Collapse)AuthorLines
2024-10-30Clean up FFI calls for operand bundlesZalathar-4/+4
2024-10-28Use a type-safe helper to cast `&str` and `&[u8]` to `*const c_char`Zalathar-0/+18
2024-10-26Use safe wrappers `get_linkage` and `set_linkage`Zalathar-1/+1
2024-10-12`LLVMConstInt` only allows integer typesDianQK-0/+13
2024-10-08compiler: Factor rustc_target::abi out of cg_llvmJubilee Young-1/+3
2024-09-24Auto merge of #130389 - Luv-Ray:LLVMMDNodeInContext2, r=nikicbors-1/+2
llvm: replace some deprecated functions `LLVMMDStringInContext` and `LLVMMDNodeInContext` are deprecated, replace them with `LLVMMDStringInContext2` and `LLVMMDNodeInContext2`. Also replace `Value` with `Metadata` in some function signatures for better consistency.
2024-09-23Check vtable projections for validity in miriMichael Goulet-2/+2
2024-09-19Reorder `ConstMethods`.Nicholas Nethercote-19/+19
It's crazy to have the integer methods in something close to random order. The reordering makes the gaps clear: `const_i64`, `const_i128`, `const_isize`, and `const_u16`. I guess they just aren't needed.
2024-09-19replace some deprecated functionsLuv-Ray-1/+2
2024-09-17Rename supertraits of `CodegenMethods`.Nicholas Nethercote-1/+1
Supertraits of `BuilderMethods` are all called `XyzBuilderMethods`. Supertraits of `CodegenMethods` are all called `XyzMethods`. This commit changes the latter to `XyzCodegenMethods`, for consistency.
2024-08-16Add `warn(unreachable_pub)` to `rustc_codegen_llvm`.Nicholas Nethercote-11/+11
2024-08-12Rollup merge of #128537 - Jamesbarford:118980-const-vector, r=RalfJung,nikicGuillaume Gomez-5/+5
const vector passed through to codegen This allows constant vectors using a repr(simd) type to be propagated through to the backend by reusing the functionality used to do a similar thing for the simd_shuffle intrinsic #118209 r​? RalfJung
2024-08-08const vector passed to codegenJames Barford-Evans-5/+5
2024-07-30Move is_mingw_gnu_toolchain and i686_decorated_name to cg_ssabjorn3-65/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-8/+8
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-02Miri function identity hack: account for possible inliningRalf Jung-2/+2
2024-06-21Remove const_bitcast from ConstMethodsbjorn3-4/+0
2024-06-10ScalarInt: size mismatches are a bug, do not delay the panicRalf Jung-1/+1
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_codegen_llvm`.Nicholas Nethercote-0/+1
2024-04-16Codegen ZSTs without an allocationMark Rousskov-16/+33
This makes sure that &[] is just as efficient as indirecting through unsafe code (from_raw_parts). No new stable guarantee is intended about whether or not we do this, this is just an optimization. Co-authored-by: Ralf Jung <post@ralfj.de>
2024-03-23Add+Use `mir::BinOp::Cmp`Scott McMurray-0/+4
2024-03-10Fix 32-bit overflows in LLVM composite constantserer1243-8/+9
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-2/+2
is immutable
2023-11-15Ensure strings created with `const_str` get the `unnamed_addr` attributeThom Chiovoloni-0/+1
2023-08-01Auto merge of #105545 - erikdesjardins:ptrclean, r=bjorn3bors-14/+4
cleanup: remove pointee types This can't be merged until the oldest LLVM version we support uses opaque pointers, which will be the case after #114148. (Also note `-Cllvm-args="-opaque-pointers=0"` can technically be used in LLVM 15, though I don't think we should support that configuration.) I initially hoped this would provide some minor perf win, but in https://github.com/rust-lang/rust/pull/105412#issuecomment-1341224450 it had very little impact, so this is only valuable as a cleanup. As a followup, this will enable #96242 to be resolved. r? `@ghost` `@rustbot` label S-blocked
2023-07-30inline format!() args up to and including rustc_codegen_llvmMatthias Krüger-2/+2
2023-07-29cg_ssa: remove pointee types and pointercast/bitcast-of-ptrErik Desjardins-5/+1
2023-07-29cg_llvm: remove pointee types and pointercast/bitcast-of-ptrErik Desjardins-9/+3
2023-07-10Reuse LLVMConstInBoundsGEP2Jubilee Young-2/+2
We have had LLVM 14 as our minimum for a bit now.
2023-06-10Support 128-bit enum variant in debuginfo codegenDonoughLiu-0/+4
2023-05-26Stop creating intermediate places just to immediate convert them to operandsOli Scherer-32/+17
2023-04-18Store hashes in special types so they aren't accidentally encoded as numbersBen Kimock-2/+2
2023-04-01use and_then/flat_map for map().flatten()Matthias Krüger-2/+1
2023-03-16Use poison instead of undefNikita Popov-0/+4
In cases where it is legal, we should prefer poison values over undef values. This replaces undef with poison for aggregate construction and for uninhabited types. There are more places where we can likely use poison, but I wanted to stay conservative to start with. In particular the aggregate case is important for newer LLVM versions, which are not able to handle an undef base value during early optimization due to poison-propagation concerns.
2023-02-25Name LLVM anonymous constants by a hash of their contentsJohn Kåre Alsaker-2/+8
2023-01-22abi: add `AddressSpace` field to `Primitive::Pointer`Erik Desjardins-2/+2
...and remove it from `PointeeInfo`, which isn't meant for this. There are still various places (marked with FIXMEs) that assume all pointers have the same size and alignment. Fixing this requires parsing non-default address spaces in the data layout string, which will be done in a followup.
2022-09-09Introduce a fallible variant of LLVMConstIntGetZExtValueTomasz Miąsko-1/+5
which verifies that a constant bit width is within 64 bits or fails.
2022-09-06Remove dead broken code from const zst handling in backendsOli Scherer-4/+0
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-1/+0
by module
2022-08-26Implementation of import_name_typeDaniel Paoliello-0/+76
2022-07-20slightly cleaner, if more verbose, vtable handling in codegen backendsRalf Jung-8/+9
2022-07-20consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)Ralf Jung-2/+2
2022-07-20add a Vtable kind of symbolic allocationsRalf Jung-0/+8
2022-07-09don't allow ZST in ScalarIntRalf Jung-5/+4
There are several indications that we should not ZST as a ScalarInt: - We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it. `ValTree::zst()` used the former, but the latter could possibly arise as well. - Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`. - LLVM codegen already had to special-case ZST ScalarInt. So instead add new ZST variants to those types that did not have other variants which could be used for this purpose.
2022-07-08Auto merge of #98638 - bjorn3:less_string_interning, r=tmiaskobors-17/+21
Use less string interning This removes string interning in a couple of places where doing so won't result in perf improvements. I also switched one place to use pre-interned symbols.
2022-06-30llvm-wrapper: adapt for LLVMConstExtractValue removalKrasimir Georgiev-2/+1
2022-06-28Avoid unnecessary string interning for const_strbjorn3-17/+21
2022-04-05Mark scalar layout unions so that backends that do not support partially ↵Oli Scherer-5/+5
initialized scalars can special case them.
2022-04-02make memcmp return a value of c_int_width instead of i32David Morrison-0/+4
2022-03-07Auto merge of #94638 - erikdesjardins:noextranull, r=nagisabors-28/+16
cleanup: remove unused ability to have LLVM null-terminate const strings (and the copied function in rustc_codegen_gcc) Noticed this while writing https://github.com/rust-lang/rust/pull/94450#issuecomment-1059687348. r? `@nagisa`