aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers
Commit message (Collapse)AuthorAge
* Suggestion to update llvm-cxxfilt logic (#6451)gh-11685Ofek2024-05-08
| | | | | | | | | | | | (1) Restore explicit specification of `group.*.demangler=/opt/compiler-explorer/clang-trunk/bin/llvm-cxxfilt` for all clang compiler groups, except bpf and windows. (2) Make the ClangCompiler` constructor adjust the path of `llvm-cxxfilt`, so that a compiler-local version is preferred, if one exists. (3) Pass-by update: bump the version of llvmDisassembler from clang-14 to clang-18.1. Hopefully this addresses all demangling issues known so far.
* Update customCwd for profman in dex2oat (#6454)gh-11684kevinjeon-g2024-05-08
|
* Fix test break introduced inadvertently in #6422gh-11594Jeremy2024-05-02
|
* Fix #6301 (#6422)ramang-unity2024-05-03
|
* Update dex2oat.tsgh-11578Patrick Quist2024-05-01
|
* fix dex2oat profile issuePatrick Quist2024-05-01
|
* Add profile support for dex2oat. (#6382)gh-11554kevinjeon-g2024-04-29
| | | | | | | | | | | | dex2oat supports profile-guided compilation. In addition to taking dex code as an input, it can take a profile as another input, to guide the compilation. The profile determines which methods need to be compiled, how calls can be inlined, and so on. Because Compiler Explorer doesn't support multiple input files, the profile is added as a comment block in the Java/Kotlin source code. A post-processor extracts the profile from the comment block into a separate file, in order to input it to dex2oat.
* Removed UseDynamicNumberOfCompilerThreads command-line argument when running ↵gh-11519Filippo Barbari2024-04-25
| | | | | | | | | on java <11 (#6397) This fixes #6388. --------- Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
* Propagate java/kotlin errors to D8 (#6374)gh-11439kevinjeon-g2024-04-20
|
* eslint root setting and fixes (#6307)gh-11409Patrick Quist2024-04-16
|
* Support compilation with boot image for Android (#6346)gh-11294kevinjeon-g2024-04-13
| | | | | | | | | | | | | | | | Updates dex2oat to specify a valid boot image for accurate compilations. For example, these two methods should now (correctly) compile to the same native code: ``` static int insertAndReturn(int num) { int[] arr = {num}; return arr[0]; } static int justReturn(int num) { return num; } ```
* Update dex2oat input arguments (#6340)gh-11284kevinjeon-g2024-04-13
| | | | | Adds '--copy-dex-files=always', as it is needed in newer versions of dex2oat. This doesn't affect older versions.
* Simplify Android compiler properties (#6334)gh-11283kevinjeon-g2024-04-13
| | | | | updates intermediate compiler exe input to refer to the compiler's getInfo().exe so that paths don't need to be hardcoded in properties.
* Fix Sentry Issue (#6349)gh-11282Ofek2024-04-13
| | | | | | | | | | | | | | <!-- 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! -->
* [julia] Add LLVM IrView (#6285)gh-11202Mosè Giordano2024-04-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Julia is based on LLVM like other toolchains supported by Compiler Explorer, and it can emit LLVM IR, but at the moment we only expose it via the flag `--format=llvm` to the compiler wrapper. With this PR we add a proper LLVM IR viewer, like the other LLVM-based toolchains. We add a new option for the wrapper to emit the entire LLVM module, which has the benefit of being parsable by Compiler Explorer, so that we can automatically filter out debug information and metadata annotations. Preview (from https://github.com/compiler-explorer/compiler-explorer/issues/4597#issuecomment-2018956112): ![image](https://github.com/compiler-explorer/compiler-explorer/assets/765740/7c2f80b4-9c92-4761-9f6e-393d0ad26935) We removed the custom `<[source code line] [number of output lines] [function name] [method types]>` line in the output of the `code_*` functions, together with the custom ASM parsing, because they invalidate the output (it isn't valid ASM nor LLVM), and create more problems than they solve. This PR was prepared in collaboration with @vchuravy. This should eventually address #4597, once inlined LLVM functions are handled by the IR parser in Compiler Explorer, I think @vchuravy can comment more on that issue. --------- Co-authored-by: Valentin Churavy <v.churavy@gmail.com>
* Optionally show disambiguating hashes in demangled Rust identifiers (#6265)gh-11201narpfel2024-04-01
| | | | | | | | | | | | | | | | | | | | | | Demangled Rust identifiers under the `legacy` name mangling scheme rely on a hash to disambiguate items with the same name, such as different monomorphisations of the same function or different closures’ `call_once` methods. In the `v0` mangling scheme, this is no longer a problem. However, configuring the demangler to show hashes in `legacy` names will include crate-id hashes in `v0` names, which are [mostly unneeded](https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html#appendix-a---suggested-demangling). This PR introduces a new checkbox *Options...* → *Verbose demangling* that lets the user select if they want to include disambiguating hashes in demangled identifiers. This checkbox is only shown for compilers that support verbose demangling, and deactivated when the *Demangle identifiers* checkbox is unchecked. Resolves #1754. Resolves #6255.
* Handle the case where clang had no buildenvsetup. Closes #6303 (#6305)gh-11158Matt Godbolt2024-03-30
|
* Integrate zksolc (#4398)gh-11126Oleksandr Zarudnyi2024-03-29
|
* Add MadPascal (#6286)gh-11117Patrick Quist2024-03-29
|
* For clang cross-compiles with libc++, explicitly add `-I../include/x86_64… ↵gh-11085Ofek2024-03-25
| | | | (#6277)
* [julia] Do not modify in-place `options` in `runCompiler` (#6281)gh-11069Mosè Giordano2024-03-25
|
* Allow overriding clang demangler from properties (#6228)gh-10989Ofek2024-03-16
| | | | | Specifically bpf uses group.bpf.demangler (gcc demangler) This fix continues #6114.
* Replace the deprecated `substr` with `substring` (#6236)gh-10941Ofek2024-03-10
| | | Just some minor homekeeping.
* [Spice] Also apply abort-after-dump option to assembly output (#6203)gh-10829Marc Auberer2024-03-02
|
* fix pythran wrt ldpath (#6202)gh-10812Marc Poulhiès2024-02-28
| | | | | refs #6079 Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
* pythran: initial support (#6197)gh-10807Marc Poulhiès2024-02-28
| | | | | | | | | | | Pythran is a python to c++ transpiler. Our supports both the C++ and the full link to a share library (a python module). See https://pypi.org/project/pythran/ for more information. fixes #6079 Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
* Specify llvm-cxxfilt as the demangler for clang *groups* (#6114)gh-10801Ofek2024-02-27
| | | | | | | This does contain a single `.default.properties` file, but it already contained an `/opt/compiler-explorer` reference. @partouf maybe that would solve the mangling issue for clang-17 + libc++ ?
* Change getCompilerResultLanguageId prototype (#6148)gh-10765Marc Poulhiès2024-02-24
|
* [Spice] Abort compilation after dump (#6170)gh-10722Marc Auberer2024-02-20
|
* Update D8 versions (up to 8.2.42) (#6138)gh-10709kevinjeon-g2024-02-19
| | | | | | This change adds recent D8 versions (8.1.72, 8.2.33, 8.2.42). Properties for D8 have been reformatted to use groups in order to avoid duplication of java/kotlin references.
* flang: Use -masm to enable Intel syntax (#6145)gh-10708David Spickett2024-02-19
| | | | | | | | | | Since https://github.com/llvm/llvm-project/commit/9ca1a1575a337931d0e49859f83a0d5b70916abd, flang supports the use of `-masm` without having to use `-mllvm`. flang converts this into `-mllvm...` so the result is the same. The check still looks for `-mllvm`, as this is the best way to tell flang and flang-to-external-fc apart. As `-masm` doesn't appear in the --help output of flang.
* [Spice] Add std dir to default exec options (#6146)gh-10658gh-10654Marc Auberer2024-02-15
|
* Clang time trace support in execution pane (#6139)gh-10642Patrick Quist2024-02-14
|
* flang: Enable the Intel asm syntax option (#6128)gh-10613David Spickett2024-02-12
| | | | | | | | | | | flang-new doesn't support `-masm=intel` (though it seems likely it eventually will), so this uses `-mllvm ...` to achieve the same thing. flang-to-external-fc is a wrapper script that will be removed once flang-new becomes flang, so it is not being updated and won't support -masm or -mllvm ever. (and you'll get the same output by choosing a gfortran compiler, since that's what the script uses for codegen)
* New language: Spice (#6105)Marc Auberer2024-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the Spice programming language. Spice (`spicelang`) is a simple, AOT compiled, LLVM-based systems language with focus on practicality and performance. **Key features of Spice** - simplicity - see what you get aproach with batteries included - performance: As Spice uses LLVM as its primary backbone, it competes with the performance of other LLVM-based compilers - enhanced safety: Spice implements an enhanced safety mechanism, which includes builtin heap type with auto-free and more - cross-compile support: Currently x86_64, AArch64 and wasm32 are supported cross-compilation targets, but more to come - Pretty good C and C++ interop **Links** - Source code: https://github.com/spicelang/spice - Website: https://spicelang.com - Playground (own CE instance): https://play.spicelang.com - Infra PR: https://github.com/compiler-explorer/infra/pull/1229 **Things this PR addresses** - General support for Spice - Three code examples - Spice mode (Syntax highlighting) - Opt pipeline support - LLVM mca and osaca support
* View Erlang jitted assembly (#6104)gh-10610Andrea Tomasi2024-02-12
| | | | | | | | | | | | | | | | | | | | | | | | Hi, this PR adds a way to view the assemply code of Erlang code. Since OTP 24 inside the Erlang VM there is a jitter that runs while we load the code. The standard way to dump the asm code is to pass an option during the startup. The main issue is that this triggers the dump of all the modules we are loading (and it is slow). To avoid this I'm using some instrinsics of OTP 26 but at least we dump only what we need. (I'm planning to add it to `infra` and then to awmason Some references: - https://www.erlang.org/blog/otp-26-highlights/#improvements-in-the-erlang-compiler-and-jit - https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_bif_info.c#L5255 --------- Co-authored-by: Matt Godbolt <matt@godbolt.org>
* Fix #6091: Add consideration for negative prefix matchesgh-10555Ofek Shilon2024-02-10
|
* Add Fortran library support (#5533)gh-10554Patrick Quist2024-02-09
|
* Update dex2oat version string (#6096)gh-10516kevinjeon-g2024-02-05
| | | | | | | | | | | | | | <!-- 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! -->
* Add Elixir language support (#6081)gh-10510Andrea Tomasi2024-02-05
| | | | | | | | | | | | | | | | | | | | | Hi, I am adding support for the Elixir language (https://github.com/compiler-explorer/compiler-explorer/issues/3947) I have done this so far. It is not perfect but at least is something I can work with. In Elixir you can write several modules in the same file, so I show the different compile utins as a list. It works locally but I don't know how to add the Elixir language to [infra](https://github.com/compiler-explorer/infra/) Some notes: - I think Elixir's macro system may be a potential security issue because I can run code during compilation. - The decompiled code contains a reference to the file path on the system machine. ![elixir_compiler](https://github.com/compiler-explorer/compiler-explorer/assets/11353602/59e46c98-646d-4275-9c03-e4097a4977ef)
* Check for non-string values in exec's env (#6087)gh-10470Matt Godbolt2024-02-04
| | | | - warns - fixes the case I found
* flang: Enable llvm-ir viewer for flang-new (#6046)gh-10416David Spickett2024-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | flang supports the -emit-llvm option but the difference from clang is that while clang allows `-Xclang -emit-llvm`, flang does not allow `-Xflang -emit-llvm`. Instead we need to use `-emit-llvm` alone. This is a deliberate choice by the flang driver to make sure the user isn't asking the compiler to do 2 things at once. In this case assemble and emit llvm IR. The way compiler explorer calls clang, the IR ends up not in the `-o` file path but in a file named after the input file but with the extension `.ll`. For flang we will get the IR in the file specified by `-o`. To handle this I've copied code from ISPCCompiler which does the same thing. We could dedupe this, but I'm not sure whether it's worth it while we have only 2 compilers doing this. (clang supports `clang ... -emit-llvm` as well, so perhaps the flang style could become the majority mode eventually) Final note, flang-to-external-fc could support this with changes but users are better off just using flang-new, the result is the same (as flang-to-external-fc doesn't advertise -emit-llvm, it won't be selectable anyway).
* Override getVersion() for dex2oat (#6076)gh-10415kevinjeon-g2024-02-03
| | | | | | | | | | | | | | <!-- 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! -->
* Unify the way tmp dir is used (#6052)gh-10336Matt Godbolt2024-01-28
| | | | | | | Instead of having several globals, set via environment variables, explicitly set the "correct" env var if passed `--tmpDir` and then consistently use it in the rest of the program. See @apmorton's comments in #1707
* Add Wyrm transpiler (#6028)gh-10276Jeremy Rifkin2024-01-21
| | | | | | | 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
* Improve typings for the now-global HandlerConfig (#6027)gh-10273Jeremy Rifkin2024-01-21
| | | This PR populates types in the HandlerConfig
* Dex2oat error handling and fixes (#6022)gh-10252Patrick Quist2024-01-20
|
* Fix opt output to highlight as llvm ir rather than asmgh-10233Jeremy2024-01-16
|
* Fix #5987: make rustc generate *only* IR output in generateIR (#5988)gh-10225Ofek2024-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Add support for dex2oat (latest) (#5916)gh-10184kevinjeon-g2024-01-15
| | | | | | | 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.