Commit Graph

191 Commits

Author SHA1 Message Date
Alex Crichton b9024f8a75 rustc: Stabilize #[wasm_import_module] as #[link(...)]
This commit stabilizes the `#[wasm_import_module]` attribute as
`#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in
the `#[link]` attribute is used to configured the module name that the imports
are listed with. The WebAssembly specification indicates two utf-8 names are
associated with all imported items, one for the module the item comes from and
one for the item itself. The item itself is configurable in Rust via its
identifier or `#[link_name = "..."]`, but the module name was previously not
configurable and defaulted to `"env"`. This commit ensures that this is also
configurable.

Closes #52090
2018-07-18 07:50:08 -07:00
Alex Crichton b7ef674832 rustc: Use link_section, not wasm_custom_section
This commit transitions definitions of custom sections on the wasm target from
the unstable `#[wasm_custom_section]` attribute to the
already-stable-for-other-targets `#[link_section]` attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes #51088
2018-07-16 09:40:45 -07:00
csmoe 5b0cf56f32 ItemKind 2018-07-16 15:09:17 +02:00
csmoe 7e5d224472 ForeignItemKind 2018-07-16 15:09:17 +02:00
csmoe fe8955bd58 BinOpKind 2018-07-16 15:09:16 +02:00
Michael Woerister d992090a70 Revert "Provide a way of accessing the ThinLTO module import map in rustc."
This reverts commit 9df56ca0ee.
2018-07-16 08:59:10 +02:00
Michael Woerister 5c0110f44b Revert "Persist ThinLTO import data in incr. comp. session directory."
This reverts commit 8dc7ddb976.
2018-07-16 08:58:56 +02:00
Michael Woerister 0830cc92bd Revert "Clean up LLVM module naming (just use CodegenUnit names)."
This reverts commit f6894ebe66.
2018-07-16 08:58:29 +02:00
Michael Woerister b822e699c3 Revert "Use callback-based interface to load ThinLTO import data into rustc."
This reverts commit e045a6cd8c.
2018-07-16 08:57:49 +02:00
bors 7afa0ccb37 Auto merge of #52381 - oli-obk:ty_to_def_id, r=eddyb
Remove `ty_to_def_id`

fixes https://github.com/rust-lang/rust/issues/52341

The uses were mostly convenience and generally "too powerful" (would also have worked for types that weren't interesting at the use site)

r? @eddyb
2018-07-15 10:29:00 +00:00
Oliver Schneider ecab96fd7c Ubsan this newly discovered dead code 2018-07-15 01:52:45 +02:00
Amanieu d'Antras 303306cf5e Add unaligned volatile intrinsics 2018-07-14 23:28:39 +01:00
Oliver Schneider 1caa593cb6 Expose a self-referential object 2018-07-14 20:34:32 +02:00
bors 84755473dc Auto merge of #52032 - DiamondLovesYou:amdgpu-kernel-abi, r=alexcrichton
Add the `amdgpu-kernel` ABI.

Technically, there are requirements imposed by the LLVM
`AMDGPUTargetMachine` on functions with this ABI (eg, the return type
must be void), but I'm unsure exactly where this should be enforced.
2018-07-14 00:12:21 +00:00
Richard Diamond 6332bb1506 Add the `amdgpu-kernel` ABI.
Technically, there are requirements imposed by the LLVM
`AMDGPUTargetMachine` on functions with this ABI (eg, the return type
must be void), but I'm unsure exactly where this should be enforced.
2018-07-13 17:22:23 -05:00
bors a14a361c2c Auto merge of #52266 - michaelwoerister:incr-thinlto-preliminaries, r=alexcrichton
Preliminary work for incremental ThinLTO.

Since implementing incremental ThinLTO is a bit more involved than I initially thought, I'm splitting out some of the things that already work. This PR (1) adds a way accessing some ThinLTO information in `rustc` and (2) does some cleanup around CGU/object file naming (which makes things quite a bit nicer).

This is probably best reviewed one commit at a time.
2018-07-13 22:06:38 +00:00
bors bce32b532d Auto merge of #51987 - nikomatsakis:nll-region-infer-scc, r=pnkfelix
nll experiment: compute SCCs instead of iterative region solving

This is an attempt to speed up region solving by replacing the current iterative dataflow with a SCC computation. The idea is to detect cycles (SCCs) amongst region constraints and then compute just one value per cycle. The graph with all cycles removed is of course a DAG, so we can then solve constraints "bottom up" once the liveness values are known.

I kinda ran out of time this morning so the last commit is a bit sloppy but I wanted to get this posted, let travis run on it, and maybe do a perf run, before I clean it up.
2018-07-13 13:28:55 +00:00
Michael Woerister e045a6cd8c Use callback-based interface to load ThinLTO import data into rustc. 2018-07-13 12:41:22 +02:00
Niko Matsakis 90c90ba542 rename `control_flow_graph` to `graph` 2018-07-12 00:38:40 -04:00
bors 3244d53c79 Auto merge of #52089 - eddyb:issue-51907, r=nagisa
rustc_codegen_llvm: replace the first argument early in FnType::new_vtable.

Fixes #51907 by removing the vtable pointer before the `ArgType` is even created.
This allows any ABI to support trait object method calls, regardless of how it passes `*dyn Trait`.

r? @nikomatsakis
2018-07-12 01:20:19 +00:00
Michael Woerister f6894ebe66 Clean up LLVM module naming (just use CodegenUnit names). 2018-07-11 21:54:43 +02:00
Mark Rousskov dcc536fc14
Rollup merge of #52252 - ljedrz:dyn_librustc_codegen_llvm, r=varkor
Deny bare trait objects in in src/librustc_codegen_llvm

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_codegen_llvm`.
2018-07-11 12:38:44 -06:00
Michael Woerister 8dc7ddb976 Persist ThinLTO import data in incr. comp. session directory. 2018-07-11 17:52:57 +02:00
Michael Woerister 9df56ca0ee Provide a way of accessing the ThinLTO module import map in rustc. 2018-07-11 17:51:36 +02:00
bors 11432ba980 Auto merge of #51230 - nikic:no-verify-lto, r=pnkfelix
Disable LLVM verification by default

Currently -Z no-verify only controls IR verification prior to LLVM codegen, while verification is performed unconditionally both before and after linking with (Thin)LTO.

Also wondering what the sentiment is on disabling verification by default (and e.g. only enabling it on ALT builds with assertions). This does not seem terribly useful outside of rustc development and it does seem to show up in profiles (at something like 3%).

**EDIT:** A table showing the various configurations and what is enabled when.

| Configuration | Dynamic verification performed | LLVM static assertions compiled in |
| --- | --- | --- |
| alt builds | | yes |
| nightly builds | | no |
| stable builds | | no |
| CI builds | | |
| dev builds in a checkout | | |
2018-07-11 12:12:13 +00:00
ljedrz ea473502f3 Deny bare trait objects in in src/librustc_codegen_llvm 2018-07-11 12:49:11 +02:00
bors ae5b629efd Auto merge of #51966 - alexcrichton:llvm7, r=michaelwoerister
Upgrade to LLVM's master branch (LLVM 7)

### Current status

~~Blocked on a [performance regression](https://github.com/rust-lang/rust/pull/51966#issuecomment-402320576). The performance regression has an [upstream LLVM issue](https://bugs.llvm.org/show_bug.cgi?id=38047) and has also [been bisected](https://reviews.llvm.org/D44282) to an LLVM revision.~~

Ready to merge!

---

This commit upgrades the main LLVM submodule to LLVM's current master branch.
The LLD submodule is updated in tandem as well as compiler-builtins.

Along the way support was also added for LLVM 7's new features. This primarily
includes the support for custom section concatenation natively in LLD so we now
add wasm custom sections in LLVM IR rather than having custom support in rustc
itself for doing so.

Some other miscellaneous changes are:

* We now pass `--gc-sections` to `wasm-ld`
* The optimization level is now passed to `wasm-ld`
* A `--stack-first` option is passed to LLD to have stack overflow always cause
  a trap instead of corrupting static data
* The wasm target for LLVM switched to `wasm32-unknown-unknown`.
* The syntax for aligned pointers has changed in LLVM IR and tests are updated
  to reflect this.
* ~~The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug]~~

Nowadays we've been mostly only upgrading whenever there's a major release of
LLVM but enough changes have been happening on the wasm target that there's been
growing motivation for quite some time now to upgrade out version of LLD. To
upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet
another version of LLVM on the builders.

The revision of LLVM in use here is arbitrarily chosen. We will likely need to
continue to update it over time if and when we discover bugs. Once LLVM 7 is
fully released we can switch to that channel as well.

[llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382

cc #50543
2018-07-11 07:20:14 +00:00
Guillaume Gomez aa9ee687f3
Rollup merge of #52171 - bharrisau:fsub-count, r=estebank
Correct some codegen stats counter inconsistencies

I noticed some possible typos/inconsistencies in the codegen counters. For example, `fsub` was getting counted as an integer `sub`, whereas `fadd` was counted as an add. And `addincoming` was only being counted on the initial call.

dbd10f8175/src/librustc_codegen_llvm/builder.rs (L831-L841)

Only remaining inconsistencies I can see are things like `fadd_fast` are counted as `fadd`. But the vector versions like `vector_reduce_fmax_fast` are counted as `vector.reduce.fmax_fast` not as their 'base' versions (`vector_reduce_fmax` is counted as `vector.reduce.fmax`).
2018-07-10 22:56:42 +02:00
Alex Crichton 42eb85002a Upgrade to LLVM's master branch (LLVM 7)
This commit upgrades the main LLVM submodule to LLVM's current master branch.
The LLD submodule is updated in tandem as well as compiler-builtins.

Along the way support was also added for LLVM 7's new features. This primarily
includes the support for custom section concatenation natively in LLD so we now
add wasm custom sections in LLVM IR rather than having custom support in rustc
itself for doing so.

Some other miscellaneous changes are:

* We now pass `--gc-sections` to `wasm-ld`
* The optimization level is now passed to `wasm-ld`
* A `--stack-first` option is passed to LLD to have stack overflow always cause
  a trap instead of corrupting static data
* The wasm target for LLVM switched to `wasm32-unknown-unknown`.
* The syntax for aligned pointers has changed in LLVM IR and tests are updated
  to reflect this.
* The `thumbv6m-none-eabi` target is disabled due to an [LLVM bug][llbug]

Nowadays we've been mostly only upgrading whenever there's a major release of
LLVM but enough changes have been happening on the wasm target that there's been
growing motivation for quite some time now to upgrade out version of LLD. To
upgrade LLD, however, we need to upgrade LLVM to avoid needing to build yet
another version of LLVM on the builders.

The revision of LLVM in use here is arbitrarily chosen. We will likely need to
continue to update it over time if and when we discover bugs. Once LLVM 7 is
fully released we can switch to that channel as well.

[llbug]: https://bugs.llvm.org/show_bug.cgi?id=37382
2018-07-10 13:43:01 -07:00
bors b3e7d70ce7 Auto merge of #51583 - cuviper:packed_pair-bool, r=Mark-Simulacrum
Store scalar pair bools as i8 in memory

We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates,
to optimize IR for checked operators and the like.  With this patch, we
still do so when the pair is an immediate value, but we use the `i8`
memory type when the value is loaded or stored as an LLVM aggregate.

So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }`
in memory.  When a pair is a direct function argument, `PassMode::Pair`,
it is still passed using the immediate `i1` type, but as a return value
it will use the `i8` memory type.  Also, `bool`-like` enum tags will now
use scalar pairs when possible, where they were previously excluded due
to optimization issues.

Fixes #51516.
Closes #51566.

r? @eddyb
cc @nox
2018-07-10 03:08:47 +00:00
gnzlbg 4ff90c7e0a bump minimum LLVM version to 5.0 2018-07-09 11:35:52 +02:00
Ben Harris aac0d914b2 Correct some codegen stats counters 2018-07-09 09:40:16 +02:00
bors 9342f293e9 Auto merge of #51590 - bjorn3:codegen_llvm_extract, r=alexcrichton
Mostly fix metadata_only backend and extract some code out of rustc_codegen_llvm

Removes dependency on the `ar` crate and removes the `llvm.enabled` config option in favour of setting `rust.codegen-backends` to `[]`.
2018-07-08 00:52:36 +00:00
bors e44906e80c Auto merge of #52109 - michaelwoerister:ir-objs, r=alexcrichton
When doing linker-plugin based LTO, write LLVM bitcode obj-files instead of embedding the bitcode into the regular object file.

This PR makes the compiler emit LLVM bitcode object files instead of regular object files with the IR embed when compiling for linker-plugin-based LTO. The reasoning for switching the strategy is this:
- Embedding bitcode in a section of the object file actually makes us save bitcode twice in rlibs and Rust dylibs, once for linker-based LTO and once for rustc-based LTO. That's a waste of space.
- When compiling for plugin-based LTO, one usually has no use for the machine code also present in the object file. Generating it is a waste of time.
- When compiling for plugin-based LTO, `rustc` will skip running ThinLTO because the linker will do that anyway. This has the side effect of then generating poorly optimized machine code, which makes it even less useful (and may lead to users not knowing why their code is slow instead of getting an error).
- Not having machine code available makes it impossible for the linker to silently fall back to not inlining stuff across language boundaries.
- This is what Clang does and according to [the documentation](https://llvm.org/docs/BitCodeFormat.html#native-object-file-wrapper-format) is the better supported option.
- The current behavior (minus the runtime performance problems) is still available via `-Z embed-bitcode` (we might want to do this for `libstd` at some point).

r? @alexcrichton
2018-07-07 14:09:49 +00:00
bjorn3 c7c534fa0e Move llvm_target_features back to llvm_util 2018-07-07 10:55:47 +02:00
bjorn3 c504d26c1c Move time_graph.rs to rustc/util 2018-07-07 10:52:31 +02:00
bjorn3 c5a6b51e44 Update Cargo.lock and move size_and_align_of_dst back 2018-07-07 10:52:29 +02:00
bjorn3 f44ec6439b Undo unnecessary change 2018-07-07 10:51:54 +02:00
bjorn3 edd6ed571f Fix some errors 2018-07-07 10:51:54 +02:00
bjorn3 6ceb1637b2 Move some functions out of rustc_codegen_llvm and fix metadata_only backend 2018-07-07 10:47:22 +02:00
Jorge Aparicio b7047bb89f ARM: expose the "mclass" target feature 2018-07-06 18:28:38 -05:00
Michael Woerister 4a269642c9 Remove CrossLangLto::NoLink which does not have a use case anymore. 2018-07-06 14:08:40 +02:00
Michael Woerister 72df804d8e When doing linker-plugin based LTO, write LLVM bitcode obj-files
instead of embedding the bitcode into the regular object file.
2018-07-06 13:58:25 +02:00
kennytm 3c21349e07
Rollup merge of #52055 - crlf0710:patch-3, r=Mark-Simulacrum
Include VS 2017 in error message.

Update error prompt message to indicate that VS 2017 is supported (for a while now).
2018-07-06 12:56:26 +08:00
kennytm ffc453abf7
Rollup merge of #52019 - michaelwoerister:cross-lto-auto-plugin, r=alexcrichton
[cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD)

This PR allows for not specifying an LTO-linker plugin but still let `rustc` invoke the linker with the correct plugin arguments. This is useful when using LLD which does not need the `-plugin` argument. Since LLD is the best linker for this scenario anyway, this change should improve ergonomics quite a bit.

r? @alexcrichton
2018-07-06 08:49:20 +08:00
Josh Stone 557736befc Update scalar pairs per review comments 2018-07-05 14:22:09 -07:00
Eduard-Mihai Burtescu ce94518ed3 rustc_codegen_llvm: replace the first argument early in FnType::new_vtable. 2018-07-06 00:17:13 +03:00
Josh Stone e578976560 Store scalar pair bools as i8 in memory
We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates,
to optimize IR for checked operators and the like.  With this patch, we
still do so when the pair is an immediate value, but we use the `i8`
memory type when the value is loaded or stored as an LLVM aggregate.

So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }`
in memory.  When a pair is a direct function argument, `PassMode::Pair`,
it is still passed using the immediate `i1` type, but as a return value
it will use the `i8` memory type.  Also, `bool`-like` enum tags will now
use scalar pairs when possible, where they were previously excluded due
to optimization issues.
2018-07-05 09:59:52 -07:00
CrLF0710 30063ae2a5
Shorten the line
Shorten the line to make tidy happy.
2018-07-04 23:36:51 +08:00
CrLF0710 1dae60ea4c
Include VS 2017 in error message.
Update error prompt message to indicate that VS 2017 is supported (for a while now).
2018-07-04 22:49:35 +08:00
Michael Woerister 65ff4141a5 Allow the linker to choose the LTO-plugin (which is useful when using LLD) 2018-07-03 16:33:11 +02:00
Pietro Albini b69058daa6
Rollup merge of #51982 - michaelwoerister:hash-modules-properly, r=nikomatsakis
incr.comp.: Take names of children into account when computing the ICH of a module's HIR.

Fixes #40876. Red-green tracking does not make this a problem anymore. We should verify this via a perf-run though.

r? @nikomatsakis
2018-07-03 11:31:10 +02:00
Michael Woerister 79d8d087a3 incr.comp.: Take names of children into account when computing the ICH of a module's HIR. 2018-07-02 16:21:34 +02:00
est31 3779a4cb74 Emit column info in debuginfo for non msvc like targets 2018-07-02 12:16:05 +02:00
bors 96b47337d9 Auto merge of #51828 - kennytm:no-simd-swap-for-mac, r=alexcrichton
Do not allow LLVM to increase a TLS's alignment on macOS.

This addresses the various TLS segfault on macOS 10.10.

Fix #51794.
Fix #51758.
Fix #50867.
Fix #48866.
Fix #46355.
Fix #44056.
2018-06-30 14:00:24 +00:00
kennytm e3d113eca9
Do not allow LLVM to increase a TLS's alignment on macOS. 2018-06-30 21:36:03 +08:00
Vadim Petrochenkov 9f92fce77c Fortify dummy span checking 2018-06-30 01:53:32 +03:00
Oliver Schneider 4bb9648b27 Merge `ConstVal` and `ConstValue` 2018-06-28 11:04:25 +02:00
Oliver Schneider 05994779ea Move everything over from `middle::const_val` to `mir::interpret` 2018-06-28 11:02:31 +02:00
Oliver Schneider 6005b0ad2f Move the Lrc outside the error type and name the fields 2018-06-28 11:01:35 +02:00
John Kåre Alsaker 14d3c6e8f4 Make opaque::Encoder append-only and make it infallible 2018-06-27 11:43:15 +02:00
varkor 82803fd9bd Add backticks to E0558 2018-06-24 00:16:10 +01:00
kennytm a39d93d899
Rollup merge of #51666 - marco-c:disable_probestack, r=nagisa
Disable probestack when GCOV profiling is being used

If I compile Firefox with gcov profiling enabled, Firefox crashes at startup because of probestack.
Since it's disabled for PGO, I think it makes sense to disable it for gcov too.
2018-06-22 16:50:44 +08:00
Marco Castelluccio e9aacfd5c1 Disable probestack when GCOV profiling is being used 2018-06-20 22:07:55 +01:00
Bastien Orivel c863049225 Fix tidy 2018-06-20 19:28:27 +02:00
Bastien Orivel 677eeaaa61 Replace tempdir by tempfile in librustc_trans 2018-06-20 19:28:27 +02:00
bors fc19590297 Auto merge of #51248 - fabric-and-ink:newtype_index_debrujin, r=nikomatsakis
Declare DebruijnIndex via newtype_index macro

Part of #49887

Declare `DebruijnIndex` via the `newtype_index` macro.
2018-06-18 23:14:50 +00:00
bors ae46aefd5b Auto merge of #51594 - eddyb:issue-51582, r=nagisa
rustc_codegen_llvm: don't treat i1 as signed, even for #[repr(i8)] enums.

Fixes #51582. r? @nagisa cc @nox @oli-obk
2018-06-16 21:48:31 +00:00
Eduard-Mihai Burtescu 25c47a4885 rustc_codegen_llvm: don't treat i1 as signed, even for #[repr(i8)] enums. 2018-06-16 16:00:53 +03:00
Fabian Drinck 0ad3600700 Declare DebruijnIndex via newtype_index macro 2018-06-14 18:44:36 +02:00
Eduard-Mihai Burtescu 5a5c7ded0d rustc: rename ty::maps to ty::query. 2018-06-14 18:05:12 +03:00
Nikita Popov 22cf833dd1 Rename -Z no-verify to -Z verify-llvm-ir
This disables IR verification by default.
2018-06-12 21:23:06 +02:00
Nikita Popov 78a16443a3 Respect -Z no-verify during LTO
Currently -Z no-verify only controls IR verification prior to
LLVM codegen, while verification is performed unconditionally
both before and after linking with (Thin)LTO.
2018-06-12 20:50:21 +02:00
Oliver Schneider 5c0d1355f2 Refactor the const eval diagnostic API 2018-06-05 20:49:46 +02:00
Mark Simulacrum e7ae1b2648
Rollup merge of #51323 - nikic:switch-int-lowering, r=nagisa
Generate br for all two target SwitchInts

Instead of only for booleans. This means that `if let` also becomes a br.

Apart from making the IR slightly simpler, this is supported by FastISel (#4353).
2018-06-03 18:18:05 -06:00
Nikita Popov 4f4f7dfc00 Generate br for all two target SwitchInts
Instead of only for booleans. This means that if let also becomes
a br.

Apart from making the IR slightly simpler, this is supported by
FastISel.
2018-06-02 22:21:01 +02:00
bors 4ecf12bf0e Auto merge of #51063 - mixi:musl-bootstrap, r=alexcrichton
Fix building rustc on and for musl hosts.

This fixes all problems I had when trying to compile rustc on a musl-based distribution (with `crt-static = false` in `config.toml`).

This is a fixed version of what ended up being #50105, making it possible to compile rustc on musl targets.

The differences to the old (now merged and subsequently reverted) pull request are:
 - The commit (6d9154a830) that caused the regression for which the original commits were reverted in #50709 is left out. This means the corresponding bug #36710 is still not fixed with `+crt-static`.
 - The test for issue 36710 is skipped for musl targets (until the issue is properly fixed).
 - Building cargo-vendor if `crt-static = false` is needed was broken (cargo-vendor links to some shared libraries if they exist on the system and this produces broken binaries with `+crt-static`)

CC @alexcrichton
2018-06-02 15:26:26 +00:00
Johannes Nixdorf bf3b8df697 musl: don't use the included startfiles with -crt-static
This fixes (only for -crt-static) #36710.
2018-05-31 12:01:50 +02:00
Eduard-Mihai Burtescu 06d88cda08 rustc: rename mir::LocalDecl's syntactic_source_info to source_info. 2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu 6c53972478 rustc: turn mir::LocalDecl's visibility_source_info into a SourceScope. 2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu 0895590c53 rustc: rename mir::LocalDecl's source_info to visibility_source_info. 2018-05-30 20:30:10 +03:00
Eduard-Mihai Burtescu 85d44c4276 rustc: rename mir::VisibilityScope to mir::SourceScope. 2018-05-30 20:30:09 +03:00
Felix S. Klock II 24abe6f363 rust-lang/rust#27282: Add `StatementKind::ReadForMatch` to MIR.
(This is just the data structure changes and some boilerplate match
code that followed from it; the actual emission of these statements
comes in a follow-up commit.)
2018-05-29 23:01:36 +02:00
bors 5ae5361cdd Auto merge of #50475 - csmoe:debr, r=nikomatsakis
Refactor DebruijnIndex to be 0-based

Fixes #49813
2018-05-29 01:11:24 +00:00
Niko Matsakis 8bd4bffe50 stop invoking `DebruijnIndex::new` directly
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
2018-05-28 19:47:04 -04:00
bors 2612bbcba0 Auto merge of #50521 - gnzlbg:simd_float, r=alexcrichton
Add simd math intrinsics and gather/scatter

This PR adds simd math intrinsics for floating-point vectors (sqrt, sin, cos, pow, exp, log, fma, abs, etc.) and the generic simd gather/scatter intrinsics.
2018-05-28 16:54:44 +00:00
bors 1e504d301c Auto merge of #51072 - petrochenkov:ifield, r=eddyb
Use `Ident`s for fields in HIR

Continuation of https://github.com/rust-lang/rust/pull/49718, part of https://github.com/rust-lang/rust/issues/49300
2018-05-26 16:56:22 +00:00
Vadim Petrochenkov 189c0a1297 Use `Ident`s for fields in HIR 2018-05-26 14:41:58 +03:00
bors b4247d45a5 Auto merge of #51041 - alexcrichton:better-unwind, r=nikomatsakis
std: Ensure OOM is classified as `nounwind`

OOM can't unwind today, and historically it's been optimized as if it can't
unwind. This accidentally regressed with recent changes to the OOM handler, so
this commit adds in a codegen test to assert that everything gets optimized away
after the OOM function is approrpiately classified as nounwind

Closes #50925
2018-05-26 09:59:43 +00:00
bors 67d99d91e5 Auto merge of #51035 - oli-obk:unsupported_crate_type, r=eddyb
Don't ICE if crate has no valid crate types left

fixes #50993
2018-05-26 03:22:39 +00:00
Alex Crichton f67453729c std: Ensure OOM is classified as `nounwind`
OOM can't unwind today, and historically it's been optimized as if it can't
unwind. This accidentally regressed with recent changes to the OOM handler, so
this commit adds in a codegen test to assert that everything gets optimized away
after the OOM function is approrpiately classified as nounwind

Closes #50925
2018-05-24 12:03:05 -07:00
Oliver Schneider fb9060ac06 Revert "Ensure llvm doesn't trigger an assert for crazy transmutes"
This reverts commit 776c632e2a9a044fd134321a9d561e28994ff3ff.
2018-05-24 20:49:38 +02:00
Oliver Schneider ca8c27e1c1 Ensure llvm doesn't trigger an assert for crazy transmutes 2018-05-24 20:49:38 +02:00
Oliver Schneider c420531304 Replace `ScalarKind` with `Primitive` 2018-05-24 20:49:37 +02:00
Oliver Schneider f82256e473 primval -> scalar rename 2018-05-24 20:49:37 +02:00
Oliver Schneider 64a75ecc80 change `Value::Bytes` to `Value::Bits` 2018-05-24 20:49:37 +02:00
Oliver Schneider d7324631ae Rename MemoryPointer to Pointer 2018-05-24 20:48:54 +02:00
Oliver Schneider 03a92b61ec Eliminate the `Pointer` wrapper type 2018-05-24 20:48:13 +02:00
Oliver Schneider 6436de89fe Differentiate between interpret::Scalar and layout::Scalar 2018-05-24 20:47:35 +02:00
Oliver Schneider ef2177cffc Rename ByVal(Pair) to Scalar(Pair) 2018-05-24 20:47:35 +02:00