[clang] [compiler-rt] [lld] [llvm] [Coverage][WebAssembly] Add initial support for WebAssembly/WASI (PR #111332)

2024-10-07 Thread Sam Clegg via cfe-commits
@@ -451,6 +452,18 @@ void SharedFile::parse() { } } +/// Returns the alignment for a custom section. This is used to concatenate +/// custom sections with the same name into a single custom section. sbc100 wrote: We don't use the /// style comment anywhere

[clang] [compiler-rt] [lld] [llvm] [Coverage][WebAssembly] Add initial support for WebAssembly/WASI (PR #111332)

2024-10-07 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 commented: lld changes lgtm https://github.com/llvm/llvm-project/pull/111332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [lld] [llvm] [Coverage][WebAssembly] Add initial support for WebAssembly/WASI (PR #111332)

2024-10-07 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 edited https://github.com/llvm/llvm-project/pull/111332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [WebAssembly] Enable nontrapping-fptoint and bulk-memory by default. (PR #112049)

2024-10-15 Thread Sam Clegg via cfe-commits
@@ -2,7 +2,7 @@ ; RUN: llvm-as -o %t.o %s ; RUN: llvm-as -o %t2.o %S/Inputs/libcall-archive.ll ; RUN: llvm-ar rcs %t.a %t2.o -; RUN: wasm-ld -o %t %t.o %t.a +; RUN: wasm-ld -mllvm -mattr=-bulk-memory -o %t %t.o %t.a sbc100 wrote: I was thinking that might make

[clang] [lld] [llvm] [WebAssembly] Support the new "Lime1" CPU (PR #112035)

2024-11-20 Thread Sam Clegg via cfe-commits
@@ -854,9 +854,15 @@ and `-mbulk-memory` flags, which correspond to the [Bulk Memory Operations] and [Non-trapping float-to-int Conversions] language features, which are [widely implemented in engines]. +A new Lime1 target CPU is added, -mcpu=lime1. This CPU follows the defin

[clang] [lld] [llvm] [WebAssembly] Define call-indirect-overlong and bulk-memory-opt features (PR #117087)

2024-11-20 Thread Sam Clegg via cfe-commits
sbc100 wrote: > The short answer is that's what the [Lime1 CPU calls > it](https://github.com/WebAssembly/tool-conventions/blob/main/Lime.md#lime1) > 😄 . > > > Can you explain why you want call-indirect-overlong in lime1? Is it because > > you want to be able to link files compiles with multi

[clang] [lld] [llvm] [WebAssembly] Define call-indirect-overlong and bulk-memory-opt features (PR #117087)

2024-11-20 Thread Sam Clegg via cfe-commits
sbc100 wrote: Can you explain why you want `call-indirect-overlong` in lime1? Is it because you want to be able to link files compiles with multi-table? i.e. do you want/expect type relocations at every call_indirect site? If so then perhaps a better name might be `call-indirect-relocatabl

[clang] Reland "[clang] Add nuw attribute to GEPs (#105496)" (PR #107257)

2024-11-18 Thread Sam Clegg via cfe-commits
sbc100 wrote: I bisecting this emscripten (wasm32-unknown-emscripten) miscompile to this PR: https://github.com/emscripten-core/emscripten/issues/22794. It looks like llvm is generating a load with a negative office (which is not supported under wasm). There is a reproducer in that but and I

[clang] Reland "[clang] Add nuw attribute to GEPs (#105496)" (PR #107257)

2024-11-18 Thread Sam Clegg via cfe-commits
sbc100 wrote: I used `wasm-reduce` on the `.ll` file and it looks like you were correct. The result was: ``` target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" target triple = "wasm32-unknown-emscripten"

[clang] Reland "[clang] Add nuw attribute to GEPs (#105496)" (PR #107257)

2024-11-18 Thread Sam Clegg via cfe-commits
sbc100 wrote: Perhaps yes. Do you know of any way to reduce the input program into something we can try to inspect. The preprocessed C++ file is over 100,000 lines :-/ https://github.com/llvm/llvm-project/pull/107257 ___ cfe-commits mailing list cf

[clang] [lld] [llvm] [WebAssembly] Define call-indirect-overlong and bulk-memory-opt features (PR #117087)

2024-11-20 Thread Sam Clegg via cfe-commits
sbc100 wrote: > I guessed that since the "generic" CPU is already out there forcing various > binary decoders to support this feature, it wouldn't be controversial for > "lime1" to do it too. I do think its reasonable for all those decoders to support overlong LEBs. But I think I don't see

[clang] [llvm] [WebAssembly] Implement %llvm.thread.pointer intrinsic. NFC (PR #117817)

2024-11-26 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 updated https://github.com/llvm/llvm-project/pull/117817 >From 9578cf12c95d2511975b9ede6edb3bddc5f5da74 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 26 Nov 2024 16:38:00 -0800 Subject: [PATCH] [WebAssembly] Implement %llvm.thread.pointer intrinsic. NFC We can s

[clang] [llvm] [WebAssembly] Implement %llvm.thread.pointer intrinsic. NFC (PR #117817)

2024-11-26 Thread Sam Clegg via cfe-commits
sbc100 wrote: > > Generally LGTM; maybe we also want to add a test for > > `__builtin_thread_pointer` to clang/test/CodeGen/builtins-wasm.c > > I only see that testing in clang/test/CodeGen/builtins-arm64.c, most > platforms don't seem to test this. Done! https://github.com/llvm/llvm-project

[clang] [llvm] [WebAssembly] Implement %llvm.thread.pointer intrinsic. NFC (PR #117817)

2024-11-26 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 updated https://github.com/llvm/llvm-project/pull/117817 >From 933be68425babeefba6415f5aebc31b0f2d34265 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 26 Nov 2024 16:38:00 -0800 Subject: [PATCH] [WebAssembly] Implement %llvm.thread.pointer intrinsic. NFC We can s

[clang] [llvm] [WebAssembly] Support the new "Lime1" CPU (PR #112035)

2024-12-02 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 approved this pull request. https://github.com/llvm/llvm-project/pull/112035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WebAssembly] Enable extended-const feature by default (PR #127721)

2025-02-18 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 created https://github.com/llvm/llvm-project/pull/127721 None >From 6d8b255090f08835b8b6b22e7c3d2abfe5ef7531 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 18 Feb 2025 15:34:13 -0800 Subject: [PATCH] [WebAssembly] Enable extended-const feature by default --- cl

[clang] [clang][WebAssembly] Always have `-pthread` imply `--shared-memory` linker flag (PR #127939)

2025-02-24 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 closed https://github.com/llvm/llvm-project/pull/127939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][WebAssembly] Always have `-pthread` imply `--shared-memory` linker flag (PR #127939)

2025-02-20 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 updated https://github.com/llvm/llvm-project/pull/127939 >From 19e0415bfefa7724b8149e95a86adf960d786673 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 19 Feb 2025 17:26:41 -0800 Subject: [PATCH] [clang][WebAssembly] Always have `-pthread` imply `--shared-memory`

[clang] [clang][WebAssembly] Always have `-pthread` imply `--shared-memory` linker flag (PR #127939)

2025-02-20 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 updated https://github.com/llvm/llvm-project/pull/127939 >From e788e756cac0c7b6f78479adbaea1a86f8005fb6 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 19 Feb 2025 17:26:41 -0800 Subject: [PATCH] [clang][WebAssembly] Always have `-pthread` imply `--shared-memory`

[clang] [Wasm][Clang] Add __builtin_wasm_ref_is_null_extern (PR #139580)

2025-05-12 Thread Sam Clegg via cfe-commits
@@ -741,6 +741,12 @@ __externref_t externref_null() { // WEBASSEMBLY-NEXT: ret } +int externref_is_null(__externref_t arg) { + return __builtin_wasm_ref_is_null_extern(arg); + // WEBASSEMBLY: tail call i32 @llvm.wasm.ref.is_null.extern(ptr addrspace(10) %arg)

[clang] [Wasm][Clang] Add __builtin_wasm_ref_is_null_extern (PR #139580)

2025-05-12 Thread Sam Clegg via cfe-commits
@@ -52,14 +52,33 @@ static bool CheckWasmBuiltinArgIsInteger(Sema &S, CallExpr *E, } bool SemaWasm::BuiltinWasmRefNullExtern(CallExpr *TheCall) { - if (TheCall->getNumArgs() != 0) + if (TheCall->getNumArgs() != 0) { sbc100 wrote: Maybe a comment explaining

[clang] [WebAssembly][Clang] Add __builtin_wasm_ref_is_null_extern (PR #139580)

2025-05-13 Thread Sam Clegg via cfe-commits
https://github.com/sbc100 approved this pull request. https://github.com/llvm/llvm-project/pull/139580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Wasm][Clang] Add __builtin_wasm_ref_is_null_extern (PR #139580)

2025-05-12 Thread Sam Clegg via cfe-commits
sbc100 wrote: (Nit: We normally spell out `[WebAssembly]` in PR titles) https://github.com/llvm/llvm-project/pull/139580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2