Commit Graph
2469 Commits
Author SHA1 Message Date
Matt Godbolt 0d2fc74419 Deduplicate ARM opcodes (#7067)
Prevents us generating duplicate case statements, though this doesn't
mean we correctly collate things. This has no functional change (as the
duplicate switches the first one wins) but reduces the amount of code
generated.
2024-11-05 07:31:20 -06:00
Spencer Fricke 35527dd3b4 Fix OpLabel being in previous block (#7054)
SPIR-V is like LLVM in there are "Blocks" used for Control Flow,
`OpLabel` has a special text in the SPIR-V spec

> A block always starts with an
[OpLabel](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpLabel)
instruction. This may be immediately preceded by an
[OpLine](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpLine)
instruction, but the OpLabel is considered as the beginning of the
block.

But currently the coloring is off-by-1


![image](https://github.com/user-attachments/assets/4ec20d7d-0beb-49de-ba32-204f708a08c2)

This change now moves it up a line so it is the start of the block


![image](https://github.com/user-attachments/assets/3d6d1742-469f-4b29-a644-7677056bce9e)

This can be better seen why looking at the [SPIR-V
Visualizer](spirv-visualizer) tool output


![image](https://github.com/user-attachments/assets/10cbad0b-f093-4bd5-98dd-b38e78615218)
2024-11-03 19:37:45 +09:00
Sirui Mu a6ca0fed18 Add ClangIR compilation options (#6914)
This patch adds two options to the clangir pane that affects the clangir
compilation pipeline:

* Flat CIR enables the emission of flat clangir CFG;
* -fclangir-mem2reg enables the mem2reg pass on the flat clangir CFG.
2024-11-02 10:53:33 +02:00
goto40 7476cf387c fix: changed ClientStateExecutor.arguments type to string (was: any[]) - closes #7037 (#7044)
Just a small fix concerning the type (and the default value!) of
`ClientStateExecutor.arguments`.

This solves #7037 .

**Please have a detailed look at my changes**, since I have no deep
insight in all dependencies of this software (however, the tests pass)!

I tested the new code with the link in #7037 - and I tested the error
(wrong type) with [this link (the arguments are a list
here)](http://localhost:10240/clientstate/eNpNUEFqwzAQ/MqiQrCJS0jSk5205AW9hF7qHGRFuAJ5baQVpAj9vSvjmCKENLOj2dVE4bX3ZkQvaviOwtz53FcgrMQ+yF4zFGq7FUz5MTg1Ey2+GFQ23DWcJmeQ3lv05IIiuEBkDI/qt0lNiy2SHiYriZXKSu/hylqD1qAGxW0JrhsY5AOKBcFGVrDeuxIiu5DTFByChBN08MG7Bsn2KXfI/QZpsJi1AJ7udT2PZbFoBZsXx+qtPMfU8jeesGyydrebiUvcV4dUXSJXUq6k/GE1DpOx2s3Z3JjQD60CjW4JS7o+DBpprT8fMF6iFL1HOfmfkbKhNd2qHSdaYhevPPGZQz4cRfrn8hloCvRlvOlsjp0D1unG6w9dpIzQ).

**Note:** I check manually for the correct type and throw a `TypeError`
in case of problems. We could add a proper JSON-Schema definition of
important Data Types and include a Schema-check (I have good experience
with `zod`, but there are many of such libs). **If you are interested**,
I could prepare a demo-PR with e.g. `zod` for the `ClientStateExecutor`?
2024-11-01 10:32:06 +02:00
Spencer Fricke 868be5dc99 Add GLSL Logo (#7041)
Follow-up of
https://github.com/compiler-explorer/compiler-explorer/pull/6883

Someone pointed out today (since GLSL went live) that the OpenGL logo
would be best reprentation for the language as the `GL` in `GLSL` does
stand for the `GL` in `OpenGL`... also there is no other official logo
and it feels like a bug that there is no logo for it 😆
2024-10-30 23:30:54 +09:00
Partouf a4d8560877 fix 2024-10-29 10:31:22 +01:00
Partouf 9ad3a6ef6f bugfix/workaround windows 2024-10-29 09:40:11 +01:00
Spencer Fricke 02603a6371 Add SPIR-V language with SPIRV-Tools compilers (#6947)
for https://github.com/compiler-explorer/compiler-explorer/issues/2331

Hey, so I am currently trying to improve the SPIR-V ecosystem, in-charge
of the [SPIR-V Guide](https://github.com/KhronosGroup/SPIRV-Guide), and
part of the SPIR-V Working Group. We talked at our last Face-2-Face
gathering about getting more support for GPU tooling in something like
Compiler Explorer because you have all made this such an amazing tool!

I have enjoyed working in this codebase and happy to help keep improving
the SPIR-V as people find issues or want enhancements (I was already
about to spend time rebuilding Compiler Explorer, so happy to donate my
time to a single tool's effort)

(For those who haven't spent last few years staring at SPIR-V)

- SPIR-V is a an IR (very much like LLVM IR) but for GPUs
- SPIR-V can be used for Graphics and Compute
- Compute:
    - Can be tied to things like clang, llvm, mlir, OpenCL, etc
- One could take `spirv` as a language and compile it to something like
x86
      - (Future PRs for this realm of things)
- Graphics:
- Much harder to actually "compile" to any ISA because other graphics
pipeline information is missing that will effect the final ISA
- Microsoft has even now planned to move to [SPIR-V for DirectX
soon](https://devblogs.microsoft.com/directx/directx-adopting-spir-v/)
- Both:
- There are many tools that run on SPIR-V regardless (hence why they
share the same IR)
    - Being able to do tooling in compiler explorer would be AMAZING

This PR adds `SPIR-V` as a language and a new `SPIRV-Tools` compiler as
an initial compiler for it the language (since we already have the
SPIRV-Tools repo being pulled in on the infra side!)

I personally use `spirv-opt` and `spirv-val` the most and have been
testing this locally for a few days and feel it is ready to go. I plan
to slowly add more tools (ex. `spirv-fuzz`, `spirv-cross`,
`spirv-reflect`, etc)

Cheers!

(some screenshots of course)

![image](https://github.com/user-attachments/assets/419feab0-d030-4578-b32a-ef1cf95701da)

![image](https://github.com/user-attachments/assets/a00fa60f-7f05-4522-a9fc-1c43ecee1c42)
2024-10-28 21:24:50 -05:00
Ofek 63dd5e35a5 Various tsifications (#7025) 2024-10-27 15:28:38 +02:00
Partouf f3e369d5dd bugfix cmake execution 2024-10-26 19:09:39 +02:00
Partouf b5644fc22f bit more logging 2024-10-26 18:48:42 +02:00
Ofek 3fc9fcabd2 Add types to remote-execution files (#7024) 2024-10-26 18:26:56 +02:00
Partouf 025be9c495 fix types 2024-10-26 17:53:46 +02:00
Ofek f6438f9c4d Store times in numbers only (#7023)
Also fixes #4655
2024-10-26 18:43:59 +03:00
Patrick Quist 4fe8397fac Remote execution (#6700) 2024-10-26 17:42:22 +02:00
Ofek 648795d0f5 Unify CompileChildLibraries and SelectedVersionLibraries (#7022) 2024-10-26 15:53:27 +03:00
Ofek c312beae24 TSify StackUsage and others (#7021) 2024-10-26 11:35:35 +03:00
Ofek 4e5348ab77 Tsify tools (mostly) (#7018)
This includes among others:
 - Proper tsification of various tools code,
 - Elimination of the `CompilationInfo2` type,
 - Use of `CompilationInfo` instead of `Record<any, any>` in some places
 - These lines in CompilationResult:
```
    // Temp hack until we get all code to agree on type of asm
    asm?: ResultLine[] | string;
```

The next task would be to get all code to agree on the type of
CompilationResult.asm, thereby enabling fixing of most the remaining
TSification.
2024-10-26 10:58:30 +03:00
Ofek d7da9a7d64 Fix compilers to executors (#7020)
@partouf fyi
2024-10-26 10:55:02 +03:00
Ofek c1985d64a1 Tsification binge #7 (#6974) 2024-10-25 12:19:04 +03:00
Ofek Shilon 79a2b61447 Delete unused cliconan 2024-10-24 19:03:34 +03:00
Ofek bb712dff81 Fix #6967: drop external contracts in SolidityCompiler.processAsm (#7011) 2024-10-24 15:34:36 +03:00
Ofek 577b335c78 Tsify most of clientstate (#7008)
Add typing, some refactoring to switch-case. Mark unused functions - but
not deleting yet, out of suspicion it has something to do with #6980.
2024-10-24 13:55:24 +03:00
Mats Jun ce97bd1696 Replace old utils with JavaScript builtins (#7005) 2024-10-23 11:53:01 +02:00
Ofek 2df8d32758 Tsify #6 (#6941)
Another tsification batch. 347 to go and I'm running out of easy fixes
:(
2024-10-22 21:41:44 +03:00
Cr0a3 43fbfcd19f Adding ylc (#6982)
Hi dear godbolt team,

> Before opening the PR, please make sure that the tests & linter pass
their checks,
 > by running `make check`.

With this pr i added support for the ylc compiler.

Infra-PR: https://github.com/compiler-explorer/infra/pull/1441
2024-10-22 06:37:40 -05:00
Steve 35cd137722 Do not cache the sdk version and compiler path (#6973)
Godbolt caches the compiler instance so that the version string won't be
recalculated if there's an update to the compiler image.
Do not cache that information, instead reevaluate them whenever we do
the compilation.
2024-10-21 08:52:37 -05:00
Ofek dbd1134c39 Small options cleanup (#6981)
Remove the unused googleShortLinkRewrite and gapiKey
2024-10-19 22:12:41 +03:00
Ofek d23b327153 A few leftovers that escaped the google-analytics cleanup (#6979)
<!-- 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-10-19 22:00:12 +03:00
Ofek 93f75efc55 Update nvidia docenizer and docs (#6952)
<!-- 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-10-16 18:11:54 +03:00
Ofek caca3ea6c7 Eliminate all google-analytics dead code (#6954)
<!-- 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-10-10 21:21:43 +03:00
Steve 06068ef1e0 .NET: Stop using a response file (#6943)
Using a response file can prevent nsjail from replacing the file name in
args. Passing all args directly to the compiler instead.

Fixes
https://github.com/compiler-explorer/compiler-explorer/pull/6928#issuecomment-2398361491
2024-10-08 09:48:13 -05:00
Ofek 05dfb2034e tsify argument-parsers.ts (#6929)
470 ts violations to go.
2024-10-07 22:24:18 +03:00
Ofek 9dd45914aa Tooltips for llvm ir (#6937)
The docenizer was there - just needed some updating.

There is some duplicity created between `ir-view` and `compiler` that I
hope to address in a future PR.
2024-10-07 08:37:10 +03:00
Steve c2de66114b .NET: Invoke compiler directly to speed up compilation (#6928)
After this PR, compilers will be invoked directly instead of relying on
the built-in `dotnet build` command which involves restore and many
other expensive resolution operations.
This should speed up the compilation process a lot.
2024-10-02 20:56:22 -05:00
goto40 03ce528a0a feat: added ability to receive a base64 with compressed clientstate, #6918 (#6919)
I encountered a problem with large URLs when using the "clientstate" API
with base64 strings: see #6918

* I found that it was quite easy to include this feature, just by
searching for `/clientstate/`.
* I "tested" my feature interactively with `npm run dev` and this
[link](http://localhost:10240/zclientstate/eNq1VduK2zAQ/ZXBhWITJc6lVye7sBT6uIWl9CUOiyJPYm1syUjyZsOSf+/Idm5tWuhD7YCs0cyZM5doXgOL1kqtbJDA/DWQGa0jBkHB1brma6RtIHq9gERW10Y0glTFMYiqMrhCg0pgArlzlU3iGNXg/GAgdBlvYxLFQivHpUITl5mtuErVG6lEUWcIM6mtM8jL23PhAdLw7WAtXV4va4vGw6ByDfBGbzbadnixlWpdYD9Hnh2dDPKqIlDFS6StQLAuwxe48es0Vf51WFYFdzgTBbcW7m6BgpNrpQ2Cy6WFNDiopAHkFBeDlTZ0hlDqkrik6lnLDCojlRtnITG0Du7e8ghegR6Cu/KEN1ztwO0qhLsoVV5EqCFBgCR+wyktM+ADfPHhhsNoCr2eJMhW91z/qdV/OtcfNfpPF/r+obiTROjawYy0Q8lIhb4osjSYeqpfer3xJAE+p6PFyXZ/+ryASIOUkhhM22PS2v8WKYHeawc211uVwE7XILgCX0ejC9jmUuSQyRIo1dmOKiXFJeUjClfZb+ZNFbDUZgcF33lS4ddvD98f7u7jL5RWn56Sui48JsJLMu74fHHzOmJjNmHv2Hv2gX1kn9jnfRcHr50G3rYJviRJ20yhtyODSdRkKke5zh2Drcxc3todWoBHTXN1vG299OaWwXxldAmDwQCcjs5ckcbo5I12nUPOOtGqLorHtrSsyX/JN/hYcWnCIYNR1DKyWKBwYPQWhlSZecKGyWhBJVJX6tbv989Ld6DuqUTTS27jP3K7JDKKfpXRVTK5JEe0iBQbJZN/Jzb2xPY+s4RnkP6TApsOKOheoTq4nMyPtaM0U1vzpX5uz5LG7HppZ7JNrJe0abaN6KDVNeahBNfFtweEthMfC1y52783zb8TmtDvV0fGY7ae/qOXUzhXnPgBQVdyJQs0zSxZkABfUJBf0w2XwzntukkTCD9nHp2p1cYjFHJ5NNaV6+ZS0CciNzSFxsNgf+bnW+2q2v2QVi4LP5cIBvcLen8CkW8rEQ==).

I have no insights in the underlying architecture, but I already have
**some comments on my PR** (and I am willing to work on these, if I get
some feedback/hints):

* the **decompression happens synchronously** (`zlib.inflateSync`). This
can be changed easily, once I understand how async operations are done
for the compiler explorer software.
* the link is `/zclientstate/` (in addition to `/clientstate/`) - I am
open for alternatives...
* I have **not added automated tests** (could be done, give me a
hint/example)

The modified SW worked for me! I hope to get some feedback... **This
would enable larger code-examples to be sent via clientstate as before
with smaller URLs**.
2024-10-02 07:58:51 -05:00
Steve 30b77d380e IL: Fixes include path for Linux (#6922) 2024-10-01 14:32:19 +02:00
David Spickett 7f2c985a7f Flang: Remove flang-to-external-fc support and "new" from names (#6908) 2024-10-01 14:09:34 +02:00
Ofek f5f00606f8 Tsifications galore (#6916)
Still mostly mindless numb work, one rename that touched many files
(`getArgumentParser` -> `getArgumentParserCls`), and a few real
improvements.
The goal is to be able to turn on `noImplicitAny` for the project, to
enforce higher code quality. 600 violations to go.
2024-10-01 12:26:46 +03:00
Spencer FrickeandMatt Godbolt 69241006aa Add preliminary GLSL support (#6883)
Part of
https://github.com/compiler-explorer/compiler-explorer/issues/2331
Inspired by
https://github.com/compiler-explorer/compiler-explorer/pull/3932

I think it is great that HLSL has support here, but the lack of GLSL
support is what stops me from using Compiler-Explorer more often. LunarG
also have shown in our [yearly ecosystem
survey](https://www.lunarg.com/wp-content/uploads/2024/04/2024-Vulkan-Ecosystem-Survey-Results-04-04-2024.pdf)
that GLSL is very widely used in the GPU space

![image](https://github.com/user-attachments/assets/ec740d61-0bf4-42b2-8e51-c204819aba11)

A while ago I started to create [my own SPIR-V
tool](https://github.com/sjfricke/SPIRV-Playground) but was given
feedback to "please just spend your free-time efforts making
compiler-explorer better for SPIR-V instead" ... to which I agree (since
seems a LOT of ground work was already laid out for me 😄 )

So here it is, a working version of GLSL using `glslang` 🚀 


![image](https://github.com/user-attachments/assets/2fc67890-1cd2-4b7e-82c2-30ca135f8590)

I guess beside reviewing my very unused Typescript skills, I know we
will need to add things to the Infra repo to get things public. For that
I am not sure what the best course of action is, we do have [rolling
releases](https://github.com/KhronosGroup/glslang/releases/tag/main-tot)
of `glslang` as well as SDK version tags

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2024-09-30 22:19:55 -05:00
Ofek 7097a240a7 Introduce opt-pipeline for ClangIr (#6917)
Thank @Lancern for the CIR flags analogous to clang's
`--print-before|after-all.`


![cir](https://github.com/user-attachments/assets/78742d83-799d-40cd-bcef-7a2e69a83c54)
2024-09-30 22:11:30 -05:00
Jan KühleandMatt Godbolt f4619aa8c6 Update Python asm docs (#6903)
When playing with Python 3.12 in the compiler explorer, I noticed some
instructions don't have documentation. I think that's true for new
instructions in 3.12. This PR updates the asm docs and the docenizer.

Update Python docenizer to handle new dis.html formatting:

- The JUMP bytecode has no description (i.e. no `<p>` elements).

- Docs now often include code snippets in `<code>` or `<pre>` tags.
Sanitize HTML but keep some known tags.

- Exit when failing to parse dis.html rather than emitting new file
without any instructions.

- Fix check for existing dis.html file.

Not sure if HTML markup is desired. It feels easier to read to me. But
I'm happy to revert that, too.

Docs updated using:

./etc/scripts/docenizers/docenizer-python.py -o
lib/asm-docs/generated/asm-docs-python.ts

---

Here's a preview:

| Before | After |
| --- | --- |
|
![image](https://github.com/user-attachments/assets/b1ae4c5e-5854-46e5-8f36-4e692566d85d)
|
![image](https://github.com/user-attachments/assets/278d4e34-377f-4301-b7e2-01226c14ddc3)
|


---

`make check` passes. But I had to commit using `--no-verify`. The
precommit hook failed on line-files with one warning:

```
/usr/local/google/home/jankuehle/Code/compiler-explorer/lib/asm-docs/generated/asm-docs-python.ts
  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override
```



<!-- 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!
-->

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2024-09-30 22:11:04 -05:00
Steve ee2dc8ab00 Update asm parser and add support for IL and IL disassembler (#6856)
Supersedes #6842 

- We now have the upstream issue of `JitDisasmAssemblies` fixed. Enable
it for net9.0+.
- Update asm-parser to support CoreCLR and NativeAOT (Fixes #6833)
- Adding support for IL language
- Adding support for IL disassembler
- Fixes #6629
2024-09-29 13:15:47 -05:00
Partouf 6c66940109 bugfix fixIncompatibleOptions 2024-09-29 15:21:37 +02:00
Partouf bafe4f1969 bugfix overrides 2024-09-29 15:02:36 +02:00
Ofek f715dc2932 More tsification (#6877)
About half way through. Only 708 tsification errors to go..
2024-09-28 10:32:36 +03:00
kevinjeon-g d54e2baa8d Update OatCFGParser's jump target format (#6909)
We need to account for latest versions of dex2oat saving jump targets in
non-truncated form, for example,

(old) "b #+0x28 (addr 0x416c)" vs. (new) "b.hs #+0x24 (addr 0x00008074)"
2024-09-26 11:04:44 -05:00
kevinjeon-g 404a0114a3 Add CFG support to dex2oat (#6864)
This currently only covers the default arm64 output, and isn't
compatible with the custom '--full-output' flag. If there's demand for
it, both of these can be fixed by updating how the oatdump output is
parsed in OatCFGParser.
2024-09-24 14:34:40 -05:00
Patrick Quist 71eb1c3503 remove debug code 2024-09-12 18:56:55 +02:00
Sirui Mu a49dbc6dd7 Add ClangIR output for clangir compiler (#6798)
Currently the clangir compiler is implemented by a special clang variant
whose compilation options list gets appended with `-Xclang -fclangir
-Xclang -emit-cir`. This introduces a problem: we no longer gets access
to its LLVM IR output and assembly output because `-emit-cir` is an
exclusive option.

This patch resolves this problem by introducing a new ClangIR pane,
similar to the LLVM IR pane or Rust MIR pane. A new output kind named
`ClangIR` is added to the "Add new..." drop down menu and it toggles the
ClangIR pane. This patch then removes `-Xclang -emit-cir` from the
options list of the clangir compiler. The clangir compiler will then
output assembly code just like other clang compilers. The removed
options will be added back when compiled from the ClangIR pane.
2024-09-12 19:43:26 +03:00