about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src
AgeCommit message (Collapse)AuthorLines
2023-10-28share the track_caller handling within a mir::BodyRalf Jung-32/+5
2023-10-28interpret: call caller_location logic the same way codegen does, and share ↵Ralf Jung-10/+1
some code
2023-10-28Auto merge of #116609 - eduardosm:bump-stdarch, r=workingjubileebors-35/+0
Bump stdarch submodule and remove special handling for LLVM intrinsics that are no longer needed Bumps stdarch to pull https://github.com/rust-lang/stdarch/pull/1477, which reimplemented some functions with portable SIMD intrinsics instead of arch specific LLVM intrinsics. Handling of those LLVM intrinsics is removed from cranelift codegen and miri. cc `@RalfJung` `@bjorn3`
2023-10-24Merge commit '93a5433f17ab5ed48cc88f1e69b0713b16183373' into ↵bjorn3-77/+213
sync_cg_clif-2023-10-24
2023-10-21Merge commit 'c07d1e2f88cb3b1a0604ae8f18b478c1aeb7a7fa' into ↵bjorn3-34/+90
sync_cg_clif-2023-10-21
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-10-17[RFC 3127 - Trim Paths]: Condition remapped filepath on remap scopesUrgau-5/+30
2023-10-16docs: add Rust logo to more compiler cratesMichael Howell-0/+3
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the compiler's crates, but avoided adding it to all of them to reduce bit-rot. This commit adds to more.
2023-10-12Remove from cranelift codegen LLVM intrinsics that are no longer neededEduardo Sánchez Muñoz-35/+0
2023-10-09Fix review commentsbjorn3-1/+1
2023-10-09Remove cgu_reuse_tracker from Sessionbjorn3-32/+36
This removes a bit of global mutable state
2023-10-09Reuse determine_cgu_reuse from cg_ssa in cg_clifbjorn3-29/+1
2023-10-09Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into ↵bjorn3-206/+237
sync_cg_clif-2023-10-09
2023-10-06Rollup merge of #116277 - RalfJung:post-mono, r=oli-obkJubilee-11/+0
dont call mir.post_mono_checks in codegen It seems like all tests are still passing when I remove this... let's see what CI says.
2023-10-05Rollup merge of #116223 - catandcoder:master, r=cjgillotJubilee-1/+1
Fix misuses of a vs an Fixes the misuse of "a" vs "an", according to English grammatical expectations and using https://www.a-or-an.com/
2023-10-04Fix misuses of a vs ancui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-02have better explanation for `relate_types`ouz-a-1/+1
2023-10-02change is_subtype to relate_typesouz-a-2/+4
2023-10-02Add docs, remove code, change subtyper codeouz-a-3/+9
2023-10-02subtyping_projectionsouz-a-0/+3
2023-09-30dont call mir.post_mono_checks in codegenRalf Jung-11/+0
2023-09-30Auto merge of #115933 - oli-obk:simd_shuffle_const, r=workingjubileebors-1/+49
Prototype using const generic for simd_shuffle IDX array cc https://github.com/rust-lang/rust/issues/85229 r? `@workingjubilee` on the design TLDR: there is now a `fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;` intrinsic that allows replacing ```rust simd_shuffle(a, b, const { stuff }) ``` with ```rust simd_shuffle_generic::<_, _, {&stuff}>(a, b) ``` which makes the compiler implementations much simpler, if we manage to at some point eliminate `simd_shuffle`. There are some issues with this today though (can't do math without bubbling it up in the generic arguments). With this change, we can start porting the simple cases and get better data on the others.
2023-09-28Skip reinterning if nothing changedOli Scherer-8/+0
2023-09-28Strip `OpaqueCast` during `RevealAll`.Oli Scherer-1/+1
2023-09-26subst -> instantiatelcnr-1/+1
2023-09-21Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obkGuillaume Gomez-5/+5
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const Also, be more consistent with the `to/eval_bits` methods... we had some that take a type and some that take a size, and then sometimes the one that takes a type is called `bits_for_ty`. Turns out that `ty::Const`/`mir::ConstKind` carry their type with them, so we don't need to even pass the type to those `eval_bits` functions at all. However this is not properly consistent yet: in `ty` we have most of the methods on `ty::Const`, but in `mir` we have them on `mir::ConstKind`. And indeed those two types are the ones that correspond to each other. So `mir::ConstantKind` should actually be renamed to `mir::Const`. But what to do with `mir::Constant`? It carries around a span, that's really more like a constant operand that appears as a MIR operand... it's more suited for `syntax.rs` than `consts.rs`, but the bigger question is, which name should it get if we want to align the `mir` and `ty` types? `ConstOperand`? `ConstOp`? `Literal`? It's not a literal but it has a field called `literal` so it would at least be consistently wrong-ish... ``@oli-obk`` any ideas?
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-5/+5
2023-09-19adjust constValue::Slice to work for arbitrary slice typesRalf Jung-8/+4
2023-09-19move ConstValue into mirRalf Jung-1/+2
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-18Auto merge of #115748 - RalfJung:post-mono, r=oli-obkbors-32/+12
move required_consts check to general post-mono-check function This factors some code that is common between the interpreter and the codegen backends into shared helper functions. Also as a side-effect the interpreter now uses the same `eval` functions as everyone else to get the evaluated MIR constants. Also this is in preparation for another post-mono check that will be needed for (the current hackfix for) https://github.com/rust-lang/rust/issues/115709: ensuring that all locals are dynamically sized. I didn't expect this to change diagnostics, but it's just cycle errors that change. r? `@oli-obk`
2023-09-18Prototype using const generic for simd_shuffle IDX arrayOli Scherer-1/+49
2023-09-15fix gcc, cranelift buildRalf Jung-8/+8
2023-09-15clarify PassMode::Indirect as wellRalf Jung-15/+15
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-16/+9
also share the code that emits the actual error
2023-09-14move required_consts check to general post-mono-check functionRalf Jung-37/+24
2023-09-14make it more clear which functions create fresh AllocIdRalf Jung-13/+11
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-3/+3
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-6/+11
2023-09-13Rollup merge of #115798 - RalfJung:non_1zst_field, r=wesleywiserMatthias Krüger-13/+6
add helper method for finding the one non-1-ZST field
2023-09-13Rollup merge of #115736 - Zoxc:time-cleanup, r=wesleywiserMatthias Krüger-26/+15
Remove `verbose_generic_activity_with_arg` This removes `verbose_generic_activity_with_arg` and changes users to `generic_activity_with_arg`. This keeps the output of `-Z time` readable while these repeated events are still available with the self profiling mechanism.
2023-09-13make the eval() functions on our const types return the resulting valueRalf Jung-31/+6
2023-09-12add helper method for finding the one non-1-ZST fieldRalf Jung-13/+6
2023-09-10Remove `verbose_generic_activity_with_arg`John Kåre Alsaker-26/+15
2023-09-07Use `Freeze` for `SourceFile.lines`John Kåre Alsaker-1/+1
2023-09-06Auto merge of #115580 - eduardosm:stdarch-intrinsics, r=davidtwco,bjorn3bors-248/+0
Update stdarch submodule and remove special handling in cranelift codegen for some AVX and SSE2 LLVM intrinsics https://github.com/rust-lang/stdarch/pull/1463 reimplemented some x86 intrinsics to avoid using some x86-specific LLVM intrinsics: * Store unaligned (`_mm*_storeu_*`) use `<*mut _>::write_unaligned` instead of `llvm.x86.*.storeu.*`. * Shift by immediate (`_mm*_s{ll,rl,ra}i_epi*`) use `if` (srl, sll) or `min` (sra) to simulate the behaviour when the RHS is out of range. RHS is constant, so the `if`/`min` will be optimized away. This PR updates the stdarch submodule to pull these changes and removes special handling for those LLVM intrinsics from cranelift codegen. I left gcc codegen untouched because there are some autogenerated lists.
2023-09-05Remove special handling in codegen for some AVX and SSE2 shift by immediate ↵Eduardo Sánchez Muñoz-240/+0
intrinsics Those were removed from stdarch in https://github.com/rust-lang/stdarch/pull/1463 (`simd_shl` and `simd_shr` are used instead)
2023-09-05Remove special handling in codegen for some SSE2 "storeu" intrinsicsEduardo Sánchez Muñoz-8/+0
Those were removed from stdarch in https://github.com/rust-lang/stdarch/pull/1463 (`<*mut _>::write_unaligned` is used instead)
2023-09-03Use relative positions inside a SourceFile.Camille GILLOT-5/+2
2023-08-29Rollup merge of #111580 - atsuzaki:layout-ice, r=oli-obkMatthias Krüger-1/+1
Don't ICE on layout computation failure Fixes #111176 regression. r? `@oli-obk`
2023-08-29const_eval and codegen: audit uses of is_zstRalf Jung-3/+5