Commit Graph
2398 Commits
Author SHA1 Message Date
Ofek 42c10cf9b3 Fix #6083: rewrite demangleLabels (#6701)
This code had some problems:

https://github.com/compiler-explorer/compiler-explorer/blob/07d5c3312fce98d2742fa7ed738d4084f3a6975f/lib/demangler/base.ts#L200-L203
There

`PrefixTree.replaceAll` replaces mangled to demangled names 'blindly',
with no notion of labels. Later `demangleLabels` runs separate logic to
update the column-range of each label in hope of mimicking the
`replaceAll` action. This fails in some cases:
(1) the `demangleLables` code handles only a single occurrence of each
label in a line,
(2) It also diverges from `replaceAll` in case that a string which is a
label-name appears in the line *not* as part of a label (this does
happen!).

This fix makes `replaceAll` return detailed account of its actions, and
then use these to properly adjust the label ranges.

This fix might not address all the root issues, but it does make some
`label` decisions consistent where they weren't.
2024-07-13 17:38:32 +03:00
Boris Verkhovskiy 07d5c3312f Set -fverbose-asm/-fno-verbose-asm from Comment filter (#6462)
~~This removes useless comments (namely repeated function/label names,
`<n>-byte Folded Spill` and others) from the generated assembly.~~

Fixes #5964
2024-07-10 20:19:32 +03:00
Peter Waller 928f3b2ab0 Pass instructionSet, -mcpu, -march and -mtriple through to llvm-mca (#6682)
Currently if an MCA instance is constructed on a compiler, MCA runs with
the default target for the host it is running on.

Make it respect the target architecture by passing an -mtarget to MCA
conditioned on the detected instructionSet of the compiler.

Additionally, pass through any -mcpu, -march or -mtriple specified to
the compiler.
2024-07-10 06:53:45 -05:00
Patrick Quist 75acc5bd44 Attempt to detect faulty compiler/language population (#6610) 2024-07-07 13:09:51 +02:00
Nicholas Hubbard a9257430f3 Add assembly documentation for PowerPC platform (#6665)
<!-- 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!
-->

Hello all, I've added assembly documentation for the PowerPC platform
with this PR.

There's a couple of notes to keep in mind, mostly regarding automatic
processing:

1. Unfortunately, IBM made their documentation site very difficult to
automatically scrape. It uses dynamic rendering with a documentation API
that's protected by cookies, requiring the use of Selenium to scrape it.
2. While it is possible to scrape the documentation pages, it's
maddeningly difficult to do so, because the structure of the pages is
not guaranteed.
- Some pages have invisible elements in their headers that make matching
elements very difficult.
     - Some pages are missing entire sections.
- Some pages are written without an introduction for the instruction
mnemonic, making the resulting documentation impossible to understand.
- Some pages, specifically for instructions without arguments, are
missing the table that lists the mnemonics out in order.
- I could go on, but I abandoned trying to do automatic processing after
running into this many roadblocks.
3. The automatic processing script is available in the docenizers
directory, but since it's not complete, feel free to ask to remove it.
4. I couldn't test the actual mnemonics appearing the editor, because my
local test setup kept trying to map the PowerPC instructions into AMD64
documentation, with predictably unusual results.
5. I didn't include AltiVec instructions, because there isn't any
webpage that documents them; they are only documented in a PDF file
provided by NXP.

Please let me know if there's anything else I need to do for this to
work. Thank you so much for your wonderful service!
2024-07-01 14:52:10 +02:00
kevinjeon-g 1c051bd479 Add R8 for Android (#6591)
R8 is a whole-program optimizer that converts Java byte code to
optimized dex code. It can be run with the same general steps (and JAR)
as the existing D8 compiler.

This change adds R8Compiler and the R8 keep-annotation library it relies
on, makes this lib + Android API stubs default libraries for Android
Java/Kotlin, and includes a small update to allow older versions of
dex2oat (33.10) to run.

https://r8.googlesource.com/r8
2024-06-25 18:43:02 -05:00
kevinjeon-g 99617a29b2 Move dex2oat profiles from inline to template (#6621)
This change moves the dex2oat profiles for Android Java and Kotlin from
the inline comments (included as part of the default code example) to
being included as a separate file. Templates have been added for this.
2024-06-24 21:33:31 -05:00
Marc Poulhiès 6a97ce2cad Unbreak rustc_cg_gcc
Fix lib path.

refs https://github.com/compiler-explorer/compiler-explorer/issues/5342

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2024-06-22 16:34:34 +02:00
Marc Poulhiès 924bdfa363 Adjust rustc_cg_gcc compiler invocation (#6583)
Adjust a bit how we call the compiler:
- panics are handled, no need to force abort (and -Cpanic=abord doesn't
work without other tuning)
- adjust some paths

refs https://github.com/compiler-explorer/compiler-explorer/issues/5342

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2024-06-21 20:31:40 +02:00
Matt Godbolt e91b5d12da Comply with some MS terms (#6627)
- Ensure MSVC license terms are clearly shown to the user.
- Simplify config of vc and vcpp slightly by extracting common stuff
into a group.
- Remove reference to MS privacy policy
2024-06-19 18:09:59 -05:00
Ofek 3db92c3753 Fix rust IR function/label parsing (#6594)
Fixes at least #6554.

Modified to not clash with @narpfel 's earlier fix to #6558
2024-06-19 22:01:05 +03:00
Patrick Quist e3118f36ca add some msvc compilers (#6616) 2024-06-19 02:46:02 +02:00
Anton Baliasnikov ac57dde2d0 Add ZKsync solidity compiler 1.4.1 and 1.5.0 (#6592)
## ZKsync solidity compiler

Adds two latest releases of **ZK**sync solidity compiler (`zksolc`)
`v1.4.1` and `v1.5.0`.

Related infra change:
https://github.com/compiler-explorer/infra/pull/1324
2024-06-17 21:12:04 -05:00
Stephen Tozer be9c26b6de Add support for filtering debug records in LLVM IR (#6618)
In LLVM, debug records (`#dbg_value`) are now being printed by default
in LLVM IR instead of debug intrinsics (`call void @llvm.dbg.value`). As
the debug info filters don't recognize debug records, this means [IR
output from clang-19 (trunk)](https://godbolt.org/z/fPbdEhYsn) and
onwards will always show debug variable output.

This patch adds debug records to the filters to fix this.
2024-06-17 21:07:21 -05:00
SteveandPatrick Quist b8df2e3dab Refactor and adding new dotnet compilers (#6522)
Depends on https://github.com/compiler-explorer/infra/pull/1312.

I'm considering to unify all old compiler versions per dotnet minor
version as patch upgrade in dotnet doesn't change the codegen. New patch
versions come with quality updates like bug and security fixes, we only
need the latest version per minor dotnet version instead. Here a version
is consisting of `major.minor.patch`, such as `7.0.3` and `8.0.5`.

i.e.
- `dotnet6030csharp:dotnet6018csharp:dotnet6014csharp:dotnet6011csharp`
-> `dotnet60csharp`, and rename it to `.NET 6.0`, as `6.0.30`, `6.0.18`,
`6.0.14` and `6.0.11` are all `6.0`
- `dotnet6030fsharp:dotnet6018fsharp:dotnet6014fsharp:dotnet6011fsharp`
-> `dotnet60fsharp`, and rename it to `.NET 6.0`, as `6.0.30`, `6.0.18`,
`6.0.14` and `6.0.11` are all `6.0`
- `dotnet6030vb:dotnet6018vb:dotnet6014vb:dotnet6011vb` -> `dotnet60vb`,
and rename it to `.NET 6.0`, as `6.0.30`, `6.0.18`, `6.0.14` and
`6.0.11` are all `6.0`
- `dotnet7019csharp:dotnet707csharp:dotnet703csharp:dotnet701csharp` ->
`dotnet70csharp`, and rename it to `.NET 7.0`, as `7.0.19`, `7.0.7`,
`7.0.3` and `7.0.1` are all `7.0`
- `dotnet7019fsharp:dotnet707fsharp:dotnet703fsharp:dotnet701fsharp` ->
`dotnet70fsharp`, and rename it to `.NET 7.0`, as `7.0.19`, `7.0.7`,
`7.0.3` and `7.0.1` are all `7.0`
- `dotnet7019vb:dotnet707vb:dotnet703vb:dotnet701vb` -> `dotnet70vb`,
and rename it to `.NET 7.0`, as `7.0.19`, `7.0.7`, `7.0.3` and `7.0.1`
are all `7.0`

I'm keeping the minor version (ie. `.0`) in the name as there may be
updates like `.NET Core 3.1` to `.NET Core 3.0` which does change the
codegen.

The compiler structure now is:

```
group: dotnetcoreclr
.NET (main)
.NET 8
.NET 7
group: dotnetcrossgen2
.NET (main)
.NET 8
.NET 7
.NET 6
group: dotnetlegacy
existing compilers for backward compact
```

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2024-06-11 14:09:23 -05:00
Afonso BordadoandPatrick Quist bdb5feaea3 Add webassembly language (#6429)
👋 Hey,

This PR adds support for the Webassembly Text Language (#1871).
Currently it only supports the
[wasmtime](https://github.com/bytecodealliance/wasmtime) compiler, but
it should be possible to add others (i.e. v8 / wasmer / etc...).

It looks like the monaco does not support the WAT language, so I've
added a simple mode for it, that is mostly copied from the clojure mode
with some changes. From what I've tested it seems to work reasonably
well.


![image](https://github.com/compiler-explorer/compiler-explorer/assets/1357143/9e38b28e-235c-47e5-a71e-50217e5d2056)

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2024-06-10 21:29:03 -05:00
narpfel 7974f78e08 Also demangle quoted identifiers in LLVM IR (#6560)
This fixes one of the two problems reported in #6558.
2024-06-07 20:49:45 -05:00
kevinjeon-g bf91208c97 Support Android API stubs (#6514)
Updates the d8 and dex2oat compiler implementations so that android.jar
is included in the classpath for javac/kotlinc.
2024-06-07 19:18:46 -05:00
Patrick Quist 466346c208 fix kotlin execution result when compilation fails (#6556)
Fixes https://github.com/compiler-explorer/compiler-explorer/issues/6547
2024-06-05 18:18:55 +02:00
Ofek 2f117a24c3 Fix llvm-ir-cfg: callbr might be multiline, AND might start with %1 = (#6546)
Fixes #6545
2024-06-01 17:33:04 +03:00
Jason Francis 97a39232b2 Detect local label assignments as directives on MIPS (#6392) (#6467) 2024-05-29 18:13:16 +02:00
Ofek ca28aec7a8 Remove unused events filtersChange, requestFilters, some added types to BaseCompiler.compile (#6486)
Just some minor housekeeping.
2024-05-29 18:10:21 +02:00
Patrick Quist d2c7a5222e Local/Remote Execution environment (#6413) 2024-05-26 22:09:01 +02:00
Ofek 42533d8dbb Stop duplicating hasXXoutput + XXoutput (#6476)
When you need to check if `XXoutput` exists, check it directly.
+some TSification in CompilationResult
2024-05-14 20:11:09 +03:00
Ofek bcb397f56b Add noUnusedLocals to tsconfig + fix the new alerts (#6396)
<!-- 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-05-14 18:46:22 +03:00
Ofek 402c5ec890 Mark the go compiler gc as not supporting cfg (#6470)
Following #6439: mark the go compiler `gc` as not supporting cfg.
Also, don't pass argument to `isCfgCompiler` - the base-compiler
implementation uses `this.compiler.instructionSet` anyway.
2024-05-12 02:16:51 +03:00
harishch4 15bcb0ab3d Add Flang frontend driver to Fortran Compilers (#6419) 2024-05-10 20:47:29 +02:00
Mefiresu a71168c6aa Update NDK toolchain finder (#6461) 2024-05-10 20:46:28 +02:00
Ofek 0703fef51b Suggestion to update llvm-cxxfilt logic (#6451)
(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.
2024-05-08 22:49:21 +03:00
kevinjeon-g 9a20419a29 Update customCwd for profman in dex2oat (#6454) 2024-05-08 21:48:45 +02:00
Ofek c7ce3ca071 Fix exception in case of empty IR (#6450)
This fixes #6449 - I carelessly ignored the case of empty IR output.
Repro link for verification: https://godbolt.org/z/4d46dahqq
2024-05-07 20:49:27 +03:00
Ofek 0fc6a922b1 Fix #6437: Don't try and generate cfg for incomplete (truncated) IR (#6444) 2024-05-06 22:08:31 +03:00
Jeremy abe4abd3bf Fix test break introduced inadvertently in #6422 2024-05-02 23:01:33 -05:00
dzaima 3a6a7999b5 Hanfle filtering tail call void @llvm.dbg.* in LLVM IR (#6425)
Fixes #6416. Additionally escapes a dot in another copy of an
`@llvm.dbg` check.

Didn't find any existing tests for IR filtering to update where this
filter applies, but did make sure locally that it does start hiding the
instructions for clang-17 and clang-18.
2024-05-02 18:43:36 -05:00
ramang-unity 4fbc2d496e Fix #6301 (#6422) 2024-05-03 00:12:48 +02:00
Patrick Quist 20d29ae10b Update dex2oat.ts 2024-05-01 03:11:59 +02:00
Patrick Quist 1639d0a29a fix dex2oat profile issue 2024-05-01 03:09:43 +02:00
kevinjeon-g b94781ab48 Add profile support for dex2oat. (#6382)
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.
2024-04-29 20:17:24 -05:00
Patrick Quist 8d3ba37fec Fix duplicated filters in logging (#6399) 2024-04-27 16:57:31 +02:00
Filippo BarbariandRubén Rincón Blanco 9d7ad0452b Removed UseDynamicNumberOfCompilerThreads command-line argument when running on java <11 (#6397)
This fixes #6388.

---------

Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
2024-04-25 21:44:25 +02:00
Ofek f59bad3a7e Opt remarks: replace hover-over-sidebar display with inline text (#6393)
![inlineoptrem](https://github.com/compiler-explorer/compiler-explorer/assets/73080/6c306b3f-2256-4578-b1d3-beaa1494a083)
2024-04-25 12:37:57 +03:00
Matt Godbolt f358067cec Migrate to eslint-plugin-n; as ...-node is deprecated (#6387)
Replaces #6310
2024-04-23 06:45:55 -05:00
Matt Godbolt 1260aff6bf Major bumps (#6385)
- enhanced-ms and fix
- css-loader
- vitest
2024-04-22 21:51:06 -05:00
Matt Godbolt e63f71a1bb More structured logging of compiles (#5105) 2024-04-22 21:25:13 +02:00
partouf 9bc017cc18 fix edition 2024-04-22 20:01:30 +02:00
partouf 1390c26330 revert #6297 - fixes #6376 2024-04-22 19:28:25 +02:00
Patrick Quist adb8bd774a Dynamic instruction set for documentation (#6173) 2024-04-22 18:40:56 +02:00
Patrick Quist 904410b993 Fix #5657 2024-04-20 16:16:34 +02:00
kevinjeon-g ddefce9925 Propagate java/kotlin errors to D8 (#6374) 2024-04-20 15:24:12 +02:00
Patrick Quist b8325cf0c6 eslint root setting and fixes (#6307) 2024-04-16 21:26:53 +02:00