[llvm-branch-commits] [clang] [llvm] [lit] Make builtin cat work with stdin (PR #158447)

2025-09-13 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/158447 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AMDGPULowerBufferFatPointers] Handle ptrtoaddr by extending the offset (PR #139413)

2025-08-09 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139413 >From a2dec95d11a68c7911eef777ad78b07aa747bef5 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 15:35:50 -0700 Subject: [PATCH 1/2] remove fixme Created using spr 1.3.6-beta.1 --- .../

[llvm-branch-commits] [llvm] [AMDGPULowerBufferFatPointers] Handle ptrtoaddr by extending the offset (PR #139413)

2025-08-09 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139413 >From a2dec95d11a68c7911eef777ad78b07aa747bef5 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 15:35:50 -0700 Subject: [PATCH 1/2] remove fixme Created using spr 1.3.6-beta.1 --- .../

[llvm-branch-commits] [AMDGPU] Baseline test for ptrtoaddr in lower-buffer-fat-pointers (PR #143812)

2025-08-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/143812 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [AMDGPU] Baseline test for ptrtoaddr in lower-buffer-fat-pointers (PR #143812)

2025-08-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/143812 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [AMDGPULowerBufferFatPointers] Handle ptrtoaddr by extending the offset (PR #139413)

2025-08-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139413 >From a2dec95d11a68c7911eef777ad78b07aa747bef5 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 15:35:50 -0700 Subject: [PATCH 1/2] remove fixme Created using spr 1.3.6-beta.1 --- .../

[llvm-branch-commits] [llvm] [AMDGPULowerBufferFatPointers] Handle ptrtoaddr by extending the offset (PR #139413)

2025-08-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139413 >From a2dec95d11a68c7911eef777ad78b07aa747bef5 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 15:35:50 -0700 Subject: [PATCH 1/2] remove fixme Created using spr 1.3.6-beta.1 --- .../

[llvm-branch-commits] [llvm] [CaptureTracking] Handle ptrtoaddr (PR #152221)

2025-08-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/152221 >From a0dcd64920d736f158532ded1d3d6b324a4edfd8 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Tue, 5 Aug 2025 16:25:31 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=

[llvm-branch-commits] [CaptureTracking] Handle ptrtoaddr (PR #152221)

2025-08-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/152221 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [CaptureTracking] Handle ptrtoaddr (PR #152221)

2025-08-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/152221 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [CaptureTracking] Handle ptrtoaddr (PR #152221)

2025-08-08 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/152221 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-08-07 Thread Alexander Richardson via llvm-branch-commits
@@ -3532,6 +3533,28 @@ void Verifier::visitFPToSIInst(FPToSIInst &I) { visitInstruction(I); } +void Verifier::visitPtrToAddrInst(PtrToAddrInst &I) { + // Get the source and destination types + Type *SrcTy = I.getOperand(0)->getType(); + Type *DestTy = I.getType(); + + Ch

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-08-07 Thread Alexander Richardson via llvm-branch-commits
@@ -3532,6 +3533,28 @@ void Verifier::visitFPToSIInst(FPToSIInst &I) { visitInstruction(I); } +void Verifier::visitPtrToAddrInst(PtrToAddrInst &I) { + // Get the source and destination types + Type *SrcTy = I.getOperand(0)->getType(); + Type *DestTy = I.getType(); + + Ch

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-08-07 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-08-07 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [CaptureTracking] Handle ptrtoaddr (PR #152221)

2025-08-06 Thread Alexander Richardson via llvm-branch-commits
@@ -359,6 +359,11 @@ UseCaptureInfo llvm::DetermineUseCaptureKind(const Use &U, const Value *Base) { case Instruction::AddrSpaceCast: // The original value is not captured via this if the new value isn't. return UseCaptureInfo::passthrough(); + case Instruction::Ptr

[llvm-branch-commits] [llvm] [DataLayout][LangRef] Split non-integral and unstable pointer properties (PR #105735)

2025-08-04 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: > That sounds fine as long as the plan is to remove the isNonIntegralPointer() > method in the future, in favor of more precise checks. Yes that is absolutely the goal. Will try to update with these changes shortly. https://github.com/llvm/llvm-project/pull/105735 __

[llvm-branch-commits] [llvm] [DataLayout][LangRef] Split non-integral and unstable pointer properties (PR #105735)

2025-08-01 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: > Drop non-integral as a concept, but make `DL.isNonIntegralPointer()` do a > index width != address width check to preserve the old behavior Yes I was thinking of that option too and I think that is probably the best approach for now. Assuming we don't have any targets that

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-28 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-28 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
@@ -320,11 +320,13 @@ TEST_F(IR2VecTestFixture, GetInstVecMap) { EXPECT_TRUE(InstMap.count(AddInst)); EXPECT_TRUE(InstMap.count(RetInst)); - EXPECT_EQ(InstMap.at(AddInst).size(), 2u); - EXPECT_EQ(InstMap.at(RetInst).size(), 2u); + const auto &AddEmb = InstMap.at(AddInst

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/139357 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
@@ -66,7 +66,8 @@ "ExtractValue": [127, 128], "InsertValue": [129, 130], "LandingPad": [131, 132], -"Freeze": [133, 134] +"Freeze": [133, 134], +"PtrToAddr": [135, 136] arichardson wrote: @svkeerthy I have no ide

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson commented: Updated based on @nikic's feedback. Now the type needs to match and constant expressions are supported. Thanks for all the review - I'll wait another week for any further comments in case I missed something. https://github.com/llvm/llvm-project/pull/1

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [DataLayout][LangRef] Split non-integral and unstable pointer properties (PR #105735)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/105735 >From e4bd1181d160b8728e7d4158417a83e183bd1709 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Thu, 22 Aug 2024 14:36:04 -0700 Subject: [PATCH 1/5] fix indentation in langref Created using spr 1.3.6-be

[llvm-branch-commits] [llvm] [DataLayout][LangRef] Split non-integral and unstable pointer properties (PR #105735)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
@@ -650,48 +650,136 @@ literal types are uniqued in recent versions of LLVM. .. _nointptrtype: -Non-Integral Pointer Type -- +Non-Integral and Unstable Pointer Types +--- -Note: non-integral pointer types are a wor

[llvm-branch-commits] [NFCI][ELF][Mips] Replace MipsMultiGotPage with new RE_MIPS_OSEC_LOCAL_PAGE (PR #150810)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson approved this pull request. Looks NFC to me and is much cleaner. https://github.com/llvm/llvm-project/pull/150810 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[llvm-branch-commits] [NFCI][ELF] Merge AddendOnly and AddendOnlyWithTargetVA (PR #150797)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
@@ -422,13 +422,10 @@ class DynamicReloc { /// The resulting dynamic relocation has already had its addend computed. /// Calling computeAddend() is an error. Only for internal use. Computed, -/// The resulting dynamic relocation does not reference a symbol (#sym

[llvm-branch-commits] [NFCI][ELF] Merge AddendOnly and AddendOnlyWithTargetVA (PR #150797)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
@@ -422,13 +422,10 @@ class DynamicReloc { /// The resulting dynamic relocation has already had its addend computed. /// Calling computeAddend() is an error. Only for internal use. Computed, -/// The resulting dynamic relocation does not reference a symbol (#sym

[llvm-branch-commits] [NFCI][ELF] Merge AddendOnly and AddendOnlyWithTargetVA (PR #150797)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
@@ -422,13 +422,10 @@ class DynamicReloc { /// The resulting dynamic relocation has already had its addend computed. /// Calling computeAddend() is an error. Only for internal use. Computed, -/// The resulting dynamic relocation does not reference a symbol (#sym

[llvm-branch-commits] [NFCI][ELF] Merge AddendOnly and AddendOnlyWithTargetVA (PR #150797)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/150797 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [NFCI][ELF] Store DynamicReloc Kind as two bools (PR #150812)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/150812 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [NFCI][ELF] Introduce explicit Computed state for DynamicReloc (PR #150799)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson approved this pull request. This is much better. https://github.com/llvm/llvm-project/pull/150799 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llv

[llvm-branch-commits] [NFCI][ELF] Merge AgainstSymbol and AgainstSymbolWithTargetVA (PR #150798)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: Thanks for cleaning up https://reviews.llvm.org/D100490. It looks like I originally started that with a single boolean parameter for "sym/no sym" but it was quite confusing that way. I think all the cleanups that have happened since now makes this a feasible approach. http

[llvm-branch-commits] [NFC][ELF] Replace DynamicReloc::Kind with the equivalent bool in APIs (PR #150813)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson commented: Thanks for cleaning up my ugly https://reviews.llvm.org/D100490 in the previous commits :) I think having names for the boolean parameters makes the code calling this function easier to read than a magic true/false. So I'd have a slight preference for

[llvm-branch-commits] [NFC][ELF] Don't duplicate DynamicReloc constructor (PR #150811)

2025-07-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson approved this pull request. https://github.com/llvm/llvm-project/pull/150811 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-23 Thread Alexander Richardson via llvm-branch-commits
@@ -12505,6 +12505,61 @@ Example: %Y = ptrtoint ptr %P to i64; yields zero extension on 32-bit architecture %Z = ptrtoint <4 x ptr> %P to <4 x i64>; yields vector zero extension for a vector of addresses on 32-bit architecture +.. _i_ptrto

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-23 Thread Alexander Richardson via llvm-branch-commits
@@ -12505,6 +12505,61 @@ Example: %Y = ptrtoint ptr %P to i64; yields zero extension on 32-bit architecture %Z = ptrtoint <4 x ptr> %P to <4 x i64>; yields vector zero extension for a vector of addresses on 32-bit architecture +.. _i_ptrto

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-21 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: > I'd like to re-raise my comment about a lack of tests for vectors of pointers > (unless I missed some new ones) Ah sorry I missed that one, will add tests! https://github.com/llvm/llvm-project/pull/139357 ___ llvm-branch-commits

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-21 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: Now that 21 has branched, I plan to submit this by end of week unless there are any new comments. https://github.com/llvm/llvm-project/pull/139357 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-21 Thread Alexander Richardson via llvm-branch-commits
@@ -76,6 +76,10 @@ Changes to the LLVM IR guaranteed to start with a `bti` or `endbr64` instruction, where those exist. +* The `ptrtoaddr` instruction was introduced. This instruction returns the + address component of a pointer type variable but unlike `ptrtoint` does no

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-21 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-07-21 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [SDAG][AMDGPU] Allow opting in to OOB-generating PTRADD transforms (PR #146074)

2025-06-27 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson approved this pull request. Thanks, I like this hook and it should also work well for CHERI where similar constraints to CPA exist: you can go out of bounds by a specific amount (the exact range depends on the pointer bounds), but if you go too far the pointer be

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-20 Thread Alexander Richardson via llvm-branch-commits
@@ -4274,6 +4274,7 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) { case lltok::kw_bitcast: case lltok::kw_addrspacecast: case lltok::kw_inttoptr: + // ptrtoaddr not supported in constant exprs (yet?). arichardson wrote

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-20 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: ping. What can I do to push this forward? I would like to avoid making any further follow-up changes if there is any risk this would not land. @nikic are you still happy with the introduction of this instruction? https://github.com/llvm/llvm-project/pull/139357 _

[llvm-branch-commits] [WIP] Introduce a G_PTRTOADDR GIsel node (PR #140300)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: GISelValueTracking correctly implemented in #143816 and #143815 https://github.com/llvm/llvm-project/pull/140300 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[llvm-branch-commits] [WIP] Introduce a G_PTRTOADDR GIsel node (PR #140300)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
@@ -204,6 +207,10 @@ LegacyLegalizerInfo::getAspectAction(const InstrAspect &Aspect) const { if (Aspect.Type.isScalar() || Aspect.Type.isPointer()) return findScalarLegalAction(Aspect); assert(Aspect.Type.isVector()); + if (Aspect.Opcode == TargetOpcode::G_PTRTOADDR)

[llvm-branch-commits] [GISelValueTracking] Baseline test for G_PTRTOADDR (PR #143815)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/143815 None ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [GIselValueTracking] Correctly truncate/zext G_PTRTOADDR (PR #143816)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/143816 G_PTRTOADDR is defined to return a zero-extended pointer address, so in case of ptr addrspace(8) 48 bits follwed by zeroes. Fixes the PtrToAddrExt test case in knownbits-ptrtoaddr.mir.

[llvm-branch-commits] [WIP] Introduce a G_PTRTOADDR GIsel node (PR #140300)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/140300 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [WIP] Introduce a G_PTRTOADDR GIsel node (PR #140300)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/140300 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [IRTranslator] Handle ptrtoaddr (PR #139601)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139601 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [IRTranslator] Handle ptrtoaddr (PR #139601)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139601 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [SelectionDAGBuilder] Use address width when lowering ptrtoaddr (PR #139423)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139423 >From d4520dc202a500c80309cf09517b2a2823bf13ab Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 17:33:01 -0700 Subject: [PATCH] remove unused variable Created using spr 1.3.6-beta.1 ---

[llvm-branch-commits] [llvm] [SelectionDAGBuilder] Use address width when lowering ptrtoaddr (PR #139423)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139423 >From d4520dc202a500c80309cf09517b2a2823bf13ab Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 17:33:01 -0700 Subject: [PATCH] remove unused variable Created using spr 1.3.6-beta.1 ---

[llvm-branch-commits] [AMDGPU] Baseline test for ptrtoaddr code generation (PR #143813)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/143813 This is currently not correct as it uses the same code path as ptrtoint. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.ll

[llvm-branch-commits] [AMDGPU] Baseline test for ptrtoaddr in lower-buffer-fat-pointers (PR #143812)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/143812 We should only be extracting the 32-bit offset in the ptrtoaddr case. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.

[llvm-branch-commits] [llvm] [AMDGPULowerBufferFatPointers] Handle ptrtoaddr by extending the offset (PR #139413)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139413 >From a2dec95d11a68c7911eef777ad78b07aa747bef5 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 15:35:50 -0700 Subject: [PATCH] remove fixme Created using spr 1.3.6-beta.1 --- .../test

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [AMDGPULowerBufferFatPointers] Handle ptrtoaddr by extending the offset (PR #139413)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139413 >From a2dec95d11a68c7911eef777ad78b07aa747bef5 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 15:35:50 -0700 Subject: [PATCH 1/2] remove fixme Created using spr 1.3.6-beta.1 --- .../

[llvm-branch-commits] [llvm] [AMDGPULowerBufferFatPointers] Handle ptrtoaddr by extending the offset (PR #139413)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139413 >From a2dec95d11a68c7911eef777ad78b07aa747bef5 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sat, 10 May 2025 15:35:50 -0700 Subject: [PATCH] remove fixme Created using spr 1.3.6-beta.1 --- .../test

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-11 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-10 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-10 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: > Is this PR part of a stack or something? Yes there are follow-up change to make better use of the new instruction but this one can be reviewed standalone. The `spr` tool doesn't auto link related PRs, I can add some comments to link them here. #139601 #139423 https://git

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: Sorry for the delay here. Updated and hopefully addressed outstanding feedback https://github.com/llvm/llvm-project/pull/139357 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
@@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s arichardson wrote: I see 79 tests that use this, but can drop if you think it makes sense. https://github.com/llvm/llvm-project/pull/139357 _

[llvm-branch-commits] [GISelValueTracking] Add test case for G_PTRTOINT (PR #139608)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139608 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [GISelValueTracking] Add test case for G_PTRTOINT (PR #139608)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/139608 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [GISelValueTracking] Add test case for G_PTRTOINT (PR #139608)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139608 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [GISelValueTracking] Use representation size for G_PTRTOINT src width (PR #139608)

2025-06-09 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: Looks like this was fixed while I was busy with other things - https://github.com/llvm/llvm-project/pull/140213 changed this code to drop the invalid width usage. I'll update this PR to just add a test for the ptrtoint case. https://github.com/llvm/llvm-project/pull/139608

[llvm-branch-commits] [llvm] [AMDGPU][SDAG] Add ISD::PTRADD DAG combines (PR #142739)

2025-06-06 Thread Alexander Richardson via llvm-branch-commits
@@ -2627,6 +2629,93 @@ SDValue DAGCombiner::foldSubToAvg(SDNode *N, const SDLoc &DL) { return SDValue(); } +/// Try to fold a pointer arithmetic node. +/// This needs to be done separately from normal addition, because pointer +/// addition is not commutative. +SDValue DAGC

[llvm-branch-commits] [llvm] [AMDGPU][SDAG] Add ISD::PTRADD DAG combines (PR #142739)

2025-06-06 Thread Alexander Richardson via llvm-branch-commits
@@ -2627,6 +2629,93 @@ SDValue DAGCombiner::foldSubToAvg(SDNode *N, const SDLoc &DL) { return SDValue(); } +/// Try to fold a pointer arithmetic node. +/// This needs to be done separately from normal addition, because pointer +/// addition is not commutative. +SDValue DAGC

[llvm-branch-commits] [llvm] [AMDGPU][SDAG] Add tests for ISD::PTRADD DAG combines (PR #142738)

2025-06-04 Thread Alexander Richardson via llvm-branch-commits
@@ -0,0 +1,207 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -disable-separate-const-offset-from-gep=1 -amdgpu-use-sdag-ptradd=1 < %s | FileCheck --check-prefixes=GFX942,GFX942_PTRADD %s +; R

[llvm-branch-commits] [llvm] [AMDGPU][SDAG] Add ISD::PTRADD DAG combines (PR #142739)

2025-06-04 Thread Alexander Richardson via llvm-branch-commits
@@ -2627,6 +2629,93 @@ SDValue DAGCombiner::foldSubToAvg(SDNode *N, const SDLoc &DL) { return SDValue(); } +/// Try to fold a pointer arithmetic node. +/// This needs to be done separately from normal addition, because pointer +/// addition is not commutative. +SDValue DAGC

[llvm-branch-commits] [llvm] [AMDGPU][SDAG] Add ISD::PTRADD DAG combines (PR #142739)

2025-06-04 Thread Alexander Richardson via llvm-branch-commits
@@ -14935,6 +14936,52 @@ SDValue SITargetLowering::performAddCombine(SDNode *N, return SDValue(); } +SDValue SITargetLowering::performPtrAddCombine(SDNode *N, + DAGCombinerInfo &DCI) const { + SelectionDAG &DAG = DCI.DAG; + EVT

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-05-21 Thread Alexander Richardson via llvm-branch-commits
@@ -110,6 +110,7 @@ typedef enum { LLVMFPTrunc= 37, LLVMFPExt = 38, LLVMPtrToInt = 39, + LLVMPtrToAddr = 69, arichardson wrote: fneg and callbr also break the ordering - I think the intention in this file is to have them mat

[llvm-branch-commits] [GISelValueTracking] Use representation size for G_PTRTOINT src width (PR #139608)

2025-05-21 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: Thanks for the review, I'll update this to use a new baseline test that does not depend on the new ptrtoaddr. https://github.com/llvm/llvm-project/pull/139608 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org h

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-05-21 Thread Alexander Richardson via llvm-branch-commits
@@ -7,9 +7,9 @@ define i32 @nested(i32 %src) #0 { ; CHECK-SAME: i32 [[A0:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: [[BB15160:.*:]] ; CHECK-NEXT:[[T1:%.*]] = call token @llvm.experimental.convergence.entry() -; CHECK-NEXT:%"vl77672llvm.experimental.convergence.anchor()"

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-05-21 Thread Alexander Richardson via llvm-branch-commits
@@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s arichardson wrote: I copied this from another test so assumed there was a reason for it but not sure what that would be. https://github.com/llvm/llvm-project/pull/139357 __

[llvm-branch-commits] [AMDGPU] Set AS8 address width to 48 bits (PR #139419)

2025-05-19 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139419 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [AMDGPU] Set AS8 address width to 48 bits (PR #139419)

2025-05-19 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139419 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [GISelValueTracking] Use representation size for G_PTRTOINT src width (PR #139608)

2025-05-16 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: The current behaviour is definitely buggy since we lower G_PTRTOINT as a COPY node, but assume that it zeroes the upper bits for ptr addrspace(8). I think this patch is sufficient to prevent that issue. https://github.com/llvm/llvm-project/pull/139608 ___

[llvm-branch-commits] [WIP] Introduce a G_PTRTOADDR GIsel node (PR #140300)

2025-05-16 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/140300 None ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [IRTranslator] Handle ptrtoaddr (PR #139601)

2025-05-16 Thread Alexander Richardson via llvm-branch-commits
@@ -1583,6 +1583,26 @@ bool IRTranslator::translateCast(unsigned Opcode, const User &U, return true; } +bool IRTranslator::translatePtrToAddr(const User &U, + MachineIRBuilder &MIRBuilder) { + if (containsBF16Type(U)) +return false;

[llvm-branch-commits] [AMDGPU] Set AS8 address width to 48 bits (PR #139419)

2025-05-16 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: Is there anything else that needs to be changed on this PR? https://github.com/llvm/llvm-project/pull/139419 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-05-16 Thread Alexander Richardson via llvm-branch-commits
arichardson wrote: Should I clang-format the other files that use manual alignment to ensure that future additions don't fail the clang-format checker? https://github.com/llvm/llvm-project/pull/139357 ___ llvm-branch-commits mailing list llvm-branch-c

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-05-16 Thread Alexander Richardson via llvm-branch-commits
@@ -4904,13 +4907,43 @@ class PtrToIntInst : public CastInst { // Methods for support type inquiry through isa, cast, and dyn_cast: static bool classof(const Instruction *I) { -return I->getOpcode() == PtrToInt; +return I->getOpcode() == PtrToInt || I->getOpcode()

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-05-16 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-05-16 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139357 >From 25dc175562349410f161ef0e80246301d9a7ba79 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 May 2025 22:43:37 -0700 Subject: [PATCH] fix docs build Created using spr 1.3.6-beta.1 --- llvm/do

[llvm-branch-commits] [llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

2025-05-13 Thread Alexander Richardson via llvm-branch-commits
@@ -4904,13 +4907,43 @@ class PtrToIntInst : public CastInst { // Methods for support type inquiry through isa, cast, and dyn_cast: static bool classof(const Instruction *I) { -return I->getOpcode() == PtrToInt; +return I->getOpcode() == PtrToInt || I->getOpcode()

[llvm-branch-commits] [GISelValueTracking] Use representation size for G_PTRTOINT src width (PR #139608)

2025-05-13 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139608 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sa

[llvm-branch-commits] [GISelValueTracking] Use representation size for G_PTRTOINT src width (PR #139608)

2025-05-13 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139608 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sa

[llvm-branch-commits] [IRTranslator] Handle ptrtoaddr (PR #139601)

2025-05-13 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139601 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sa

[llvm-branch-commits] [IRTranslator] Handle ptrtoaddr (PR #139601)

2025-05-13 Thread Alexander Richardson via llvm-branch-commits
https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/139601 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sa

  1   2   3   >