Skip to content
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

Rollup of 9 pull requests #90952

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
07f54d9
Use "rustc" for testing Command args
ChrisDenton Aug 13, 2021
d9a1f9a
Windows: Resolve Command program without using the current directory
ChrisDenton Oct 30, 2021
7f3ffbc
std: Get the standard library compiling for wasm64
alexcrichton Oct 28, 2021
cfb2f98
Enable WebAssembly features by default on wasm64
alexcrichton Oct 28, 2021
9716388
Use `target_family = "wasm"`
alexcrichton Oct 28, 2021
f738abe
Update platform support docs
alexcrichton Oct 28, 2021
caa9e4a
Review comments
alexcrichton Nov 1, 2021
d208e19
Fix a crash with wasm64 in LLVM
alexcrichton Nov 1, 2021
d2a3c24
Update more rustc/libtest things for wasm64
alexcrichton Nov 1, 2021
a3b9405
Use more robust checks in rustc for wasm
alexcrichton Nov 1, 2021
88f1bf7
Update stdarch/compiler_builtins
alexcrichton Nov 2, 2021
b5c3f4c
Update dlmalloc for libstd
alexcrichton Nov 2, 2021
e4b3496
Update stdarch/dlmalloc
alexcrichton Nov 8, 2021
9d6f7f7
Add target documentation for wasm64-unknown-unknown
alexcrichton Nov 9, 2021
1d74c77
Update src/doc/rustc/src/platform-support.md
alexcrichton Nov 9, 2021
9a44235
Add a missing doc link
alexcrichton Nov 9, 2021
7dc3836
Disable `.debug_aranges` for all wasm targets
alexcrichton Nov 10, 2021
8d4fbc9
Add `#[inline]`s to `SortedIndexMultiMap`
JohnTitor Nov 10, 2021
c15b55a
Add Vec::retain_mut
GuillaumeGomez Nov 10, 2021
24acf86
Fix span for non-satisfied trivial trait bounds
Noratrieb Nov 13, 2021
50ec47a
Remove workaround for the forward progress handling in LLVM
andjo403 Nov 14, 2021
77b0613
Alphabetize language features
jhpratt Nov 16, 2021
2a82d1c
Suggest where feature should be placed
jhpratt Nov 16, 2021
de05d3e
Print full char literal on error if any are non-printing
5225225 Nov 13, 2021
52199c9
Suggest removing the non-printing characters
5225225 Nov 13, 2021
17b5e2d
Remove debug output from test stderr
5225225 Nov 13, 2021
09e59c2
Inline printable function
5225225 Nov 13, 2021
eee29b0
Increase tidy limit for parser by 1
5225225 Nov 16, 2021
4c32ab8
update miri
RalfJung Nov 16, 2021
2c075b1
Rollup merge of #87704 - ChrisDenton:win-resolve-exe, r=yaahc
matthiaskrgr Nov 16, 2021
ad98c87
Rollup merge of #90382 - alexcrichton:wasm64-libstd, r=joshtriplett
matthiaskrgr Nov 16, 2021
55cfe6c
Rollup merge of #90772 - GuillaumeGomez:vec-retain-mut, r=joshtriplett
matthiaskrgr Nov 16, 2021
82b2504
Rollup merge of #90787 - JohnTitor:inline-sorted-index-map, r=oli-obk
matthiaskrgr Nov 16, 2021
a661ce7
Rollup merge of #90861 - 5225225:nonprinting-char, r=davidtwco
matthiaskrgr Nov 16, 2021
c0b9273
Rollup merge of #90884 - Nilstrieb:fix-span-trivial-trait-bound, r=es…
matthiaskrgr Nov 16, 2021
e92e861
Rollup merge of #90900 - andjo403:removeLlvm12Check, r=nikic
matthiaskrgr Nov 16, 2021
93529f8
Rollup merge of #90935 - jhpratt:alphabetize-features, r=joshtriplett
matthiaskrgr Nov 16, 2021
e878e6d
Rollup merge of #90949 - RalfJung:miri, r=RalfJung
matthiaskrgr Nov 16, 2021
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
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,9 @@ dependencies = [

[[package]]
name = "compiler_builtins"
version = "0.1.49"
version = "0.1.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20b1438ef42c655665a8ab2c1c6d605a305f031d38d9be689ddfef41a20f3aa2"
checksum = "b6591c2442ee984e2b264638a8b5e7ae44fd47b32d28e3a08e2e9c3cdb0c2fb0"
dependencies = [
"cc",
"rustc-std-workspace-core",
Expand Down Expand Up @@ -1028,9 +1028,9 @@ dependencies = [

[[package]]
name = "dlmalloc"
version = "0.2.1"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "332570860c2edf2d57914987bf9e24835425f75825086b6ba7d1e6a3e4f1f254"
checksum = "a6fe28e0bf9357092740362502f5cc7955d8dc125ebda71dec72336c2e15c62e"
dependencies = [
"compiler_builtins",
"libc",
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
extended_asm.add_input_operand(None, "r", result.llval);
extended_asm.add_clobber("memory");
extended_asm.set_volatile_flag(true);

// We have copied the value to `result` already.
return;
}
Expand Down Expand Up @@ -363,10 +363,6 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
cond
}

fn sideeffect(&mut self) {
// TODO(antoyo)
}

fn type_test(&mut self, _pointer: Self::Value, _typeid: Self::Value) -> Self::Value {
// Unsupported.
self.context.new_rvalue_from_int(self.int_type, 0)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
InlineAsmArch::Mips | InlineAsmArch::Mips64 => {}
InlineAsmArch::S390x => {}
InlineAsmArch::SpirV => {}
InlineAsmArch::Wasm32 => {}
InlineAsmArch::Wasm32 | InlineAsmArch::Wasm64 => {}
InlineAsmArch::Bpf => {}
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
// we like. To ensure that LLVM picks the right instruction we choose
// the raw wasm intrinsic functions which avoid LLVM inserting all the
// other control flow automatically.
if self.sess().target.arch == "wasm32" {
if self.sess().target.is_like_wasm {
let src_ty = self.cx.val_ty(val);
if self.cx.type_kind(src_ty) != TypeKind::Vector {
let float_width = self.cx.float_width(src_ty);
Expand All @@ -791,7 +791,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {

fn fptosi(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
// see `fptoui` above for why wasm is different here
if self.sess().target.arch == "wasm32" {
if self.sess().target.is_like_wasm {
let src_ty = self.cx.val_ty(val);
if self.cx.type_kind(src_ty) != TypeKind::Vector {
let float_width = self.cx.float_width(src_ty);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ impl StaticMethods for CodegenCx<'ll, 'tcx> {

// Wasm statics with custom link sections get special treatment as they
// go into custom sections of the wasm executable.
if self.tcx.sess.opts.target_triple.triple().starts_with("wasm32") {
if self.tcx.sess.target.is_like_wasm {
if let Some(section) = attrs.link_section {
let section = llvm::LLVMMDStringInContext(
self.llcx,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ impl CodegenCx<'b, 'tcx> {
ifn!("llvm.trap", fn() -> void);
ifn!("llvm.debugtrap", fn() -> void);
ifn!("llvm.frameaddress", fn(t_i32) -> i8p);
ifn!("llvm.sideeffect", fn() -> void);

ifn!("llvm.powi.f32", fn(t_f32, t_i32) -> t_f32);
ifn!("llvm.powi.f64", fn(t_f64, t_i32) -> t_f64);
Expand Down
9 changes: 0 additions & 9 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,6 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
self.call_intrinsic("llvm.expect.i1", &[cond, self.const_bool(expected)])
}

fn sideeffect(&mut self) {
// This kind of check would make a ton of sense in the caller, but currently the only
// caller of this function is in `rustc_codegen_ssa`, which is agnostic to whether LLVM
// codegen backend being used, and so is unable to check the LLVM version.
if unsafe { llvm::LLVMRustVersionMajor() } < 12 {
self.call_intrinsic("llvm.sideeffect", &[]);
}
}

fn type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value {
// Test the called operand using llvm.type.test intrinsic. The LowerTypeTests link-time
// optimization pass replaces calls to this intrinsic with code to test type membership.
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ unsafe fn configure_llvm(sess: &Session) {
if sess.print_llvm_passes() {
add("-debug-pass=Structure", false);
}
if !sess.opts.debugging_opts.no_generate_arange_section {
if sess.target.generate_arange_section
&& !sess.opts.debugging_opts.no_generate_arange_section
{
add("-generate-arange-section", false);
}

Expand Down
11 changes: 0 additions & 11 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,17 +980,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
}

mir::TerminatorKind::Goto { target } => {
if bb == target {
// This is an unconditional branch back to this same basic block. That means we
// have something like a `loop {}` statement. LLVM versions before 12.0
// miscompile this because they assume forward progress. For older versions
// try to handle just this specific case which comes up commonly in practice
// (e.g., in embedded code).
//
// NB: the `sideeffect` currently checks for the LLVM version used internally.
bx.sideeffect();
}

helper.funclet_br(self, &mut bx, target);
}

Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_ssa/src/traits/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ pub trait IntrinsicCallMethods<'tcx>: BackendTypes {
fn abort(&mut self);
fn assume(&mut self, val: Self::Value);
fn expect(&mut self, cond: Self::Value, expected: bool) -> Self::Value;
/// Emits a forced side effect.
///
/// Currently has any effect only when LLVM versions prior to 12.0 are used as the backend.
fn sideeffect(&mut self);
/// Trait method used to test whether a given pointer is associated with a type identifier.
fn type_test(&mut self, pointer: Self::Value, typeid: Self::Value) -> Self::Value;
/// Trait method used to inject `va_start` on the "spoofed" `VaListImpl` in
Expand Down
10 changes: 10 additions & 0 deletions compiler/rustc_data_structures/src/sorted_map/index_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,47 @@ pub struct SortedIndexMultiMap<I: Idx, K, V> {
}

impl<I: Idx, K: Ord, V> SortedIndexMultiMap<I, K, V> {
#[inline]
pub fn new() -> Self {
SortedIndexMultiMap { items: IndexVec::new(), idx_sorted_by_item_key: Vec::new() }
}

#[inline]
pub fn len(&self) -> usize {
self.items.len()
}

#[inline]
pub fn is_empty(&self) -> bool {
self.items.is_empty()
}

/// Returns an iterator over the items in the map in insertion order.
#[inline]
pub fn into_iter(self) -> impl DoubleEndedIterator<Item = (K, V)> {
self.items.into_iter()
}

/// Returns an iterator over the items in the map in insertion order along with their indices.
#[inline]
pub fn into_iter_enumerated(self) -> impl DoubleEndedIterator<Item = (I, (K, V))> {
self.items.into_iter_enumerated()
}

/// Returns an iterator over the items in the map in insertion order.
#[inline]
pub fn iter(&self) -> impl '_ + DoubleEndedIterator<Item = (&K, &V)> {
self.items.iter().map(|(ref k, ref v)| (k, v))
}

/// Returns an iterator over the items in the map in insertion order along with their indices.
#[inline]
pub fn iter_enumerated(&self) -> impl '_ + DoubleEndedIterator<Item = (I, (&K, &V))> {
self.items.iter_enumerated().map(|(i, (ref k, ref v))| (i, (k, v)))
}

/// Returns the item in the map with the given index.
#[inline]
pub fn get(&self, idx: I) -> Option<&(K, V)> {
self.items.get(idx)
}
Expand All @@ -75,6 +83,7 @@ impl<I: Idx, K: Ord, V> SortedIndexMultiMap<I, K, V> {
///
/// If there are multiple items that are equivalent to `key`, they will be yielded in
/// insertion order.
#[inline]
pub fn get_by_key(&'a self, key: K) -> impl 'a + Iterator<Item = &'a V> {
self.get_by_key_enumerated(key).map(|(_, v)| v)
}
Expand All @@ -84,6 +93,7 @@ impl<I: Idx, K: Ord, V> SortedIndexMultiMap<I, K, V> {
///
/// If there are multiple items that are equivalent to `key`, they will be yielded in
/// insertion order.
#[inline]
pub fn get_by_key_enumerated(&'a self, key: K) -> impl '_ + Iterator<Item = (I, &V)> {
let lower_bound = self.idx_sorted_by_item_key.partition_point(|&i| self.items[i].0 < key);
self.idx_sorted_by_item_key[lower_bound..].iter().map_while(move |&i| {
Expand Down
Loading