[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/145059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-16 Thread Nikita Popov via cfe-commits
@@ -114,6 +114,10 @@ class LLVM_ABI Pass { /// Registration templates, but can be overloaded directly. virtual StringRef getPassName() const; + /// Return a nice clean name for a pass + /// corresponding to that used to enable the pass in opt nikic wrote

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/145059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr] Add release note & update option (PR #148244)

2025-07-14 Thread Nikita Popov via cfe-commits
nikic wrote: Needs a rebase though, otherwise CI won't run :) https://github.com/llvm/llvm-project/pull/148244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr] Add release note & update option (PR #148244)

2025-07-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/148244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr] Add release note & update option (PR #148244)

2025-07-11 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: clang/test/DebugInfo/KeyInstructions/flag.cpp is failing. https://github.com/llvm/llvm-project/pull/148244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,523 @@ +//===- X86.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -76,6 +80,43 @@ class VoidType : public Type { static bool classof(const Type *T) { return T->getKind() == TypeKind::Void; } }; +class ComplexType : public Type { +public: + ComplexType(const Type *ElementType, uint64_t SizeInBits, Align Alignment) + : Type(TypeKind

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -229,6 +231,7 @@ QualTypeMapper::convertCXXRecordType(const CXXRecordDecl *RD) { 8; Fields.emplace_back(BaseType, BaseOffset); +BaseClasses.emplace_back(BaseType, BaseOffset); nikic wrote: Looks like this adds base types *both* to BaseClas

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -76,6 +80,43 @@ class VoidType : public Type { static bool classof(const Type *T) { return T->getKind() == TypeKind::Void; } }; +class ComplexType : public Type { +public: + ComplexType(const Type *ElementType, uint64_t SizeInBits, Align Alignment) + : Type(TypeKind

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -86,6 +91,16 @@ StringRef Pass::getPassName() const { return "Unnamed pass: implement Pass::getPassName()"; } +/// getPassArgument - Return a nice clean name for a pass +/// corresponding to that used to enable the pass in opt +StringRef Pass::getPassArgument() const { +

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -55,4 +72,29 @@ bool OptBisect::shouldRunPass(StringRef PassName, return ShouldRun; } -OptPassGate &llvm::getGlobalPassGate() { return getOptBisector(); } +static void printDisablePassMessage(const StringRef &Name, StringRef TargetDesc, +

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -62,8 +62,13 @@ static std::string getDescription(const Module &M) { bool ModulePass::skipModule(const Module &M) const { const OptPassGate &Gate = M.getContext().getOptPassGate(); + + StringRef PassName = this->getPassArgument(); nikic wrote: ```sugges

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -114,6 +114,10 @@ class LLVM_ABI Pass { /// Registration templates, but can be overloaded directly. virtual StringRef getPassName() const; + /// getPassArgument - Return a nice clean name for a pass nikic wrote: ```suggestion /// Return a nice clean

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Looks reasonable https://github.com/llvm/llvm-project/pull/145059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/145059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-10 Thread Nikita Popov via cfe-commits
@@ -114,6 +114,10 @@ class LLVM_ABI Pass { /// Registration templates, but can be overloaded directly. virtual StringRef getPassName() const; + /// getPassArgument - Return a nice clean name for a pass + /// corresponding to that used to enable the pass in opt + virtual

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-07-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Can you please undo the unrelated formatting changes? It's hard to see what actually changed, especially inside StandardInstrumentations.cpp. https://github.com/llvm/llvm-project/pull/145059 ___ cfe-commits mailing

[clang] [llvm] [PowerPC][AIX] Specify correct ABI alignment for double (PR #144673)

2025-07-08 Thread Nikita Popov via cfe-commits
nikic wrote: @amy-kwan Just wanted to check back whether you found out anything more about the test issues? https://github.com/llvm/llvm-project/pull/144673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [Clang][Wasm] Set __float128 alignment to 64 for emscripten (PR #146494)

2025-07-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/146494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [DenseMap] Do not align pointer sentinel values (NFC) (PR #146595)

2025-07-07 Thread Nikita Popov via cfe-commits
nikic wrote: Reverted this due to ubsan errors like: > /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/IR/ValueHandle.h:286:64: > runtime error: upcast of misaligned address 0x for type > 'llvm::BasicBlock', which requires 8 byte alignment The problem

[clang] c3c3919 - Revert "[DenseMap] Do not align pointer sentinel values (NFC) (#146595)"

2025-07-07 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2025-07-07T15:15:47+02:00 New Revision: c3c3919dc2d37d62e539376679feed7aaf799259 URL: https://github.com/llvm/llvm-project/commit/c3c3919dc2d37d62e539376679feed7aaf799259 DIFF: https://github.com/llvm/llvm-project/commit/c3c3919dc2d37d62e539376679feed7aaf799259.diff

[clang] [llvm] [mlir] [DenseMap] Do not align pointer sentinel values (NFC) (PR #146595)

2025-07-07 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/146595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [DenseMap] Do not align pointer sentinel values (NFC) (PR #146595)

2025-07-07 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/146595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [DenseMap] Do not align pointer sentinel values (NFC) (PR #146595)

2025-07-07 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/146595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [DenseMap] Do not align pointer sentinel values (NFC) (PR #146595)

2025-07-07 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/146595 >From 28d67e3da912a0f6b09921874d1beb35a0548816 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 1 Jul 2025 13:51:43 +0200 Subject: [PATCH 1/3] [DenseMap] Do not align pointer sentinel values (NFC) DenseMapI

[clang] [llvm] Add __attribute__((visibility("default"))) attribute to certain symbols to stop them being hidden when linking clangInterpreter library to other libraries during Emscripten build (PR #1

2025-07-03 Thread Nikita Popov via cfe-commits
nikic wrote: > Also, this is separate to the issue to making a Windows Shared library issue > here #109483 (this purely based on your comment that ' the annotation effort > hasn't progressed to them yet') That same work also enables building libLLVM/libclang with `-fvisibilty=hidden`, which i

[clang] [llvm] Add __attribute__((visibility("default"))) attribute to certain symbols to stop them being hidden when linking clangInterpreter library to other libraries during Emscripten build (PR #1

2025-07-03 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: I'm super confused by what you are doing here. Most of the symbols you are annotating here are not inline and shouldn't be affected by `-fvisibility-inlines-hidden`. Some of them have already been annotated as LLVM_ABI in the header (and some of them haven't

[clang] [llvm] [mlir] [DenseMap] Do not align pointer sentinel values (NFC) (PR #146595)

2025-07-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/146595 >From 8bfa43c61c47c978ddcba509f22cf0a605b83fa0 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 1 Jul 2025 13:51:43 +0200 Subject: [PATCH 1/3] [DenseMap] Do not align pointer sentinel values (NFC) DenseMapI

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-02 Thread Nikita Popov via cfe-commits
@@ -17,19 +17,50 @@ #include "llvm/ABI/ABIFunctionInfo.h" #include "llvm/ABI/Types.h" #include +#include +#include namespace llvm { namespace abi { +struct ABICompatInfo { + unsigned Version = UINT_MAX; + + struct ABIFlags { +bool PassInt128VectorsInMem : 1; +

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-02 Thread Nikita Popov via cfe-commits
@@ -825,6 +831,47 @@ void computeSPIRKernelABIInfo(CodeGenModule &CGM, CGFunctionInfo &FI); } } // namespace clang +ABIArgInfo CodeGenTypes::convertABIArgInfo(const llvm::abi::ABIArgInfo &abiInfo, + QualType type) { + ABIArgInfo res

[clang] [llvm] [DenseMap] Do not align pointer sentinel values (NFC) (PR #146595)

2025-07-02 Thread Nikita Popov via cfe-commits
nikic wrote: > Do you know if this runs into issues with undefined behavior? I don't know > the exact rules, but remember reading something along the lines that some OOB > pointers cannot even be compared without running into UB. Having pointers > that don't respect type alignment sounds like

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-02 Thread Nikita Popov via cfe-commits
@@ -871,20 +928,50 @@ const CGFunctionInfo &CodeGenTypes::arrangeLLVMFunctionInfo( } else if (info.getCC() == CC_Swift || info.getCC() == CC_SwiftAsync) { swiftcall::computeABIInfo(CGM, *FI); } else { -CGM.getABIInfo().computeInfo(*FI); +if (isBPF) + CGM.f

[clang] [llvm] [DenseMap] Do not align pointer sentinel values (NFC) (PR #146595)

2025-07-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/146595 >From 8bfa43c61c47c978ddcba509f22cf0a605b83fa0 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 1 Jul 2025 13:51:43 +0200 Subject: [PATCH 1/2] [DenseMap] Do not align pointer sentinel values (NFC) DenseMapI

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-02 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,69 @@ +//===- ABIInfo.h - ABI information access & encapsulation - C++ ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-02 Thread Nikita Popov via cfe-commits
@@ -825,6 +831,47 @@ void computeSPIRKernelABIInfo(CodeGenModule &CGM, CGFunctionInfo &FI); } } // namespace clang +ABIArgInfo CodeGenTypes::convertABIArgInfo(const llvm::abi::ABIArgInfo &abiInfo, + QualType type) { + ABIArgInfo res

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-02 Thread Nikita Popov via cfe-commits
@@ -849,6 +896,7 @@ const CGFunctionInfo &CodeGenTypes::arrangeLLVMFunctionInfo( void *insertPos = nullptr; CGFunctionInfo *FI = FunctionInfos.FindNodeOrInsertPos(ID, insertPos); + llvm::abi::ABIFunctionInfo *tempFI; nikic wrote: Move down to initializat

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-07-02 Thread Nikita Popov via cfe-commits
@@ -825,6 +831,47 @@ void computeSPIRKernelABIInfo(CodeGenModule &CGM, CGFunctionInfo &FI); } } // namespace clang +ABIArgInfo CodeGenTypes::convertABIArgInfo(const llvm::abi::ABIArgInfo &abiInfo, + QualType type) {

[clang] [Clang] Verify data layout consistency (PR #144720)

2025-07-01 Thread Nikita Popov via cfe-commits
nikic wrote: I've put up https://github.com/llvm/llvm-project/pull/146494 for the wasm f128 alignment. https://github.com/llvm/llvm-project/pull/144720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [Clang][Wasm] Set __float128 alignment to 64 for emscripten (PR #146494)

2025-07-01 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/146494 https://reviews.llvm.org/D104808 set the alignment of long double to 64 bits. This is also the alignment specified in the LLVM data layout. However, the alignment of __float128 was left at 128 bits. I assume tha

[clang] [Clang] Verify data layout consistency (PR #144720)

2025-07-01 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/144720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Partially fix m68k alignments (PR #144740)

2025-07-01 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/144740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Verify data layout consistency (PR #144720)

2025-07-01 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/144720 >From af31642573b26c0f987b89148b65854ea2f5919a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 18 Jun 2025 14:48:19 +0200 Subject: [PATCH 1/2] [Clang] Verify data layout consistency Verify that the alignme

[clang] [libc] [llvm] [DebugInfo][RemoveDIs] Suppress getNextNonDebugInfoInstruction (PR #144383)

2025-06-30 Thread Nikita Popov via cfe-commits
nikic wrote: Reverse ping :) https://github.com/llvm/llvm-project/pull/144383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Partially fix m68k alignments (PR #144740)

2025-06-30 Thread Nikita Popov via cfe-commits
nikic wrote: Ping :) https://github.com/llvm/llvm-project/pull/144740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm] Enable LLVM_LINK_LLVM_DYLIB by default on non-Windows platforms (PR #138187)

2025-06-30 Thread Nikita Popov via cfe-commits
@@ -20,7 +20,6 @@ target_link_libraries(CoreTests LLVMBOLTRewrite LLVMBOLTProfile LLVMBOLTUtils - LLVMTestingSupport ) nikic wrote: Should split this into a separate PR. Worth noting that https://github.com/llvm/llvm-project/pull/145448 has an alter

[clang] [llvm] [EarlyCSE] Add support for writeonly call CSE (PR #145474)

2025-06-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/145474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Verify data layout consistency (PR #144720)

2025-06-27 Thread Nikita Popov via cfe-commits
nikic wrote: Ping :) https://github.com/llvm/llvm-project/pull/144720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Verify data layout consistency (PR #144720)

2025-06-27 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/144720 >From 4a70541ed734969f0db13c6fdf76c79702cc2b6e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 18 Jun 2025 14:48:19 +0200 Subject: [PATCH] [Clang] Verify data layout consistency Verify that the alignments

[clang] [llvm] [EarlyCSE] Add support for writeonly call CSE (PR #145474)

2025-06-27 Thread Nikita Popov via cfe-commits
nikic wrote: Skipping memsets for now. I added a PhaseOrdering test in https://github.com/llvm/llvm-project/commit/ec150a9944b2ce447c94944043fe1b87234e971f. I think what we're mainly missing is store sinking support in DSE. https://github.com/llvm/llvm-project/pull/145474 _

[clang] [llvm] [EarlyCSE] Add support for writeonly call CSE (PR #145474)

2025-06-27 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/145474 >From 3d51cf4796fe5f1e1577ce23f2970975bd216157 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 24 Jun 2025 10:08:40 +0200 Subject: [PATCH 1/4] [EarlyCSE] Add tests for writeonly --- llvm/test/Transforms/E

[clang] [llvm] Triple: Forward declare Twine and remove include (PR #145685)

2025-06-25 Thread Nikita Popov via cfe-commits
@@ -349,7 +350,12 @@ class Triple { /// triple fields unknown. Triple() = default; + LLVM_ABI explicit Triple(std::string &&Str); nikic wrote: Probably my C++-foo is not strong enough, but I thought that doing a by-value pass + std::move gives you the s

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-25 Thread Nikita Popov via cfe-commits
@@ -164,7 +164,8 @@ QualTypeMapper::convertArrayType(const clang::ArrayType *AT) { /// \return LLVM ABI VectorType with element type, count, and alignment const llvm::abi::Type *QualTypeMapper::convertVectorType(const VectorType *VT) { const llvm::abi::Type *ElementType = c

[clang] [llvm] Triple: Forward declare Twine and remove include (PR #145685)

2025-06-25 Thread Nikita Popov via cfe-commits
@@ -349,7 +350,12 @@ class Triple { /// triple fields unknown. Triple() = default; + LLVM_ABI explicit Triple(std::string &&Str); nikic wrote: Why `std::string &&` and `const std::string &` rather than one `std::string` ctor? https://github.com/llvm/ll

[clang] [llvm] [EarlyCSE] Add support for writeonly call CSE (PR #145474)

2025-06-25 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/145474 >From 295dc3520fb98c4a94263f1926f2e97764c8f442 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 24 Jun 2025 10:08:40 +0200 Subject: [PATCH 1/3] [EarlyCSE] Add tests for writeonly --- llvm/test/Transforms/E

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-24 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,241 @@ +//=== ABITypeMapper.cpp - Maps LLVM ABI Types to LLVM IR Types --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-06-24 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,157 @@ +//===- AMDGPUExpandFeaturePredicates.cpp - Feature Predicate Expander Pass ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-06-24 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/134016 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-06-24 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,157 @@ +//===- AMDGPUExpandFeaturePredicates.cpp - Feature Predicate Expander Pass ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [HLSL] Don't use CreateRuntimeFunction for intrinsics (PR #145334)

2025-06-23 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/145334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Don't use CreateRuntimeFunction for intrinsics (PR #145334)

2025-06-23 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/145334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Don't use CreateRuntimeFunction for intrinsics (PR #145334)

2025-06-23 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/145334 >From 9ce18af49d38fcd5031ee4b432ab2f092818a045 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 23 Jun 2025 15:52:59 +0200 Subject: [PATCH] [HLSL] Don't use CreateRuntimeFunction for intrinsics HLSL uses Cr

[clang] [HLSL] Don't use CreateRuntimeFunction for intrinsics (PR #145334)

2025-06-23 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/145334 HLSL uses CreateRuntimeFunction for two intrinsics. This is pretty unusual thing to do, and doesn't match what the rest of the file does. I suspect this might be because these are convergent calls, but the intrin

[clang] [clang][Preprocessor] Handle the first pp-token in EnterMainSourceFile (PR #145244)

2025-06-22 Thread Nikita Popov via cfe-commits
nikic wrote: Compile-time: https://llvm-compile-time-tracker.com/compare.php?from=40eee8ec7fb64dd1c6f15e8cd6e087f5d9f9d37e&to=2c67921274cfa31ccf7c59789df153fabc601816&stat=instructions:u https://github.com/llvm/llvm-project/pull/145244 ___ cfe-commits

[clang] [C++][Modules] A module directive may only appear as the first preprocessing tokens in a file (PR #144233)

2025-06-22 Thread Nikita Popov via cfe-commits
nikic wrote: > 1. IIUC, `42935M | 43035M (+0.23%)`does this mean the compiler output binary > size increased by 0.23%? This is the number of instructions retired. It's a metric for compilation time, not binary size. https://github.com/llvm/llvm-project/pull/144233

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,241 @@ +//=== ABITypeMapper.cpp - Maps LLVM ABI Types to LLVM IR Types --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,241 @@ +//=== ABITypeMapper.cpp - Maps LLVM ABI Types to LLVM IR Types --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,241 @@ +//=== ABITypeMapper.cpp - Maps LLVM ABI Types to LLVM IR Types --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -872,20 +895,122 @@ const CGFunctionInfo &CodeGenTypes::arrangeLLVMFunctionInfo( } else if (info.getCC() == CC_Swift || info.getCC() == CC_SwiftAsync) { swiftcall::computeABIInfo(CGM, *FI); } else { -CGM.getABIInfo().computeInfo(*FI); +if (isBPF) + CGM.

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -858,12 +865,28 @@ const CGFunctionInfo &CodeGenTypes::arrangeLLVMFunctionInfo( // Construct the function info. We co-allocate the ArgInfos. FI = CGFunctionInfo::create(CC, isInstanceMethod, isChainCall, isDelegateCall, info, paramInfos,

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,241 @@ +//=== ABITypeMapper.cpp - Maps LLVM ABI Types to LLVM IR Types --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,241 @@ +//=== ABITypeMapper.cpp - Maps LLVM ABI Types to LLVM IR Types --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -167,6 +167,7 @@ add_clang_library(clangCodeGen LINK_LIBS clangAST + LLVMABI nikic wrote: This should be part of LLVM_LINK_COMPONENTS instead. https://github.com/llvm/llvm-project/pull/140112 ___ cfe-commit

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -858,12 +865,28 @@ const CGFunctionInfo &CodeGenTypes::arrangeLLVMFunctionInfo( // Construct the function info. We co-allocate the ArgInfos. FI = CGFunctionInfo::create(CC, isInstanceMethod, isChainCall, isDelegateCall, info, paramInfos,

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -858,12 +865,28 @@ const CGFunctionInfo &CodeGenTypes::arrangeLLVMFunctionInfo( // Construct the function info. We co-allocate the ArgInfos. FI = CGFunctionInfo::create(CC, isInstanceMethod, isChainCall, isDelegateCall, info, paramInfos,

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -104,6 +106,17 @@ static CGCXXABI *createCXXABI(CodeGenModule &CGM) { llvm_unreachable("invalid C++ ABI kind"); } +static std::unique_ptr +makeTargetCodeGenInfo(llvm::abi::TypeBuilder TB) { nikic wrote: The pass by value here is probably not intentional?

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,241 @@ +//=== ABITypeMapper.cpp - Maps LLVM ABI Types to LLVM IR Types --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,241 @@ +//=== ABITypeMapper.cpp - Maps LLVM ABI Types to LLVM IR Types --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] ABI Lowering Library (PR #140112)

2025-06-21 Thread Nikita Popov via cfe-commits
@@ -858,12 +865,28 @@ const CGFunctionInfo &CodeGenTypes::arrangeLLVMFunctionInfo( // Construct the function info. We co-allocate the ArgInfos. FI = CGFunctionInfo::create(CC, isInstanceMethod, isChainCall, isDelegateCall, info, paramInfos,

[clang] [C++][Modules] A module directive may only appear as the first preprocessing tokens in a file (PR #144233)

2025-06-21 Thread Nikita Popov via cfe-commits
nikic wrote: This causes a large compile-time regression: https://llvm-compile-time-tracker.com/compare.php?from=1b5d6ec6855369d109fcb740ecd3812231b7a279&to=ea321392ebc487c1000e43576f44af99edf28a5f&stat=instructions:u https://github.com/llvm/llvm-project/pull/144233

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-20 Thread Nikita Popov via cfe-commits
@@ -17,6 +17,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" #include +#include nikic wrote: Do not use this header. https://github.com/llvm/llvm-project/pull/145059 ___ cfe-commit

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-20 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/145059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,24 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 +; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=instcombine %s | FileCheck %s + +; Check that `select B, true, C` isn't optimized to `or B, C`. nik

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/144686 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/144686 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Nikita Popov via cfe-commits
nikic wrote: For the purposes of this PR, I think you should only change canCreateUndefOrPoison to return true and just eat the regressions. We can follow up with using isValidAddrSpaceCast() in a followup, because it will be less straightforward. I'm not willing to accept direct use of TTI in

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Nikita Popov via cfe-commits
@@ -10211,8 +10210,18 @@ bool AANoUndef::isImpliedByIR(Attributor &A, const IRPosition &IRP, return true; Value &Val = IRP.getAssociatedValue(); + auto IsTargetGuaranteedNotPoison = [&](Value &V) { +if (auto *ASC = dyn_cast(&V)) { + const auto *TTI = A.getInfo

[clang] [Clang] Verify data layout consistency (PR #144720)

2025-06-19 Thread Nikita Popov via cfe-commits
nikic wrote: @rjmccall From a Clang perspective, largely no -- but not entirely. There are cases when LLVM materializes allocations based on the data layout in ways that are observable and not controllable by Clang. One of these is certain inline asm constraints (which can end up passing const

[clang] [llvm] [InstCombine] remove dead loads, such as memcpy from undef (PR #143958)

2025-06-18 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/143958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] remove dead loads, such as memcpy from undef (PR #143958)

2025-06-18 Thread Nikita Popov via cfe-commits
@@ -3339,16 +3340,23 @@ static bool isAllocSiteRemovable(Instruction *AI, if (IntrinsicInst *II = dyn_cast(I)) { switch (II->getIntrinsicID()) { default: -return false; +return std::nullopt; case Intrinsic::memmov

[clang] [llvm] [InstCombine] remove dead loads, such as memcpy from undef (PR #143958)

2025-06-18 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/143958 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SROA] Vector promote some memsets (PR #133301)

2025-06-18 Thread Nikita Popov via cfe-commits
nikic wrote: To make the question more precise, would it make sense to change AMDGPUs unaligned access hook such that https://godbolt.org/z/Gv1j4vjqE will look the same as on X86? That should also fix the motivating problem here. https://github.com/llvm/llvm-project/pull/133301 __

  1   2   3   4   5   6   7   8   9   10   >