Commit Graph
766 Commits
Author SHA1 Message Date
Jeremy Rifkin 8c1c3eab2a Add Wyrm transpiler (#6028)
https://github.com/compiler-explorer/compiler-workflows/pull/22
https://github.com/compiler-explorer/infra/pull/1218
https://github.com/compiler-explorer/misc-builder/pull/76

Depends on #6027
2024-01-21 10:43:20 -06:00
Jeremy Rifkin e5fb8e1afc Improve typings for the now-global HandlerConfig (#6027)
This PR populates types in the HandlerConfig
2024-01-21 10:29:58 -06:00
Patrick Quist 76e185b3d7 Dex2oat error handling and fixes (#6022) 2024-01-20 17:15:13 +01:00
Jeremy dab53cb916 Fix opt output to highlight as llvm ir rather than asm 2024-01-16 20:23:40 -06:00
Ofek 5b9af2f7b6 Fix #5987: make rustc generate *only* IR output in generateIR (#5988)
All compilations run asynchronously under `await Promise.all` in
`BaseCompiler.doCompilation`:

https://github.com/compiler-explorer/compiler-explorer/blob/f3277b8aed2ca12ce961d08ef792c4061a3331ac/lib/base-compiler.ts#L2256-L2263

ASM and MIR processing is done from the main `runCompiler` and IR from
the auxiliary `generateIR`. But both compilation calls are passed the
same `options` - which include `--emit asm` for generation of `output.s`
assembly file and `--emit mir=...` for generation of MIR file. So these
2 identically-named file pairs are generated *and cleaned up* in both of
the parallel compilations, sometimes one compilation cleans up its
output before the other one tries to process its own, and mayhem ensues.

This PR makes rust's `generateIR` indeed generate *just* IR by filtering
switches.

From a design perspective: ideally CE would be more opinionated on which
outputs are generated on the main compilation and which on auxiliary
ones. I see no reason for MIR to be generated by an additional switch on
the main compilation and IR require a different compilation (there's
also something called `generateRustHir` - I don't know what it does and
am slightly afraid to ask).
I *think* most (all?) asm/IR outputs could be generated in a single main
compilation, and just post-processed for the different panes in parallel
- which could spell very good news also for servers load. But I don't
dare say anything categorical about *all* languages, compilers and
output (probably no one does). Would be happy to hear opinions.
(Anyway that's just for sake of discussion, this PR does nothing fancy
of that sort)
2024-01-16 07:27:06 +02:00
kevinjeon-g 2f6a7328b2 Add support for dex2oat (latest) (#5916)
Adds Dex2OatCompiler, which applies to the Android Java and Android
Kotlin languages. Dex2OatCompiler runs on .dex files output by
D8Compiler, which in turn runs on .class files output by JavaCompiler or
KotlinCompiler. A parser has been added for dex2oat optimization passes.
2024-01-15 15:15:05 -06:00
Ofek 696cc79133 Fix #5630: filter out --emit mir=.. in RustCompiler.buildExecutable (#5991)
With a small added ts'ification in base-compiler.
2024-01-13 22:34:39 +02:00
Ofek 21fe5523c0 Since ES6 there's no reason to use underscores map and filter (#5989)
Mindless replacements of the form 
`_.filter(options, option =>...`  --> `options.filter(option =>...`.

One not *entirely* mindless replacement at the bottom of
compiler-dropin-tool.ts :
```
-        return _.filter(pathFilteredFlags) as string[];
+        return pathFilteredFlags.filter(Boolean) as string[];
```
6 files can now stop importing underscore.
2024-01-13 18:35:11 +02:00
Ofek b9c23122be Fix a leftover case of bad file-extension replacement in rust (#5981)
Seems I missed this one when doing PR #5700. This caused *some* of the
grief mentioned in the discussion of issue #5667, but certainly not all
of it.
2024-01-12 22:29:54 +02:00
Ofek 2b917c98a9 Stop forcing debug builds in pony (#5979)
Following the discussion in #3864.

@RossSmyth  FYI
2024-01-12 18:04:23 +02:00
Ofek f2956cdce7 Fix3864: pony created an .ll file that processIrOutput didn't expect (#5977) 2024-01-12 17:57:00 +02:00
Ofek d811013363 Fix #5941: mark mrustc compilation result with languageId='c' (#5944)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-01-05 19:31:16 +02:00
Vadim Zaliva 0781e2b1be Compilers for exectuable Cerberus CHERI C and ISO C semantics (#5864)
# Cerberus

[Cerberus](https://www.cl.cam.ac.uk/~pes20/cerberus/) offers executable
semantics for a substantial fragment of C and
CHERI-C languages. It is implemented via an elaboration into a simpler
Core language, which is displayed as the compiler
output in the Compiler Explorer. Evaluation of C programs (execution) is
also supported.

## Prerequisites

The easiest way to install both the Cerberus and Cerberus-CHERI
compilers is by using Docker:

`docker pull vzaliva/cerberus-cheri`

Then, for example, you can print the _Core_ elaboration for `test.c`
using ISO C semantics:

`docker run -v $HOME/tmp:/mnt -it vzaliva/cerberus-cheri cerberus
--pp=core --exec /mnt/test.c`

## Configuration

The file `etc/config/c.defaults.properties` defines a group of two
compilers: 'cerberus' for ISO C and 'cerberus-cheri'
for CHERI-C. It assumes that the corresponding executables are in the
path.

## Limitations and Future Improvement

Presently, only simple Core output is shown. It is not syntactically
highlighted nor linked to C source code locations.
Some potential future improvements include:

1. Error location handling in warning and error messages
2. Specifying execution flags
3. Core syntax highlighting
4. Display of AST
5. Display of other intermediate languages (Cabs, Ail)
6. Tooltips/links to the ISO C document from Core annotations

## See also:

- [Cerberus (project page)](https://www.cl.cam.ac.uk/~pes20/cerberus/)
- [Cerberus (GitHub
repository)](https://github.com/rems-project/cerberus)
- ["Formal Mechanised Semantics of CHERI C: Capabilities, Undefined
Behaviour, and Provenance" (paper,
preprint)](https://zaliva.org/cheric-asplos24.pdf)
- ["CHERI C semantics as an extension of the ISO C17 standard" (tech
report)](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-988.html)
2023-12-23 18:05:35 -06:00
J. Ryan Stinnett e7b22b41be Limit exec streams to max string length (#5898)
Some operations set `exec`'s `maxOutput` to a value larger than the max
string length. This change ensures we always cap output to the engine's
string limit (currently 512 MB in recent Node versions).

This also tweaks handling when reaching the string limit to ensure
adding the "truncated" message itself does not send us beyond the limit.
2023-12-23 17:54:46 -06:00
J. Ryan Stinnett 43bdf65d54 Customise opt pipeline language by compiler (#5880)
This allows each compiler to override the default Monaco language used
by the opt pipeline view.
2023-12-12 00:54:43 -05:00
Matt Godbolt 1815ca1b99 Prettier the files, and ensure the checks check that next time 2023-12-11 22:07:10 -06:00
J. Ryan StinnettandMatt Godbolt f0e1d5d264 Add Racket optimisation pipeline (#5836)
This adds a Racket optimisation pipeline view by reusing the existing
LLVM-focused optimisation pipeline UI. A Racket-specific pass parser
translates its output into passes for the UI to present.

This new Racket optimisation pipeline view is currently only enabled for
Racket nightly, as it depends on [recent
changes](https://github.com/racket/racket/pull/4842) to Racket's
compiler output to function.

This also extends the opt pipeline view to allow customising the
function selector label as well as the options and filters for each
compiler where needed.


![image](https://github.com/compiler-explorer/compiler-explorer/assets/279572/f540b41e-fd55-4375-bb2d-a0bb977530b3)

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-12-11 19:35:45 -06:00
Robert Cohn 7d3156ae5f oneapi 2024.0.0 release (#5867)
* directory structure has changed
* no more releases of icc

Depends on deployment of
https://github.com/compiler-explorer/infra/pull/1188
2023-12-10 14:19:43 -06:00
kevinjeon-g fb0f0a86d9 Add the HandlerConfig type to the global handler config (#5858) 2023-12-10 14:03:34 -06:00
Vicente BoleaandMatt Godbolt 20d2852138 lang: add cmakescript language (#5815)
Fixes #5502 

In this PR I make an early attempt to add the CMakeScript as a language
in compiler-explorer. I will be fantastic having this since CMake is one
of the most used build system. Having an cmake interpreter in the web
would probe truly useful for teams and individuals, it will be a
fantastic way to share snippets of cmakescript and show how they are
executed with different cmake versions.

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-12-04 21:03:50 -06:00
kevinjeon-g 7efe253f5f Add support for Android D8 (8.1.56) (#5756)
Adds D8Compiler, which applies to the Android Java and Android Kotlin
languages. D8Compiler instantiates a JavaCompiler or KotlinCompiler
using the java/kotlin dependencies' paths for D8 in the infra repo.

compiler-finder.ts has been updated to allow for duplicate compiler IDs
for 'android-java' and 'android-kotlin', as it is expected that the
compilers used for these languages is the same.
2023-12-04 19:35:56 -06:00
Jeremy RifkinandMarc Poulhiès 7680595a88 Add GIMPLE (#5817)
This PR adds GIMPLE as a language

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/42d2b423-0d87-4a41-b762-3d8b4e7cedd2)

---------

Co-authored-by: Marc Poulhiès <dkm@kataplop.net>
2023-12-03 11:34:25 -05:00
J. Ryan Stinnett c3e1b04c31 Rename opt pipeline without LLVM prefix (#5828)
This prepares for future work that will reuse the opt pipeline view
outside of the LLVM ecosystem by renaming related components to remove
the LLVM prefix.

The pass dumper keep its LLVM prefix, as it is assumed this part is
likely to be customised for each compiler ecosystem.

The historical component name has been preserved in the component list
as an alias to keep old links working.
2023-12-03 11:33:42 -05:00
partouf e129f242b1 Merge branch 'main' of https://github.com/compiler-explorer/compiler-explorer into main 2023-11-30 00:39:10 +01:00
partouf 142691231d fix formatting 2023-11-30 00:38:42 +01:00
Patrick Quist b918a936fb fix ldc llvmir (#5827) 2023-11-30 00:36:54 +01:00
abhishekkaushik22 63b3f6beba Fix #5660 (#5794)
Closes #5660
2023-11-27 22:17:26 -06:00
aliaegik 4ad823b080 New C3 compiler added (#5789)
c3c compiler version 0.5 (alpha) added.
2023-11-22 17:47:40 -06:00
Mauro Baladés 7a33cd6e2e Changed exec to exe for snowball (#5788) 2023-11-22 10:51:46 -06:00
Patrick Quist 04efa86241 Changes to support CMake for Windows (#5769) 2023-11-22 03:06:26 +01:00
Mauro Baladés d2f4617d0d Added support for intel and new examples (#5754) 2023-11-21 18:12:05 -06:00
Matt Godbolt a7e6ec61e3 Bump remaining deps (#5781)
And reformat everything.
2023-11-20 22:04:57 -06:00
Mauro Baladés caa8b335ba Fixed CLI args for snowball (#5753) 2023-11-14 17:14:48 -06:00
Ofek a280d8d305 Fix #4654 (#5749)
Apparently AST for ldc is an abuse of terminology, as it doesn't
produces anything resembling a syntax tree:
https://github.com/dlang/dmd/pull/6556#issuecomment-282353400 . It is
potentially meaningful only to ldc developers. Anyway the `generateAST`
result type is fixed, along with some other small stuff around.
2023-11-13 20:11:16 -06:00
Steve 6b94b29f55 Disable diffable asm for dotnet 8.0+ by default (#5739)
Since .NET 8.0, the JIT disasm no longer prints encoded bytes of
instructions by default, so we can disable diffable asm by default.
2023-11-13 20:08:43 -06:00
Patrick Quist 455d92916a Execution with heaptrack (#5644) 2023-11-07 23:59:40 +01:00
David Spickett 28e607057c LLVM TableGen: Improve docstring for Actions Override and add example (#5711)
A majority of the actions/backends expect to find certain classes and
definitions in the source code. There's no canonical reference for this
so it's a combination of incomplete docs and the actual uses in
llvm-project.

(most of the time I expect people will come from llvm-project to
experiment, rather than the other way around)

I've added an example that uses the Searchable Tables backend.

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2023-11-07 00:32:24 +01:00
Justin Bogner b23c01e8cc Support the opt pipeline view in dxc for HLSL (#5704) 2023-11-04 20:55:39 +01:00
David Spickett 971889e5d7 LLVM TableGen: Add actions to Overrides menu (#5699) 2023-11-04 20:54:43 +01:00
Ofek e7d266ac9c Fix #5255 (#5700) 2023-11-04 20:01:43 +01:00
Patrick Quist 4a8fdbf810 store exec+sandbox types (#5696)
prep for #5533 and #5644
2023-11-01 00:06:47 +01:00
David Spickett 91ec8f09fa LLVM TableGen: Add trunk compiler and default include path (#5652)
Since trunk will be a moving target, I've left the default compiler as
17.01.

The standard include path will allow for examples that include files
like `include "llvm/TableGen/SearchableTable.td"`, without extra
options. This is useful if you want to create a minimal example of the
records that an existing backend expects to see.
2023-10-30 20:44:14 -05:00
Steve 2f0b8028c7 Always get version string for dotnet (#5648) 2023-10-30 16:23:54 +01:00
Steve 9daa1a9447 Fix crossgen2 compilation (#5661) 2023-10-30 16:19:04 +01:00
partouf 5ef2fb1025 add types 2023-10-24 17:30:36 +02:00
David Spickett 5f3db78dce Add the LLVM TableGen language (#5629)
LLVM TableGen is used to generate complex output files in the llvm
project. A generic description of classes and definitions produces
"records" that can then be walked by a TableGen backend to produce
things like C++ code, configuration files, etc.

The biggest examples are LLVM's assembler and disassembler where all the
targets' instructions are defined in TableGen.

https://llvm.org/docs/TableGen/ProgRef.html

An example:
```
class Register<int _size, string _alias=""> {
    int size = _size;
    string alias = _alias;
}
def X0: Register<8> {}
def X29: Register<8, "frame pointer"> {}
```
```
------------- Classes -----------------
class Register<int Register:_size = ?, string Register:_alias = ""> {
  int size = Register:_size;
  string alias = Register:_alias;
}
------------- Defs -----------------
def X0 {        // Register
  int size = 8;
  string alias = "";
}
def X29 {       // Register
  int size = 8;
  string alias = "frame pointer";
}
```

It's often a pain point for people new to LLVM so having a quick way to
experiment would be a great benefit for the community (we have a Jupyter
kernel which is good but not as simple as Compiler Explorer).

The compiler for TableGen is `llvm-tblgen`. This comes with most release
builds of LLVM in /bin along with clang and the others. Its default is
to output a text dump of the records defined so that's what I've used
here. This is not executable code so I've disabled the features related
to that.

A user could pass options to `llvm-tblgen` to produce text in a format
other than this, C++ code or JSON for example. However this text dump is
the main use case.

I've re-used an existing clang install, since that includes
`llvm-tblgen` in `bin/`. I just added the 17.01 version for this first
change.

Syntax highlighting is a mix of the Fortran and Ada configuration,
following the language spec I linked above. Though I am very new to that
so it is likely incomplete.
2023-10-23 19:59:46 -05:00
Steve c5ffd00598 Allow disabling diffable asm manually (#5585)
When we see JitDisasmDiffable being set manually, we can stop
automatically emitting JitDisasmDiffable.
2023-10-23 19:53:09 -05:00
Cassandra Beckley d23bbc6596 Add AST viewer support for HLSL/DXC (#5627)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
Since DXC is a fork of Clang from LLVM 3.7, the AST can be generated and
parsed in a manner similar to the Clang AST.
2023-10-22 12:17:24 +02:00
Matt Godbolt c115a45ecb Final fixups to get Hylo execution and binary working 2023-10-18 15:54:55 -05:00
nickpdemarco 4fd7f325f4 merge main 2023-10-18 16:36:52 -04:00