halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.83k stars 1.07k forks source link

Integrate with Compiler Explorer #4712

Open alexreinking opened 4 years ago

alexreinking commented 4 years ago

As it says in the title. Would be very cool to integrate Halide with the online Compiler Explorer (AKA Godbolt). They're open source and pretty accepting of PRs.

Repo here: https://github.com/mattgodbolt/compiler-explorer

alexreinking commented 4 years ago

I spoke with Austin Morton on the cpplang Slack and he said they would be open to a PR that implements this.

They prefer binary releases, though they would consider a PR that automates building on their systems.

We would need to, on our end, get some more robust source mapping going, ie. track to which func/stage each LLVM instruction belongs

abadams commented 4 years ago

Do they realize that compiling Halide means compiling and running arbitrary user-supplied C++?

Why is attributing LLVM instructions to Funcs/Stages relevant? It's not clear to me that's even well-defined, with the way we fuse and specialize things. We can probably do it approximately using the current ProducerConsumer nodes.

alexreinking commented 4 years ago

Do they realize that compiling Halide means compiling and running arbitrary user-supplied C++?

I don't know if they're explicitly aware of it, but their executions are sandboxed pretty well. Compilers are generally pretty exciting attack vectors. I understand they have protections on the filesystem and against DoS attacks.

Why is attributing LLVM instructions to Funcs/Stages relevant? It's not clear to me that's even well-defined, with the way we fuse and specialize things. We can probably do it approximately using the current ProducerConsumer nodes.

Well, the idea would be someone enters Halide code on the left and sees the generated assembly on the right. It would want to color code corresponding C++/Halide source and instructions. Approximately is good enough. That's all you really get on -O3 in C/C++ anyway.