about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/builder.rs
AgeCommit message (Collapse)AuthorLines
2025-03-07compiler: Use size_of from the prelude instead of importedThalia Archibald-5/+1
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2025-02-19Rework `OperandRef::extract_field` to stop calling `to_immediate_scalar` on ↵Scott McMurray-4/+8
things which are already immediates That means it stops trying to truncate things that are already `i1`s.
2025-02-19Emit `trunc nuw` for unchecked shifts and `to_immediate_scalar`Scott McMurray-1/+1
- For shifts this shrinks the IR by no longer needing an `assume` while still providing the UB information - Having this on the `i8`→`i1` truncations will hopefully help with some places that have to load `i8`s or pass those in LLVM structs without range information
2025-02-13Set both `nuw` and `nsw` in slice size calculationScott McMurray-25/+1
There's an old note in the code to do this, and now that LLVM-C has an API for it, we might as well.
2025-02-08Rustfmtbjorn3-11/+10
2025-02-04cg_gcc: Directly use rustc_abi instead of reexportsJubilee Young-1/+1
2025-01-13Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into ↵Antoni Boucher-20/+52
subtree-update_cg_gcc_2025_01_12
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-5/+5
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-10-29cg_gcc: `rustc_abi::Abi` => `BackendRepr`Jubilee Young-2/+2
2024-10-25coverage: SSA doesn't need to know about `instrprof_increment`Zalathar-10/+0
2024-10-18rust_for_linux: -Zregparm=<N> commandline flag for X86 (#116972)Andrew Zhogin-1/+7
2024-10-08cg_gcc: Factor out rustc_target::abiJubilee Young-3/+4
2024-09-27Merge commit '3187d32079b817522cc17413ec9185b130daf693' into subtree-updateGuillaume Gomez-31/+23
2024-09-24Auto merge of #130389 - Luv-Ray:LLVMMDNodeInContext2, r=nikicbors-0/+1
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-22Reformat using the new identifier sorting from rustfmtMichael Goulet-14/+15
2024-09-19replace some deprecated functionsLuv-Ray-0/+1
2024-09-17Use associative type defaults in `{Layout,FnAbi}OfHelpers`.Nicholas Nethercote-5/+0
This avoids some repetitive boilerplate code.
2024-09-17Rename supertraits of `CodegenMethods`.Nicholas Nethercote-2/+2
Supertraits of `BuilderMethods` are all called `XyzBuilderMethods`. Supertraits of `CodegenMethods` are all called `XyzMethods`. This commit changes the latter to `XyzCodegenMethods`, for consistency.
2024-09-17Merge `HasCodegen` into `BuilderMethods`.Nicholas Nethercote-6/+4
It has `Backend` and `Deref` boudns, plus an associated type `CodegenCx`, and it has a single use. This commit "inlines" it into `BuilderMethods`, which makes the complicated backend trait situation a little simpler.
2024-09-14simd_shuffle: require index argument to be a vectorRalf Jung-27/+12
2024-08-13make the GCC backend compatible with vector shuffle indicesRalf Jung-14/+30
2024-08-05nontemporal_store: make sure that the intrinsic is truly just a hintRalf Jung-0/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-3/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-17Format cg_gcc with same formatting parametersGuillaume Gomez-15/+3
2024-07-10Update `Cargo.lock` and remove duplicated implGuillaume Gomez-6/+0
2024-07-10Merge commit '98ed962c7d3eebe12c97588e61245273d265e72f' into masterGuillaume Gomez-41/+85
2024-05-09codegen: memmove/memset cannot be non-temporalRalf Jung-9/+4
2024-04-24Auto merge of #122053 - erikdesjardins:alloca, r=nikicbors-10/+4
Stop using LLVM struct types for alloca The alloca type has no semantic meaning, only the size (and alignment, but we specify it explicitly) matter. Using `[N x i8]` is a more direct way to specify that we want `N` bytes, and avoids relying on LLVM's struct layout. It is likely that a future LLVM version will change to an untyped alloca representation. Split out from #121577. r? `@ghost`
2024-04-19Auto merge of #117919 - daxpedda:wasm-c-abi, r=wesleywiserbors-1/+7
Introduce perma-unstable `wasm-c-abi` flag Now that `wasm-bindgen` v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it. This PR introduces a new perma-unstable `-Zwasm-c-abi` compiler flag, which switches to the new spec-compliant C ABI when targeting `wasm32-unknown-unknown`. Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide. This is a companion PR to #117918, but they could be merged independently. MCP: https://github.com/rust-lang/compiler-team/issues/703 Tracking issue: https://github.com/rust-lang/rust/issues/122532
2024-04-12restore location in gcc alloca codegenErik Desjardins-1/+7
2024-04-11use [N x i8] for alloca typesErik Desjardins-16/+4
2024-04-11Put `PlaceValue` into `OperandValue::Ref`, rather than 3 tuple fieldsScott McMurray-3/+4
2024-04-11Make `PlaceRef` hold a `PlaceValue` for the non-layout fields (like ↵Scott McMurray-12/+12
`OperandRef` does)
2024-03-23CFI: Use Instance at callsitesMatthew Maurer-2/+4
We already use `Instance` at declaration sites when available to glean additional information about possible abstractions of the type in use. This does the same when possible at callsites as well. The primary purpose of this change is to allow CFI to alter how it generates type information for indirect calls through `Virtual` instances.
2024-03-10Introduce perma-unstable `wasm-c-abi` flagdaxpedda-1/+7
2024-03-05Merge commit 'b385428e3ddf330805241e7758e773f933357c4b' into ↵Guillaume Gomez-514/+917
subtree-update_cg_gcc_2024-03-05
2024-02-26introduce and use ptradd/inbounds_ptradd instead of gepErik Desjardins-5/+1
2024-02-26remove struct_gep, use manual layout calculations for va_argErik Desjardins-29/+9
2024-02-21make simd_reduce_{mul,add}_unordered use only the 'reassoc' flag, not all ↵Ralf Jung-2/+2
fast-math flags
2024-02-20Add "algebraic" versions of the fast-math intrinsicsBen Kimock-0/+25
2023-12-28Change `rustc_codegen_ssa`'s `atomic_cmpxchg` interface to return a pair of ↵Bernd Schmidt-14/+6
values
2023-10-26Merge commit 'e4fe941b11a55c5005630696e9b6d81c65f7bd04' into ↵Antoni Boucher-3/+2
subtree-update_cg_gcc_2023-10-25
2023-10-09Merge commit '11a0cceab966e5ff1058ddbcab5977e8a1d6d290' into ↵Antoni Boucher-14/+15
subtree-update_cg_gcc_2023-10-09
2023-10-02Reapply: Mark drop calls in landing pads cold instead of noinlineErik Desjardins-1/+1
Co-authored-by: Max Fan <git@max.fan> Co-authored-by: Nikita Popov <npopov@redhat.com>
2023-08-28remove an unused argumentRalf Jung-1/+1
it was already unused before, but due to the recursion the compiler did not realize
2023-07-29cg_ssa: remove pointee types and pointercast/bitcast-of-ptrErik Desjardins-1/+0
2023-06-19Merge commit '1bbee3e217d75e7bc3bfe5d8c1b35e776fce96e6' into ↵Antoni Boucher-21/+51
sync-cg_gcc-2023-06-19
2023-05-31Add a distinct `OperandValue::ZeroSized` variant for ZSTsScott McMurray-1/+1
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than non-Scalar Aggregates sometimes being `Immediates` (like I got wrong and caused 109992). As a minor bonus, it means we don't need to generate poison LLVM values for them to pass around in `OperandValue::Immediate`s.
2023-05-07Add todo for filter landing padGary Guo-0/+1
2023-05-07Use `landingpad filter` to encode aborting landing padGary Guo-0/+4