[clang] [llvm] [WebAssembly] Refactor Wasm Reference Types as TargetExtType (PR #93428)

2024-05-26 Thread Paulo Matos via cfe-commits
pmatos wrote: > This is a re-application of #71540, with the hopes I can get some help from > @pmatos and others to finish it. Right now the > '../clang/test/CodeGen/WebAssembly/wasm-funcref.c' test fails with an > assertion trying to cast the target("wasm.funcref") instruction to a pointer.

[clang] [llvm] [WebAssembly] Refactor Wasm Reference Types as TargetExtType (PR #71540)

2023-11-17 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71540 >From 31adeded0d1767e1ce43fbfcba5fe72c4e34121d Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Tue, 7 Nov 2023 08:28:36 +0100 Subject: [PATCH 1/4] [WebAssembly] Refactor Wasm Reference Types as TargetExtType

[clang] [llvm] [WebAssembly] Refactor Wasm Reference Types as TargetExtType (PR #71540)

2023-11-07 Thread Paulo Matos via cfe-commits
pmatos wrote: > Very cool! LGTM so far. It's really nice that we can delete that entire pass > out of the backend. Where can I read more about these new target extension > types? There's not a lot but there's something here: https://llvm.org/docs/LangRef.html#target-extension-type and of

[polly] [llvm] [mlir] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-07 Thread Paulo Matos via cfe-commits
pmatos wrote: > Please also update existing uses in `lldb`. Buildbot failure: > https://lab.llvm.org/buildbot/#/builders/68/builds/63101 Please see https://github.com/llvm/llvm-project/pull/71561 https://github.com/llvm/llvm-project/pull/71029 ___

[clang] [llvm] [polly] [mlir] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-07 Thread Paulo Matos via cfe-commits
https://github.com/pmatos closed https://github.com/llvm/llvm-project/pull/71029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[mlir] [polly] [llvm] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-07 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71029 >From 0c939b18d795e2729dde8d5e0a4ee8fa6be145c7 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Fri, 3 Nov 2023 12:03:07 +0100 Subject: [PATCH] [NFC] Remove Type::getInt8PtrTy Replace this with

[clang] [llvm] [WebAssembly] Refactor Wasm Reference Types as TargetExtType (PR #71540)

2023-11-07 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71540 >From dfe73198afa1e18fc37b5d21a6a8e6e1e3261f88 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Tue, 7 Nov 2023 08:28:36 +0100 Subject: [PATCH 1/2] [WebAssembly] Refactor Wasm Reference Types as TargetExtType

[clang] [llvm] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

2023-11-07 Thread Paulo Matos via cfe-commits
pmatos wrote: Closing this as #71540 will implement the refactoring I mentioned earlier. Thank you for everyone's time commenting on this PR. https://github.com/llvm/llvm-project/pull/71069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

2023-11-07 Thread Paulo Matos via cfe-commits
https://github.com/pmatos closed https://github.com/llvm/llvm-project/pull/71069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [WebAssembly] Refactor Wasm Reference Types as TargetExtType (PR #71540)

2023-11-07 Thread Paulo Matos via cfe-commits
https://github.com/pmatos edited https://github.com/llvm/llvm-project/pull/71540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [WebAssembly] Refactor Wasm Reference Types as TargetExtType (PR #71540)

2023-11-07 Thread Paulo Matos via cfe-commits
https://github.com/pmatos edited https://github.com/llvm/llvm-project/pull/71540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [WebAssembly] Refactor Wasm Reference Types as TargetExtType (PR #71540)

2023-11-07 Thread Paulo Matos via cfe-commits
pmatos wrote: The current patch implements successfully all the refactoring needed for externref. I will work on funcref next. This refactoring was triggered by the discussion at #71069 . Also the issue #71388 is currently blocking this. I include a workaround in the current patch.

[llvm] [clang] [WebAssembly] Refactor Wasm Reference Types as TargetExtType (PR #71540)

2023-11-07 Thread Paulo Matos via cfe-commits
https://github.com/pmatos created https://github.com/llvm/llvm-project/pull/71540 Originally reference types were designed as pointers to different address spaces. More recently TargetExtType were added to LLVM IR making it easier to represent reference types. This refactoring gets rid of

[clang] [polly] [llvm] [mlir] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-07 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71029 >From fe3ed6bcc6eface6e7bfa3e9b043f8287dd129b0 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Fri, 3 Nov 2023 12:03:07 +0100 Subject: [PATCH 1/4] [NFC] Remove Type::getInt8PtrTy Replace this with

[llvm] [polly] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-06 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71029 >From fe3ed6bcc6eface6e7bfa3e9b043f8287dd129b0 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Fri, 3 Nov 2023 12:03:07 +0100 Subject: [PATCH 1/3] [NFC] Remove Type::getInt8PtrTy Replace this with

[llvm] [polly] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-06 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71029 >From fe3ed6bcc6eface6e7bfa3e9b043f8287dd129b0 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Fri, 3 Nov 2023 12:03:07 +0100 Subject: [PATCH 1/2] [NFC] Remove Type::getInt8PtrTy Replace this with

[llvm] [polly] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-06 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71029 >From fe3ed6bcc6eface6e7bfa3e9b043f8287dd129b0 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Fri, 3 Nov 2023 12:03:07 +0100 Subject: [PATCH] [NFC] Remove Type::getInt8PtrTy Replace this with

[clang] [llvm] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

2023-11-06 Thread Paulo Matos via cfe-commits
pmatos wrote: I am now investigating the use of TargetExtTypes to represent Wasm Reference Types. https://github.com/llvm/llvm-project/pull/71069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-06 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71029 >From bb652ca71a8f7ff5c362fef2fdf2d265fa77e45e Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Fri, 3 Nov 2023 12:03:07 +0100 Subject: [PATCH 1/2] [NFC] Remove Type::getInt8PtrTy Replace this with

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-06 Thread Paulo Matos via cfe-commits
@@ -1514,7 +1514,7 @@ static void CreateGCRelocates(ArrayRef LiveVariables, auto getGCRelocateDecl = [&](Type *Ty) { assert(isHandledGCPointerType(Ty, GC)); auto AS = Ty->getScalarType()->getPointerAddressSpace(); -Type *NewTy =

[llvm] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-03 Thread Paulo Matos via cfe-commits
pmatos wrote: I pushed forced a change using PointerType::getUnqual. Would this be more acceptable? It certainly looks cleaner to my eyes than having `PointerType::get(Ctx, 0)` everywhere. https://github.com/llvm/llvm-project/pull/71029 ___

[llvm] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-03 Thread Paulo Matos via cfe-commits
https://github.com/pmatos updated https://github.com/llvm/llvm-project/pull/71029 >From bb652ca71a8f7ff5c362fef2fdf2d265fa77e45e Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Fri, 3 Nov 2023 12:03:07 +0100 Subject: [PATCH] [NFC] Remove Type::getInt8PtrTy Replace this with

[llvm] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-03 Thread Paulo Matos via cfe-commits
pmatos wrote: > I have a similar concern with @arsenm about making the default address space > 0. Can't we just use the already existing `PointerType::getUnqual()`, instead > of introducing the default address space 0? True, we could indeed just call `PointerType::getUnqual()` instead of just

[llvm] [clang] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

2023-11-03 Thread Paulo Matos via cfe-commits
pmatos wrote: > @pmatos If you don't want to go all the way to target extension types, is it > possible to gracefully handle this in wasm's TTI cost model? Return an > invalid or very high cost in this case? Unfortunately that actually doesn't work. We never get to the point of calculating a

[clang] [llvm] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

2023-11-02 Thread Paulo Matos via cfe-commits
https://github.com/pmatos created https://github.com/llvm/llvm-project/pull/71069 Fixes #69894 . >From deb62d806b4bba983d771eb87c3188a3fc3d56d5 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Tue, 31 Oct 2023 09:01:25 +0100 Subject: [PATCH 1/2] [WebAssembly] Reftypes are not valid element

[llvm] [clang] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

2023-11-02 Thread Paulo Matos via cfe-commits
pmatos wrote: cc: @nikic @jcranmer-intel @tlively @asb I am looking for suggestions for a way forward on this. Issue #69894 triggers the SLPVectorizer that tries to create a vector of 2 externref and calculate its cost. Externref is a WebAssembly type currently represented as a pointer to a

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Paulo Matos via cfe-commits
https://github.com/pmatos edited https://github.com/llvm/llvm-project/pull/71029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Paulo Matos via cfe-commits
pmatos wrote: > Nit: can you add in the description that this is a follow-up from the opaque > pointer transition (having an explicit motivation helps read a patch). Thanks! you're right. done. https://github.com/llvm/llvm-project/pull/71029 ___

[clang] [llvm] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Paulo Matos via cfe-commits
pmatos wrote: > I still think all the defaulted address space parameters should be purged and > it only invites bugs. It's a regression to introduce a new defaulted argument. Understandable, although always writing `PointerType::get(Ctx, 0);` really looks weird given most of the time the

[llvm] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-02 Thread Paulo Matos via cfe-commits
https://github.com/pmatos created https://github.com/llvm/llvm-project/pull/71029 Replace this with PointerType::get(). Also adds AS = 0 as an optional argument to get() methods. >From 28745bc7877747f998f658ee2f661f8312c54814 Mon Sep 17 00:00:00 2001 From: Paulo Matos Date: Thu, 2 Nov 2023

[clang] 55aeb23 - [clang][WebAssembly] Implement support for table types and builtins

2023-06-10 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2023-06-10T15:53:13+02:00 New Revision: 55aeb23fe0084d930ecd7335092d712bd71694c7 URL: https://github.com/llvm/llvm-project/commit/55aeb23fe0084d930ecd7335092d712bd71694c7 DIFF: https://github.com/llvm/llvm-project/commit/55aeb23fe0084d930ecd7335092d712bd71694c7.diff

[clang] 9571a28 - [WebAssembly] Add tests ensuring rotates persist

2023-06-05 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2023-06-06T07:48:35+02:00 New Revision: 9571a28ee4e801a7796569d62fe037fc22cd65a4 URL: https://github.com/llvm/llvm-project/commit/9571a28ee4e801a7796569d62fe037fc22cd65a4 DIFF: https://github.com/llvm/llvm-project/commit/9571a28ee4e801a7796569d62fe037fc22cd65a4.diff

[clang] 481e202 - [clang][doc] Fix link to SYCL compiler design doc

2023-03-28 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2023-03-28T18:09:52+02:00 New Revision: 481e20252461e730f36fb221123a853eda27cafc URL: https://github.com/llvm/llvm-project/commit/481e20252461e730f36fb221123a853eda27cafc DIFF: https://github.com/llvm/llvm-project/commit/481e20252461e730f36fb221123a853eda27cafc.diff

[clang] 8d0c889 - [clang][WebAssembly] Initial support for reference type funcref in clang

2023-03-17 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2023-03-17T18:31:44+01:00 New Revision: 8d0c889752121e62e7258570c592b905f544d36f URL: https://github.com/llvm/llvm-project/commit/8d0c889752121e62e7258570c592b905f544d36f DIFF: https://github.com/llvm/llvm-project/commit/8d0c889752121e62e7258570c592b905f544d36f.diff

[clang] eb66833 - [clang][WebAssembly] Initial support for reference type externref in clang

2023-01-31 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2023-01-31T17:34:01+01:00 New Revision: eb66833d19573df97034a81279eda31b8d19815b URL: https://github.com/llvm/llvm-project/commit/eb66833d19573df97034a81279eda31b8d19815b DIFF: https://github.com/llvm/llvm-project/commit/eb66833d19573df97034a81279eda31b8d19815b.diff

[clang] 39d8597 - [clang] Fix typo in error message

2022-10-21 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2022-10-21T12:06:28+02:00 New Revision: 39d8597927a5887bcfde2229491d793f3edcedbd URL: https://github.com/llvm/llvm-project/commit/39d8597927a5887bcfde2229491d793f3edcedbd DIFF: https://github.com/llvm/llvm-project/commit/39d8597927a5887bcfde2229491d793f3edcedbd.diff

[clang] 0fdfeb0 - [WebAssembly] Update test to run it in opaque pointers mode

2022-06-23 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2022-06-23T14:16:33+02:00 New Revision: 0fdfeb0847dfbce9d5734f61c9fc16ed6f7dc17e URL: https://github.com/llvm/llvm-project/commit/0fdfeb0847dfbce9d5734f61c9fc16ed6f7dc17e DIFF: https://github.com/llvm/llvm-project/commit/0fdfeb0847dfbce9d5734f61c9fc16ed6f7dc17e.diff

[clang] 968be05 - [clang] Fix crash for sizeof on VLAs

2022-01-12 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2022-01-12T16:10:58+01:00 New Revision: 968be05b8fdc1d23c055cc4963230a89efbc5967 URL: https://github.com/llvm/llvm-project/commit/968be05b8fdc1d23c055cc4963230a89efbc5967 DIFF: https://github.com/llvm/llvm-project/commit/968be05b8fdc1d23c055cc4963230a89efbc5967.diff

[clang] 6d0c7bc - [WebAssembly] Implementation of table.get/set for reftypes in LLVM IR

2021-10-20 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2021-10-20T10:31:31+02:00 New Revision: 6d0c7bc17de85807c286f78571235b6658999faf URL: https://github.com/llvm/llvm-project/commit/6d0c7bc17de85807c286f78571235b6658999faf DIFF: https://github.com/llvm/llvm-project/commit/6d0c7bc17de85807c286f78571235b6658999faf.diff

[clang] 46667a1 - [WebAssembly] Implementation of global.get/set for reftypes in LLVM IR

2021-07-22 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2021-07-22T22:07:24+02:00 New Revision: 46667a10039b664b953eb70534c27627b35a267d URL: https://github.com/llvm/llvm-project/commit/46667a10039b664b953eb70534c27627b35a267d DIFF: https://github.com/llvm/llvm-project/commit/46667a10039b664b953eb70534c27627b35a267d.diff

[clang] 4facbf2 - [WebAssembly] Implementation of global.get/set for reftypes in LLVM IR

2021-07-02 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2021-07-02T09:46:28+02:00 New Revision: 4facbf213c51e4add2e8c19b08d5e58ad71c72de URL: https://github.com/llvm/llvm-project/commit/4facbf213c51e4add2e8c19b08d5e58ad71c72de DIFF: https://github.com/llvm/llvm-project/commit/4facbf213c51e4add2e8c19b08d5e58ad71c72de.diff

[clang] 31859f8 - Implementation of global.get/set for reftypes in LLVM IR

2021-06-10 Thread Paulo Matos via cfe-commits
Author: Paulo Matos Date: 2021-06-10T10:07:45+02:00 New Revision: 31859f896cf90d64904134ce7b31230f374c3fcc URL: https://github.com/llvm/llvm-project/commit/31859f896cf90d64904134ce7b31230f374c3fcc DIFF: https://github.com/llvm/llvm-project/commit/31859f896cf90d64904134ce7b31230f374c3fcc.diff

Re: [PATCH] D26843: Make sizeof expression context partially evaluated

2016-11-18 Thread Paulo Matos via cfe-commits
On 18/11/16 20:30, Aaron Ballman wrote: > On Fri, Nov 18, 2016 at 2:22 PM, Paulo Matos via cfe-commits > <cfe-commits@lists.llvm.org> wrote: >> pmatos added a comment. >> >> Apologies if I am being shallow and wasting your time but `sizeof(T::m)` >> does

[PATCH] D26843: Make sizeof expression context partially evaluated

2016-11-18 Thread Paulo Matos via cfe-commits
pmatos added a comment. Apologies if I am being shallow and wasting your time but `sizeof(T::m)` doesn't compile at the moment with clang trunk. Using the same service you used before . https://reviews.llvm.org/D26843

[PATCH] D26843: Make sizeof expression context partially evaluated

2016-11-18 Thread Paulo Matos via cfe-commits
pmatos added a comment. In https://reviews.llvm.org/D26843#599673, @EricWF wrote: > > But that is not valid in C afaik and in C++ I get: > > > > error: invalid use of non-static data member 'm' > > int x = sizeof(T::m); > >~~~^ > > > > > > Can you post a full

[PATCH] D26843: Make sizeof expression context partially evaluated

2016-11-18 Thread Paulo Matos via cfe-commits
pmatos added a comment. In https://reviews.llvm.org/D26843#599635, @EricWF wrote: > This isn't correct. For example this change breaks: > > struct T { int m; }; > int x = sizeof(T::m); > But that is not valid in C afaik and in C++ I get: error: invalid use of non-static data member 'm'

[PATCH] D26843: Make sizeof expression context partially evaluated

2016-11-18 Thread Paulo Matos via cfe-commits
pmatos created this revision. pmatos added a reviewer: efriedma. pmatos added a subscriber: cfe-commits. Ensure sizeof expression context is partially evaluated so that potential typeof operators inside are evaluated if necessary. Fixes PR31042. https://reviews.llvm.org/D26843 Files: