summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/builder.rs
AgeCommit message (Collapse)AuthorLines
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
2023-05-03Add cross-language LLVM CFI support to the Rust compilerRamon de C Valle-4/+6
This commit adds cross-language LLVM Control Flow Integrity (CFI) support to the Rust compiler by adding the `-Zsanitizer-cfi-normalize-integers` option to be used with Clang `-fsanitize-cfi-icall-normalize-integers` for normalizing integer types (see https://reviews.llvm.org/D139395). It provides forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space). For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653. Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and -Zsanitizer-cfi-normalize-integers, and requires proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto).
2023-03-05Merge commit '08a6d6e16b5efe217123e780398969946266268f' into ↵Antoni Boucher-81/+332
sync-cg_gcc-2023-03-04
2023-01-22abi: add `AddressSpace` field to `Primitive::Pointer`Erik Desjardins-1/+1
...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.
2023-01-04Simplify some iterator combinatorsMichael Goulet-1/+1
2022-12-03Destruct landing_pad return value before passing it to cg_ssabjorn3-7/+7
2022-11-16Use `&mut Bx` more.Nicholas Nethercote-5/+4
For the next commit, `FunctionCx::codegen_*_terminator` need to take a `&mut Bx` instead of consuming a `Bx`. This triggers a cascade of similar changes across multiple functions. The resulting code is more concise and replaces many `&mut bx` expressions with `bx`.
2022-10-02Remove type argument of array_alloca and rename to byte_array_allocabjorn3-1/+1