Skip to content

Sync rustc_codegen_cranelift #110992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 99 commits into from
Apr 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
760275d
Implement checked Shl/Shr at MIR building.
cjgillot Feb 13, 2023
7b3bd56
Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into sync_cg_…
bjorn3 Mar 15, 2023
bc6ee85
Merge branch 'sync_from_rust'
bjorn3 Mar 15, 2023
b1cf90c
Sparse registry is now the default on nightly
bjorn3 Mar 15, 2023
e42bea9
Auto merge of #108282 - cjgillot:mir-checked-sh, r=tmiasko
bors Mar 15, 2023
edb0717
Tweak implementation of overflow checking assertions
tmiasko Mar 16, 2023
5cfd41d
Sync from rust 511364e7874dba9649a264100407e4bffe7b5425
bjorn3 Mar 17, 2023
53d4428
Rustup to rustc 1.70.0-nightly (511364e78 2023-03-16)
bjorn3 Mar 17, 2023
18184d8
Format all tests in example/
bjorn3 Mar 18, 2023
b9d7e6f
Remove outdated fixme
bjorn3 Mar 18, 2023
a040947
Remove no longer necessary eliminate_unreachable_code pass
bjorn3 Mar 18, 2023
60aafee
Remove Ty::is_region_ptr
mu001999 Mar 20, 2023
b15fd79
Update to Cranelift 0.94
bjorn3 Feb 26, 2023
74e8659
Merge pull request #1363 from bjorn3/update_cranelift
bjorn3 Mar 21, 2023
76a1cfb
Give an error if any of the wrappers can't find cargo, rustc or rustdoc
bjorn3 Mar 21, 2023
ae0a22c
Update regex to fix FreeBSD tests
bjorn3 Mar 21, 2023
9558e12
Add `CastKind::Transmute` to MIR
scottmcm Feb 25, 2023
7ac6cc9
Auto merge of #108442 - scottmcm:mir-transmute, r=oli-obk
bors Mar 23, 2023
8b18860
A MIR transform that checks pointers are aligned
saethlin Nov 10, 2022
d170b6b
Sync from rust 1459b3128e288a85fcc4dd1fee7ada2cdcf28794
bjorn3 Mar 24, 2023
5c9f007
Rustup to rustc 1.70.0-nightly (1459b3128 2023-03-23)
bjorn3 Mar 24, 2023
6bced6e
Ignore Inlined spans when computing caller location
bjorn3 Mar 24, 2023
6352a40
Import github-release from bytecodealliance/wasmtime@a002a2cc5e15a0f2…
bjorn3 Mar 21, 2023
608ca6f
Add license identifiers
bjorn3 Mar 21, 2023
273ca2f
Update action name
bjorn3 Mar 21, 2023
ccab9b0
Remove stale assets
bjorn3 Mar 24, 2023
cc570ae
Publish a dev release on every commit
bjorn3 Mar 21, 2023
92bb0a8
Update indexmap and rayon crates
Zoxc Mar 25, 2023
eed1f75
Don't store vector types in ssa variables
bjorn3 Mar 25, 2023
aab1526
Recreate the release every time
bjorn3 Mar 25, 2023
a28adc8
Merge pull request #1365 from bjorn3/dev-release
bjorn3 Mar 25, 2023
bb5ac03
Refactor: `VariantIdx::from_u32(0)` -> `FIRST_VARIANT`
scottmcm Mar 26, 2023
c3ee030
Fix passing and returning vector types
bjorn3 Mar 26, 2023
ae60cb1
Merge pull request #1366 from bjorn3/rip_out_simd_ssa
bjorn3 Mar 26, 2023
257d900
Also include MIR statements in clif ir dumps by default
bjorn3 Mar 26, 2023
32f59ba
Add fixme
bjorn3 Mar 26, 2023
5b1268d
Update portable-simd
bjorn3 Mar 26, 2023
c0f2b10
Skip building crates without tests for regex
bjorn3 Mar 26, 2023
d0547f4
Run ui/extern tests from the rustc test suite
bjorn3 Mar 26, 2023
3b0631a
Sync from rust db0cbc48d4aaa300713a95d9b317a365a474490c
bjorn3 Mar 27, 2023
80d93e8
Rustup to rustc 1.70.0-nightly (db0cbc48d 2023-03-26)
bjorn3 Mar 27, 2023
9b40efa
Fix ICE for --emit llvm-ir
bjorn3 Mar 27, 2023
e564790
Split codegen_i128::maybe_codegen into two functions
bjorn3 Dec 2, 2022
b6cf0a6
Remove CPlace::inner and make CPlaceInner private
bjorn3 Mar 27, 2023
0e50c9e
Update example output in pretty_clif.rs
bjorn3 Mar 27, 2023
a5f11c7
Avoid CValue::const_val in a couple of places
bjorn3 Mar 27, 2023
174b73e
Refactor write_cvalue_maybe_transmute to clarify code flow
bjorn3 Mar 27, 2023
edc05ae
Improve public interface of CValue and CPlace
bjorn3 Mar 27, 2023
b2796ec
Add issue reference to fixmes
bjorn3 Mar 27, 2023
37ab4bd
Rollup merge of #108480 - Zoxc:rayon-tlv, r=cuviper
Noratrieb Mar 28, 2023
406eb96
Move `mir::Field` → `abi::FieldIdx`
scottmcm Mar 28, 2023
5a7ce46
Support TLS access into dylibs on Windows
Zoxc Feb 3, 2023
e88c405
Rollup merge of #109716 - scottmcm:field-to-fieldidx, r=oli-obk
matthiaskrgr Mar 29, 2023
86a71bf
Sync from rust 17c11672167827b0dd92c88ef69f24346d1286dd
bjorn3 Mar 30, 2023
dc7409c
Rustup to rustc 1.70.0-nightly (17c116721 2023-03-29)
bjorn3 Mar 30, 2023
fd4e1d5
Fix rustc test suite
bjorn3 Mar 30, 2023
69b57c2
Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>`
scottmcm Mar 29, 2023
e2e598f
Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obk
bors Mar 31, 2023
dc5a8c8
Use `FieldIdx` in various things related to aggregates
scottmcm Apr 2, 2023
9da329d
Refactor unwind from Option to a new enum
nbdd0121 Oct 8, 2022
446650c
Rename `Abort` terminator to `Terminate`
nbdd0121 Oct 31, 2022
9970b04
Don't deadlock when failing to acquire a jobserver token
bjorn3 Apr 9, 2023
c7053b3
Set a timeout of 1h for the "Various rustc tests" GHA workflow
bjorn3 Apr 9, 2023
c4b3794
Use --nocapture instead of RUST_TEST_NOCAPTURE
bjorn3 Apr 9, 2023
8b447bc
Sync from rust af06dce64bf87ea9206bdf6cff61c144b9ce8458
bjorn3 Apr 9, 2023
45eb938
Rustup to rustc 1.70.0-nightly (af06dce64 2023-04-08)
bjorn3 Apr 9, 2023
dfaeab8
Fix rustc test suite
bjorn3 Apr 9, 2023
7b83e16
Workaround bug in rustc when panicking for -Cpanic=abort
bjorn3 Jan 19, 2023
51ac381
Enable tls test on MSVC Windows
bjorn3 Feb 12, 2023
4435686
Fix warnings when building the build system in rust's CI
bjorn3 Feb 15, 2023
41866bf
Fix a couple of 2018 edition warnings
bjorn3 Feb 15, 2023
4ece6d0
Minor build perf optimization
bjorn3 Apr 13, 2023
fe3e383
Remove from cranelift too.
cjgillot Apr 11, 2023
2ead2f5
Remove #[alloc_error_handler] from the compiler and library
Amanieu Mar 22, 2023
ea641ed
Sync from rust d0f204e4d750b62f9d6c2593405e828757126832
bjorn3 Apr 17, 2023
10bdc6a
Rustup to rustc 1.71.0-nightly (d0f204e4d 2023-04-16)
bjorn3 Apr 17, 2023
22e6885
Remove WithOptconstParam.
cjgillot May 8, 2022
9dd0653
offset_of
beepster4096 Sep 11, 2022
8b229bb
Update Cranelift to 0.95.0
bjorn3 Apr 7, 2023
805c4a2
Rustup to rustc 1.71.0-nightly (8bdcc62cb 2023-04-20)
bjorn3 Apr 21, 2023
6b80e9c
Auto merge of #106934 - DrMeepster:offset_of, r=WaffleLapkin
bors Apr 22, 2023
c7155f2
Auto merge of #109507 - Amanieu:panic-oom-payload, r=davidtwco
bors Apr 22, 2023
dd172d0
Split `{Idx, IndexVec, IndexSlice}` into their own modules
WaffleLapkin Apr 19, 2023
106db3e
Fix `rustc_index` imports outside the compiler
WaffleLapkin Apr 19, 2023
b908472
Revert "Remove #[alloc_error_handler] from the compiler and library"
matthiaskrgr Apr 24, 2023
1c978ee
Sync from rust f5559e338256f17ada6d82b429acc2dbd8facc9c
bjorn3 Apr 25, 2023
669b1e3
Rustup to rustc 1.71.0-nightly (f5559e338 2023-04-24)
bjorn3 Apr 25, 2023
b56d4ab
Update portable-simd test
bjorn3 Apr 25, 2023
a7c7979
Make rustdoc using run-make tests work
bjorn3 Apr 25, 2023
c5be67b
Pass all extra args in rustc-clif before user supplied args
bjorn3 Apr 25, 2023
0c79ce3
Add two fixmes
bjorn3 Apr 25, 2023
065d81a
Lower `intrinsics::offset` to `mir::BinOp::Offset`
scottmcm Apr 25, 2023
2f624db
rename `needs_infer` to `has_infer`
BoxyUwU Apr 27, 2023
72022bb
Sync from rust f4956053816439a5884cb2ad1247835858f92218
bjorn3 Apr 29, 2023
ee3721e
Rustup to rustc 1.71.0-nightly (f49560538 2023-04-28)
bjorn3 Apr 29, 2023
517b5c1
Update Cranelift to 0.95.1
bjorn3 Apr 29, 2023
ef07e8e
Integrate better with Cranelift's profiling infrastructure
bjorn3 Feb 8, 2023
a8697f9
Merge commit 'ef07e8e60f994ec014d049a95591426fb92ebb79' into sync_cg_…
bjorn3 Apr 29, 2023
d925a53
Update list of allowed cg_clif dependencies
bjorn3 Apr 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# github-release

An action used to publish GitHub releases for `wasmtime`.

As of the time of this writing there's a few actions floating around which
perform github releases but they all tend to have their set of drawbacks.
Additionally nothing handles deleting releases which we need for our rolling
`dev` release.

To handle all this this action rolls-its-own implementation using the
actions/toolkit repository and packages published there. These run in a Docker
container and take various inputs to orchestrate the release from the build.

More comments can be found in `main.js`.

Testing this is really hard. If you want to try though run `npm install` and
then `node main.js`. You'll have to configure a bunch of env vars though to get
anything reasonably working.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: 'rustc_codegen_cranelift github releases'
description: 'rustc_codegen_cranelift github releases'
inputs:
token:
description: ''
required: true
files:
description: ''
required: true
runs:
using: 'node16'
main: 'main.js'
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

const core = require('@actions/core');
const path = require("path");
const fs = require("fs");
const github = require('@actions/github');
const glob = require('glob');

function sleep(milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}

async function runOnce() {
// Load all our inputs and env vars. Note that `getInput` reads from `INPUT_*`
const files = core.getInput('files');
const token = core.getInput('token');
const slug = process.env.GITHUB_REPOSITORY;
const owner = slug.split('/')[0];
const repo = slug.split('/')[1];
const sha = process.env.GITHUB_SHA;
let name = 'dev';
if (process.env.GITHUB_REF.startsWith('refs/tags/v')) {
name = process.env.GITHUB_REF.substring(10);
}

core.info(`files: ${files}`);
core.info(`name: ${name}`);
core.info(`token: ${token}`);

const octokit = github.getOctokit(token);

// For the `dev` release we may need to update the tag to point to the new
// commit on this branch. All other names should already have tags associated
// with them.
if (name == 'dev') {
let tag = null;
try {
tag = await octokit.request("GET /repos/:owner/:repo/git/refs/tags/:name", { owner, repo, name });
core.info(`found existing tag`);
console.log("tag: ", JSON.stringify(tag.data, null, 2));
} catch (e) {
// ignore if this tag doesn't exist
core.info(`no existing tag found`);
}

if (tag === null || tag.data.object.sha !== sha) {
core.info(`updating existing tag or creating new one`);

try {
core.info(`updating dev tag`);
await octokit.rest.git.updateRef({
owner,
repo,
ref: 'tags/dev',
sha,
force: true,
});
} catch (e) {
console.log("ERROR: ", JSON.stringify(e.data, null, 2));
core.info(`creating dev tag`);
try {
await octokit.rest.git.createRef({
owner,
repo,
ref: 'refs/tags/dev',
sha,
});
} catch (e) {
// we might race with others, so assume someone else has created the
// tag by this point.
console.log("failed to create tag: ", JSON.stringify(e.data, null, 2));
}
}

console.log("double-checking tag is correct");
tag = await octokit.request("GET /repos/:owner/:repo/git/refs/tags/:name", { owner, repo, name });
if (tag.data.object.sha !== sha) {
console.log("tag: ", JSON.stringify(tag.data, null, 2));
throw new Error("tag didn't work");
}
} else {
core.info(`existing tag works`);
}
}

// Delete a previous release
try {
core.info(`fetching release`);
let release = await octokit.rest.repos.getReleaseByTag({ owner, repo, tag: name });
console.log("found release: ", JSON.stringify(release.data, null, 2));
await octokit.rest.repos.deleteRelease({
owner,
repo,
release_id: release.data.id,
});
console.log("deleted release");
} catch (e) {
console.log("ERROR: ", JSON.stringify(e, null, 2));
}

console.log("creating a release");
let release = await octokit.rest.repos.createRelease({
owner,
repo,
tag_name: name,
prerelease: name === 'dev',
});

// Delete all assets from a previous run
for (const asset of release.data.assets) {
console.log(`deleting prior asset ${asset.id}`);
await octokit.rest.repos.deleteReleaseAsset({
owner,
repo,
asset_id: asset.id,
});
}

// Upload all the relevant assets for this release as just general blobs.
for (const file of glob.sync(files)) {
const size = fs.statSync(file).size;
const name = path.basename(file);
core.info(`upload ${file}`);
await octokit.rest.repos.uploadReleaseAsset({
data: fs.createReadStream(file),
headers: { 'content-length': size, 'content-type': 'application/octet-stream' },
name,
url: release.data.upload_url,
});
}
}

async function run() {
const retries = 10;
for (let i = 0; i < retries; i++) {
try {
await runOnce();
break;
} catch (e) {
if (i === retries - 1)
throw e;
logError(e);
console.log("RETRYING after 10s");
await sleep(10000)
}
}
}

function logError(e) {
console.log("ERROR: ", e.message);
try {
console.log(JSON.stringify(e, null, 2));
} catch (e) {
// ignore json errors for now
}
console.log(e.stack);
}

run().catch(err => {
logError(err);
core.setFailed(err.message);
});
Loading