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

2024-11-21 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin edited https://github.com/llvm/llvm-project/pull/117087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-11-21 Thread Heejin Ahn via cfe-commits
@@ -310,6 +332,18 @@ bool WebAssemblyTargetInfo::handleTargetFeatures( << Feature << "-target-feature"; return false; } + + // The reference-types feature included the change to `call_indirect` + // encodings to support overlong immediates. + if (HasReferenceTy

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

2024-11-21 Thread Heejin Ahn via cfe-commits
@@ -79,6 +81,8 @@ void WebAssemblyTargetInfo::getTargetDefines(const LangOptions &Opts, Builder.defineMacro("__wasm_atomics__"); if (HasBulkMemory) Builder.defineMacro("__wasm_bulk_memory__"); + if (HasBulkMemoryOpt) +Builder.defineMacro("__wasm_bulk_memory_opt_

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

2024-11-21 Thread Heejin Ahn via cfe-commits
@@ -114,19 +122,20 @@ def : ProcessorModel<"mvp", NoSchedModel, []>; // consideration given to available support in relevant engines and tools, and // the importance of the features. def : ProcessorModel<"generic", NoSchedModel, - [FeatureBulkMemory, Featur

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

2024-11-21 Thread Heejin Ahn via cfe-commits
@@ -114,19 +122,20 @@ def : ProcessorModel<"mvp", NoSchedModel, []>; // consideration given to available support in relevant engines and tools, and // the importance of the features. def : ProcessorModel<"generic", NoSchedModel, - [FeatureBulkMemory, Featur

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

2024-11-21 Thread Heejin Ahn via cfe-commits
@@ -265,6 +279,14 @@ bool WebAssemblyTargetInfo::handleTargetFeatures( HasReferenceTypes = false; continue; } +if (Feature == "+call-indirect-overlong") { + HasCallIndirectOverlong = true; + continue; +} +if (Feature == "-call-indirect-over

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

2024-11-21 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin edited https://github.com/llvm/llvm-project/pull/117087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-11-21 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin commented: All of the below are nits on feature name ordering: https://github.com/llvm/llvm-project/pull/117087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

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

2024-11-21 Thread Heejin Ahn via cfe-commits
@@ -34,6 +34,15 @@ WebAssemblySubtarget::initializeSubtargetDependencies(StringRef CPU, CPU = "generic"; ParseSubtargetFeatures(CPU, /*TuneCPU*/ CPU, FS); + + // reference-types implies call-indirect-overlong + if (HasReferenceTypes) +HasCallIndirectOverlong = tru

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

2024-11-21 Thread Heejin Ahn via cfe-commits
@@ -114,19 +122,20 @@ def : ProcessorModel<"mvp", NoSchedModel, []>; // consideration given to available support in relevant engines and tools, and // the importance of the features. def : ProcessorModel<"generic", NoSchedModel, - [FeatureBulkMemory, Featur

[clang] [WebAssembly] Enable Wasm EH features only once (PR #124042)

2025-01-23 Thread Heejin Ahn via cfe-commits
aheejin wrote: @llvm-ci The failure seems irrelevant. https://github.com/llvm/llvm-project/pull/124042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly] Fix EH feature flags when compiling multiple files (PR #124374)

2025-01-24 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin closed https://github.com/llvm/llvm-project/pull/124374 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly] Fix EH feature flags when compiling multiple files (PR #124374)

2025-01-24 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin created https://github.com/llvm/llvm-project/pull/124374 #124042 caused a problem that when invoking `clang` with multiple files, the static `HasRun` variables were set when processing the first file so the appropriate feature flags were not added from the second fi

[clang] [WebAssembly] Enable Wasm EH features only once (PR #124042)

2025-01-23 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin closed https://github.com/llvm/llvm-project/pull/124042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly] Refactor Wasm EH/SjLj error checking (PR #122466)

2025-01-10 Thread Heejin Ahn via cfe-commits
@@ -120,26 +120,33 @@ // RUN: | FileCheck -check-prefix=EMSCRIPTEN_EH_ALLOWED_WO_ENABLE %s // EMSCRIPTEN_EH_ALLOWED_WO_ENABLE: invalid argument '-mllvm -emscripten-cxx-exceptions-allowed' only allowed with '-mllvm -enable-emscripten-cxx-exceptions' -// '-fwasm-exceptions'

[clang] [WebAssembly] Refactor Wasm EH/SjLj error checking (PR #122466)

2025-01-10 Thread Heejin Ahn via cfe-commits
@@ -154,46 +161,46 @@ // WASM_EXCEPTIONS_NO_REFERENCE_TYPES: invalid argument '-fwasm-exceptions' not allowed with '-mno-reference-types' // '-mllvm -wasm-enable-sjlj' sets +exception-handling, +multivalue, -// +reference-types and '-exception-model=wasm' +// +reference-type

[clang] [WebAssembly] Refactor Wasm EH/SjLj error checking (PR #122466)

2025-01-10 Thread Heejin Ahn via cfe-commits
@@ -120,26 +120,33 @@ // RUN: | FileCheck -check-prefix=EMSCRIPTEN_EH_ALLOWED_WO_ENABLE %s // EMSCRIPTEN_EH_ALLOWED_WO_ENABLE: invalid argument '-mllvm -emscripten-cxx-exceptions-allowed' only allowed with '-mllvm -enable-emscripten-cxx-exceptions' -// '-fwasm-exceptions'

[clang] [WebAssembly] Refactor Wasm EH/SjLj error checking (PR #122466)

2025-01-10 Thread Heejin Ahn via cfe-commits
@@ -413,53 +422,11 @@ void WebAssembly::addClangTargetOptions(const ArgList &DriverArgs, } } -if (Opt.starts_with("-wasm-enable-sjlj")) { - // '-mllvm -wasm-enable-sjlj' is not compatible with - // '-mno-exception-handling' - if (DriverArgs.hasFla

[clang] [WebAssembly] Refactor Wasm EH/SjLj error checking (PR #122466)

2025-01-10 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin created https://github.com/llvm/llvm-project/pull/122466 There were many overlaps between error checking and feature enabling routines for Wasm EH and Wasm SjLj. This tries to factor out those common routines in separate lambda functions. This is not NFC because thi

[clang] [WebAssembly] Refactor Wasm EH/SjLj error checking (PR #122466)

2025-01-10 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin closed https://github.com/llvm/llvm-project/pull/122466 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly] Add error checking for -wasm-use-legacy-ch (PR #122526)

2025-01-10 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin created https://github.com/llvm/llvm-project/pull/122526 This adds checks for `-wasm-use-legacy-eh`. While this option is true by default in the backend, it is not supposed to be given to the Clang when Wasm EH is not used. >From 0a64591d452b5f79d911d4a4ce36016761df

[clang] [WebAssembly] Generate invokes with llvm.wasm.(re)throw (PR #128105)

2025-02-24 Thread Heejin Ahn via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions -fcxx-exceptions -target-feature +reference-types -target-feature +exception-handling -target-feature +multivalue -exception-model=wasm -emit-llvm -o - %s | FileCheck %s + +// Check if __builtin_wa

[clang] [WebAssembly] Generate invokes with llvm.wasm.(re)throw (PR #128105)

2025-02-24 Thread Heejin Ahn via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions -fcxx-exceptions -target-feature +reference-types -target-feature +exception-handling -target-feature +multivalue -exception-model=wasm -emit-llvm -o - %s | FileCheck %s + +// Check if __builtin_wa

[clang] [WebAssembly] Generate invokes with llvm.wasm.(re)throw (PR #128105)

2025-02-25 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin closed https://github.com/llvm/llvm-project/pull/128105 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly] Generate invokes with llvm.wasm.(re)throw (PR #128105)

2025-02-25 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin updated https://github.com/llvm/llvm-project/pull/128105 >From 8702f84a3f3271e97bc963e997b9f441f05e83da Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Thu, 20 Feb 2025 22:23:33 + Subject: [PATCH] [WebAssembly] Generate invokes with llvm.wasm.(re)throw Even thoug

[clang] [WebAssembly] Generate __clang_call_terminate for Emscripten EH (PR #129020)

2025-02-27 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin created https://github.com/llvm/llvm-project/pull/129020 When an exception thrown ends up calling `std::terminate`, for example, because an exception is thrown within a `noexcept` function or an exception is thrown from `__cxa_end_catch` during handling the previous

[clang] [clang][docs] Fix typos concerning wasm __funcref (PR #124365)

2025-02-18 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin closed https://github.com/llvm/llvm-project/pull/124365 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly] Rename functions in wasm-eh.cpp (PR #130220)

2025-03-07 Thread Heejin Ahn via cfe-commits
aheejin wrote: @llvm-ci The CI failure does not look relevant. https://github.com/llvm/llvm-project/pull/130220 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly] Rename functions in wasm-eh.cpp (PR #130220)

2025-03-06 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin created https://github.com/llvm/llvm-project/pull/130220 I think it is generally better for tests have some descriptive function names so that we can insert new tests in the middle and don't have to renumber all tests. Also recently I added a (named) test to this fi

[clang] [WebAssembly] Rename functions in wasm-eh.cpp (PR #130220)

2025-03-07 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin closed https://github.com/llvm/llvm-project/pull/130220 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly] Generate __clang_call_terminate for Emscripten EH (PR #129020)

2025-02-27 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin updated https://github.com/llvm/llvm-project/pull/129020 >From 92861b903905d4f3d2fa39772033282b2dbad758 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Thu, 27 Feb 2025 03:09:45 + Subject: [PATCH 1/3] [WebAssembly] Generate __clang_call_terminate for Emscripten E

[clang] [WebAssembly] Generate __clang_call_terminate for Emscripten EH (PR #129020)

2025-02-27 Thread Heejin Ahn via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fexceptions -fcxx-exceptions -emit-llvm -o - -std=c++11 2>&1 | FileCheck %s aheejin wrote: We don't do anything differently wrt EH depending on whether it is `unknown` or `emscripten` tripl

[clang] [WebAssembly] Generate __clang_call_terminate for Emscripten EH (PR #129020)

2025-02-27 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin updated https://github.com/llvm/llvm-project/pull/129020 >From 92861b903905d4f3d2fa39772033282b2dbad758 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Thu, 27 Feb 2025 03:09:45 + Subject: [PATCH 1/2] [WebAssembly] Generate __clang_call_terminate for Emscripten E

[clang] [WebAssembly] Generate __clang_call_terminate for Emscripten EH (PR #129020)

2025-02-27 Thread Heejin Ahn via cfe-commits
@@ -5150,9 +5150,14 @@ WebAssemblyCXXABI::emitTerminateForUnexpectedException(CodeGenFunction &CGF, // Itanium ABI calls __clang_call_terminate(), which __cxa_begin_catch() on // the violating exception to mark it handled, but it is currently hard to do // with wasm EH i

[clang] [WebAssembly] Generate __clang_call_terminate for Emscripten EH (PR #129020)

2025-02-27 Thread Heejin Ahn via cfe-commits
https://github.com/aheejin closed https://github.com/llvm/llvm-project/pull/129020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4