about summary refs log tree commit diff
path: root/tests/codegen
AgeCommit message (Collapse)AuthorLines
2024-08-10Auto merge of #128584 - DianQK:tests-for-llvm-19, r=nikicbors-0/+67
Add a set of tests for LLVM 19 Close #107681. Close #118306. Close #126585. r? compiler
2024-08-08Add a set of tests for LLVM 19DianQK-0/+67
2024-08-07Auto merge of #128796 - matthiaskrgr:rollup-r7l68ph, r=matthiaskrgrbors-6/+6
Rollup of 8 pull requests Successful merges: - #128221 (Add implied target features to target_feature attribute) - #128261 (impl `Default` for collection iterators that don't already have it) - #128353 (Change generate-copyright to generate HTML, with cargo dependencies included) - #128679 (codegen: better centralize function declaration attribute computation) - #128732 (make `import.vis` is immutable) - #128755 (Integrate crlf directly into related test file instead via of .gitattributes) - #128772 (rustc_codegen_ssa: Set architecture for object crate for 32-bit SPARC) - #128782 (unused_parens: do not lint against parens around &raw) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-07Disallow setting built-in cfgs via set the command-lineUrgau-43/+43
2024-08-07Add implied features to non-target-feature functionsCaleb Zulawski-4/+4
2024-08-07Don't use LLVM to compute -Ctarget-featureCaleb Zulawski-1/+1
2024-08-07Fix codegen testsCaleb Zulawski-5/+5
2024-08-05Rollup merge of #128500 - clubby789:122600-test, r=Mark-SimulacrumMatthias Krüger-0/+19
Add test for updating enum discriminant through pointer Closes #122600
2024-08-04Auto merge of #128466 - sayantn:stdarch-update, r=tgross35bors-21/+0
Update the stdarch submodule cc `@tgross35` `@Amanieu` r? `@tgross35` try-job: dist-various-2
2024-08-04Chore: add `x86_amx_intrinsics` feature flag to `core/lib.rs` and remove ↵sayantn-21/+0
`issue-120720-reduce-nan.rs`
2024-08-03Add test for updating enum discriminant through pointerclubby789-0/+19
2024-08-01Implement `UncheckedIterator` directly for `RepeatN`Scott McMurray-1/+14
2024-07-30Auto merge of #128378 - matthiaskrgr:rollup-i3qz9uo, r=matthiaskrgrbors-0/+55
Rollup of 4 pull requests Successful merges: - #127574 (elaborate unknowable goals) - #128141 (Set branch protection function attributes) - #128315 (Fix vita build of std and forbid unsafe in unsafe in the os/vita module) - #128339 ([rustdoc] Make the buttons remain when code example is clicked) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-30Auto merge of #128250 - Amanieu:select_unpredictable, r=nikicbors-0/+35
Add `select_unpredictable` to force LLVM to use CMOV Since https://reviews.llvm.org/D118118, LLVM will no longer turn CMOVs into branches if it comes from a `select` marked with an `unpredictable` metadata attribute. This PR introduces `core::intrinsics::select_unpredictable` which emits such a `select` and uses it in the implementation of `binary_search_by`.
2024-07-30Rollup merge of #128141 - nikic:aarch64-bti, r=DianQK,cuviperMatthias Krüger-0/+55
Set branch protection function attributes Since LLVM 19, it is necessary to set not only module flags, but also function attributes for branch protection on aarch64. See https://github.com/llvm/llvm-project/commit/e15d67cfc2e5775cc79281aa860f3ad3be628f39 for the relevant LLVM change. Fixes https://github.com/rust-lang/rust/issues/127829.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-4/+4
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-28Force LLVM to use CMOV for binary searchAmanieu d'Antras-0/+35
Since https://reviews.llvm.org/D118118, LLVM will no longer turn CMOVs into branches if it comes from a `select` marked with an `unpredictable` metadata attribute. This PR introduces `core::intrinsics::select_unpredictable` which emits such a `select` and uses it in the implementation of `binary_search_by`.
2024-07-27Rollup merge of #128262 - DianQK:remove-unused-tests, r=saethlinTrevor Gross-34/+0
Delete `SimplifyArmIdentity` and `SimplifyBranchSame` tests These two passes have already been deleted in #107256. I'm not sure why tidy didn't catch it. As regression tests, I didn't delete `tests/ui/mir/issue-66851.rs` and `tests/ui/mir/simplify-branch-same.rs`. r? compiler
2024-07-27Auto merge of #124905 - reitermarkus:u32-from-char-opt, r=scottmcmbors-0/+35
Allow optimizing `u32::from::<char>`. Extracted from https://github.com/rust-lang/rust/pull/124307. This allows optimizing the panicking branch in the `escape_unicode` function, see https://rust.godbolt.org/z/61YhKrhvP.
2024-07-27Delete `SimplifyArmIdentity` and `SimplifyBranchSame` testsDianQK-34/+0
2024-07-25Let InstCombine remove Clone shims inside Clone shimsBen Kimock-0/+20
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2024-07-24Set branch protection function attributesNikita Popov-0/+55
Since LLVM 19, it is necessary to set not only module flags, but also function attributes for branch protection on aarch64. See https://github.com/llvm/llvm-project/commit/e15d67cfc2e5775cc79281aa860f3ad3be628f39 for the relevant LLVM change.
2024-07-21Use `leading_zeros` instead of `ilog2` in tests.Markus Reiter-6/+6
2024-07-21Simplify test.Markus Reiter-6/+8
2024-07-21Add test for cast optimization.Markus Reiter-0/+33
2024-07-21Auto merge of #127715 - klensy:tests-w, r=Mark-Simulacrumbors-5/+0
reenable some windows tests Locally passing on `x86_64-pc-windows-msvc`, fingers crossed for `*-pc-windows-gnu`. try-job: x86_64-msvc try-job: x86_64-mingw
2024-07-15Use Option's discriminant as its size hintScott McMurray-1/+34
2024-07-14reenable some windows testsklensy-5/+0
2024-07-12Auto merge of #123351 - beetrees:x86-ret-snan-rust, r=nikic,workingjubileebors-8/+34
Ensure floats are returned losslessly by the Rust ABI on 32-bit x86 Solves #115567 for the (default) `"Rust"` ABI. When compiling for 32-bit x86, this PR changes the `"Rust"` ABI to return floats indirectly instead of in x87 registers (with the exception of single `f32`s, which this PR returns in general purpose registers as they are small enough to fit in one). No change is made to the `"C"` ABI as that ABI requires x87 register usage and therefore will need a different solution.
2024-07-12Adjust tests for x86 "Rust" ABI changesbeetrees-8/+34
2024-07-02Use the aligned size for alloca at ret when the pass mode is cast.DianQK-11/+11
2024-07-02Use the aligned size for alloca at args when the pass mode is cast.DianQK-28/+11
The `load` and `store` instructions in LLVM access the aligned size.
2024-07-02Add the definition for `extern "C"` at `cast-target-abi.rs`.DianQK-24/+358
2024-06-25Updated code for changes to RFC, added additional error handling, addedFlorian Schmiderer-28/+169
tests
2024-06-25Support `#[patchable_function_entries]`Matthew Maurer-0/+20
See [RFC](https://github.com/maurer/rust-rfcs/blob/patchable-function-entry/text/0000-patchable-function-entry.md) (yet to be numbered) TODO before submission: * Needs an RFC * Improve error reporting for malformed attributes
2024-06-25Support for -Z patchable-function-entryMatthew Maurer-0/+8
`-Z patchable-function-entry` works like `-fpatchable-function-entry` on clang/gcc. The arguments are total nop count and function offset. See MCP rust-lang/compiler-team#704
2024-06-25Auto merge of #126852 - scottmcm:more-checked-math-tweaks, r=Amanieubors-0/+14
Also get `add nuw` from `uN::checked_add` When I was doing this for `checked_{sub,shl,shr}`, it was mentioned https://github.com/rust-lang/rust/pull/124114#issuecomment-2066173305 that it'd be worth trying for `checked_add` too. It makes a particularly-big difference for `x.checked_add(C)`, as doing this means that LLVM removes the intrinsic and does it as a normal `x <= MAX - C` instead. cc `@DianQK` who had commented about `checked_add` related to https://github.com/rust-lang/hashbrown/issues/509 before cc https://github.com/llvm/llvm-project/issues/80637 for how LLVM is unlikely to do this itself
2024-06-23Also get `add nuw` from `uN::checked_add`Scott McMurray-0/+14
2024-06-23test: ignore force-frame-pointers test on some targetsJubilee Young-0/+7
all of these currently force stronger frame pointers, and currently the CLI does not override the target
2024-06-23test: for frame-pointer=non-leaf codegen optsJubilee Young-2/+7
2024-06-21Auto merge of #126578 - scottmcm:inlining-bonuses-too, r=davidtwcobors-1/+5
Account for things that optimize out in inlining costs This updates the MIR inlining `CostChecker` to have both bonuses and penalties, rather than just penalties. That lets us add bonuses for some things where we want to encourage inlining without risking wrapping into a gigantic cost. For example, `switchInt(const …)` we give an inlining bonus because codegen will actually eliminate the branch (and associated dead blocks) once it's monomorphized, so measuring both sides of the branch gives an unrealistically-high cost to it. Similarly, an `unreachable` terminator gets a small bonus, because whatever branch leads there doesn't actually exist post-codegen.
2024-06-20Auto merge of #116088 - nbdd0121:unwind, r=Amanieu,RalfJungbors-42/+15
Stabilise `c_unwind` Fix #74990 Fix #115285 (that's also where FCP is happening) Marking as draft PR for now due to `compiler_builtins` issues r? `@Amanieu`
2024-06-19Give inlining bonuses to things that optimize outScott McMurray-1/+5
2024-06-19Fix wasm_exceptions testGary Guo-3/+3
2024-06-19update codegen test for `array::repeat`joboet-1/+1
2024-06-19add codegen test for `array::repeat`joboet-0/+15
2024-06-19Fix non-x86 testsGary Guo-1/+1
2024-06-19Remove c_unwind from tests and fix testsGary Guo-38/+11
2024-06-16Apply suggestion.Slanterns-1/+3
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2024-06-16add codegen test for `Error::provide`Slanterns-0/+48