Commit Graph

19 Commits

Author SHA1 Message Date
Erik Desjardins cbe09544af cg_llvm: use index-based loop in write_operand_repeatedly
This is easier for LLVM to analyze.
2023-06-11 00:04:53 -04:00
Matthias Krüger 4ab5ed8d9b Rollup merge of #111878 - ferrocene:pa-codegen-tests, r=Mark-Simulacrum
Fix codegen test suite for bare-metal-like targets

For Ferrocene I needed to run the test suite for custom target with no unwinding and static relocation. Running the tests uncovered ~20 failures due to the test suite not accounting for these options. This PR fixes them by:

* Fixing `CHECK`s to account for functions having extra LLVM IR attributes (in this case `nounwind`).
* Fixing `CHECK`s to account for the `dso_local` LLVM IR modifier, which is [added to every item when relocation is static](https://github.com/rust-lang/rust/blob/2d62f71710b39960039820136a0be19ac4003d45/compiler/rustc_codegen_llvm/src/mono_item.rs#L139-L142).
* Fixing `CHECK`s to account for missing `uwtables` attributes.
* Added the `needs-unwind` attributes for tests that are designed to check unwinding.

There is no part of Rust CI that checks this unfortunately, and testing whether the PR works locally is kinda hard because you need a target with std enabled but no unwinding and static relocations. Still, this works in my local testing, and if future PRs accidentally break this Ferrocene will take care of sending followup PRs.
2023-06-03 20:38:11 +02:00
Ben Kimock 59044cb2e6 Enable ScalarReplacementOfAggregates 2023-05-31 19:18:16 -04:00
Pietro Albini 086eb5abf8 codegen: allow the dso_local attribute
The attribute is injected into most items when static relocation is
enabled in a target.
2023-05-23 16:54:33 +02:00
bors 1b386d4ca5 Auto merge of #111634 - marc0246:arc-new-uninit-bloat, r=thomcc
Fix duplicate `arcinner_layout_for_value_layout` calls when using the uninit `Arc` constructors

What this fixes is the duplicate calls to `arcinner_layout_for_value_layout` seen here: https://godbolt.org/z/jr5Gxozhj

The issue was discovered alongside #111603 but is otherwise unrelated to the duplicate `alloca`s, which remain unsolved. Everything I tried to solve said main issue has failed.

As for the duplicate layout calculations, I also tried slapping `#[inline]` and `#[inline(always)]` on everything in sight but the only thing that worked in the end is to dedup the calls by hand.
2023-05-22 15:06:32 +00:00
marc0246 7014b5b4f0 Fix duplicate arcinner_layout_for_value_layout calls 2023-05-16 08:53:05 +02:00
Scott McMurray 0842e85d28 Stop checking for the absense of something that doesn't exist
A couple of codegen tests are doing
```
// CHECK-NOT: slice_index_len_fail
```

However, that function no longer exists: [the only places](https://github.com/search?q=repo%3Arust-lang%2Frust+slice_index_len_fail&type=code) it occurs in the repo are in those tests.

So this PR updates the tests to check for the absense of the functions that are actually used today to panic for out-of-bounds indexing.
2023-05-12 21:59:26 -07:00
The 8472 27f72a1f04 fix codegen test 2023-04-28 23:08:54 +02:00
The 8472 66c825a4bf bless tests 2023-04-27 22:29:04 +02:00
bors 8052678d2a Auto merge of #109895 - nikic:llvm-16-tests, r=cuviper
Add codegen tests for issues fixed by LLVM 16

Fixes #75978.
Fixes #99960.
Fixes #101048.
Fixes #101082.
Fixes #101814.
Fixes #103132.
Fixes #103327.
2023-04-12 02:30:21 +00:00
Nikita Popov 0ee1d5722d Make test compatible with 32-bit 2023-04-11 17:19:07 +02:00
Nikita Popov dc662143be Add ignore-debug to two tests
These don't optimize with debug assertions. For one of them, this
is due to the new alignment checks, for the other I'm not sure
what specifically blocks it.
2023-04-11 11:22:15 +02:00
Nikita Popov 6b8b1a5b67 Add codegen tests for issues fixed by LLVM 16
Fixes #75978.
Fixes #99960.
Fixes #101048.
Fixes #101082.
Fixes #101814.
Fixes #103132.
Fixes #103327.
2023-04-03 17:02:57 +02:00
Pietro Albini 66cfa2e9e5 make 32bit ignore more accurate 2023-04-03 10:23:08 +02:00
Ben Kimock 8d2696a56c A MIR transform that checks pointers are aligned 2023-03-23 18:23:06 -04:00
Scott McMurray 50b0ba6fea Also move the auxiliary file 2023-03-20 10:25:29 +00:00
Scott McMurray 8561b2909d mv tests/codegen/issue-* tests/codegen/issues/ 2023-03-20 10:25:29 +00:00
Scott McMurray c2ae3b8804 Add a codegen test to confirm this fixes 73258 2023-03-12 13:23:22 -07:00
Scott McMurray 26e6fa46f2 Add a codegen test to confirm this fixes 106369 2023-03-12 12:57:40 -07:00