[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-07 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > There are still quite a few references to UnqualPtrTy that you're not > changing yet are now wrong, no? > > ``` > $ git grep --count '\' origin/main clang > origin/main:clang/lib/CodeGen/CGAtomic.cpp:1 > origin/main:clang/lib/CodeGen/CGBlocks.cpp:1 >

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-07 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > And I still strongly urge renaming what this is, given it is _not_ the type > for an unqualified C `void *`, as one would normally expect given it's in > Clang. Perhaps DummyPtrTy? DummyPtrTy seems mnemonic / on point, but it might trigger antibodies from the LLVM side:)

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson requested changes to this pull request. Ah I did not realize there were so many uses remaining. I that case those probably need auditing/changing before this change can land. https://github.com/llvm/llvm-project/pull/94388

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-07 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: And I still strongly urge renaming what this is, given it is _not_ the type for an unqualified C `void *`, as one would normally expect given it's in Clang. https://github.com/llvm/llvm-project/pull/94388 ___ cfe-commits mailing list

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-07 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: There are still quite a few references to UnqualPtrTy that you're not changing yet are now wrong, no? https://github.com/llvm/llvm-project/pull/94388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-07 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson approved this pull request. This looks fine to me now, but I'd suggest a TODO comment that UnqualPtrTy should be removed in the future. https://github.com/llvm/llvm-project/pull/94388 ___ cfe-commits mailing list

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH 1/2] Unqualified `ptr`s should be truly unqualified, and not AS0

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH 1/2] Unqualified `ptr`s should be truly unqualified, and not AS0

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-06 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs.

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-06 Thread Alex Voicu via cfe-commits
@@ -51,9 +51,11 @@ struct CodeGenTypeCache { llvm::IntegerType *PtrDiffTy; }; + /// unqualified void* + llvm::PointerType *UnqualPtrTy; AlexVlx wrote: I'm not opposed to this in principle; might have some additional benefits in that it forces people

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Eli Friedman via cfe-commits
@@ -4656,14 +4656,14 @@ static void InitCatchParam(CodeGenFunction , auto catchRD = CatchType->getAsCXXRecordDecl(); CharUnits caughtExnAlignment = CGF.CGM.getClassPointerAlignment(catchRD); - llvm::Type *PtrTy = CGF.UnqualPtrTy; // addrspace 0 ok

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alexander Richardson via cfe-commits
@@ -51,9 +51,11 @@ struct CodeGenTypeCache { llvm::IntegerType *PtrDiffTy; }; + /// unqualified void* + llvm::PointerType *UnqualPtrTy; arichardson wrote: I'd argue we should just remove this variable, and the few cases that actually want AS0 can

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alexander Richardson via cfe-commits
@@ -4656,14 +4656,14 @@ static void InitCatchParam(CodeGenFunction , auto catchRD = CatchType->getAsCXXRecordDecl(); CharUnits caughtExnAlignment = CGF.CGM.getClassPointerAlignment(catchRD); - llvm::Type *PtrTy = CGF.UnqualPtrTy; // addrspace 0 ok

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/94388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs.

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx edited https://github.com/llvm/llvm-project/pull/94388 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx commented: > I don't think that assumption is currently true. I think it's also worth > clarifying what this thing is, and possibly renaming it, because > "unqualified" has C language level meaning that would contradict what it is > here. It's probably optimistic,

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-05 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > I think the point is there are two things going on here that people think of > as unqualified: > > 1. "Give me a pointer that's whatever `void *` is" > 2. "Give me a pointer in some address space just so I can put a global in > some metadata" > > The vast majority of the

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: I think the point is there are two things going on here that people think of as unqualified: 1. "Give me a pointer that's whatever `void *` is" 2. "Give me a pointer in some address space just so I can put a global in some metadata" The vast majority of the time we're talking

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: llvm::PointerType::getUnqual assumes pointers to addr-space 0 are "unqualified"... but the discussion on #88182 concluded that doesn't make sense: the "unqualified" address space is a target-specific choice, and address-space zero isn't required to have any meaning at

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: I don't think that assumption is currently true. I think it's also worth clarifying what this thing is, and possibly renaming it, because "unqualified" has C language level meaning that would contradict what it is here. https://github.com/llvm/llvm-project/pull/94388

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx updated https://github.com/llvm/llvm-project/pull/94388 >From cdf95a804614950167d2d4df227d06a86a70d4bb Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Tue, 4 Jun 2024 19:52:28 +0100 Subject: [PATCH] Unqualified `ptr`s should be truly unqualified, and not AS0 ptrs.

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Alex Voicu (AlexVlx) Changes At the moment we alias `UnqualPtrTy` with the other default AS pointer types, which means that for certain targets using it doesn't actually yield an unqualified pointer.

[clang] [clang][CodeGen] Make `UnqualPtrTy` truly unqualified (PR #94388)

2024-06-04 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/94388 At the moment we alias `UnqualPtrTy` with the other default AS pointer types, which means that for certain targets using it doesn't actually yield an unqualified pointer. This patch changes that so that it does