[llvm-branch-commits] [llvm] RuntimeLibcalls: Invert handling of 64-bit only libcalls (PR #148571)

2025-07-14 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/148571 ___ 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] RuntimeLibcalls: Invert handling of 64-bit only libcalls (PR #148571)

2025-07-14 Thread Nikita Popov via llvm-branch-commits
@@ -938,6 +933,11 @@ def calloc : RuntimeLibcallImpl; // compiler-rt, not available for most architectures // +def __ashlti3 : RuntimeLibcallImpl; +def __lshrti3 : RuntimeLibcallImpl; +def __ashrti3 : RuntimeL

[llvm-branch-commits] [llvm] release/20.x: [X86] Ignore NSW when DstSVT is i32 (#131755) (PR #147034)

2025-07-04 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/147034 >From c50b409b6b523fa4b8164b80515a93b12e1b5cd4 Mon Sep 17 00:00:00 2001 From: Phoebe Wang Date: Tue, 18 Mar 2025 13:04:23 +0100 Subject: [PATCH] [X86] Ignore NSW when DstSVT is i32 (#131755) We don't have PACKSS

[llvm-branch-commits] [llvm] release/20.x: [RelLookupTableConverter] Drop unnamed_addr for GVs in entries to avoid generating GOTPCREL relocations (#146068) (PR #146191)

2025-07-03 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/146191 ___ 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] [lld] release/20.x: Backport [LLD][COFF] Disallow importing DllMain from import libraries (#146610) (PR #146699)

2025-07-03 Thread Nikita Popov via llvm-branch-commits
@@ -313,6 +313,7 @@ struct Configuration { bool warnDebugInfoUnusable = true; bool warnLongSectionNames = true; bool warnStdcallFixup = true; + bool warnExportedDllMain = true; nikic wrote: This is an ABI break. https://github.com/llvm/llvm-project/pul

[llvm-branch-commits] AlwaysInliner: A new inlining algorithm to interleave alloca promotion with inlines. (PR #145613)

2025-07-02 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic commented: Can you please pre-commit a PhaseOrdering test that demonstrates the problem you are trying to solve? It's hard to understand whether this is the correct solution to the problem without an actual test case. https://github.com/llvm/llvm-project/pull/145613 __

[llvm-branch-commits] [llvm] release/20.x: [RelLookupTableConverter] Drop unnamed_addr for GVs in entries to avoid generating GOTPCREL relocations (#146068) (PR #146191)

2025-06-28 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/146191 ___ 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] TableGen: Generate enum for runtime libcall implementations (PR #144973)

2025-06-27 Thread Nikita Popov via llvm-branch-commits
@@ -235,29 +247,57 @@ void RuntimeLibcallEmitter::emitGetInitRuntimeLibcallNames( // TODO: Emit libcall names as string offset table. OS << "#ifdef GET_INIT_RUNTIME_LIBCALL_NAMES\n" -"const char *const " +"const RTLIB::LibcallImpl " "llvm::RTLIB::

[llvm-branch-commits] [llvm] TableGen: Generate enum for runtime libcall implementations (PR #144973)

2025-06-27 Thread Nikita Popov via llvm-branch-commits
@@ -235,29 +247,57 @@ void RuntimeLibcallEmitter::emitGetInitRuntimeLibcallNames( // TODO: Emit libcall names as string offset table. OS << "#ifdef GET_INIT_RUNTIME_LIBCALL_NAMES\n" -"const char *const " +"const RTLIB::LibcallImpl " "llvm::RTLIB::

[llvm-branch-commits] [llvm] TableGen: Generate enum for runtime libcall implementations (PR #144973)

2025-06-27 Thread Nikita Popov via llvm-branch-commits
@@ -882,7 +902,7 @@ def exp10f128 : RuntimeLibcallImpl; def sinf128 : RuntimeLibcallImpl; def cosf128 : RuntimeLibcallImpl; def tanf128 : RuntimeLibcallImpl; -def tanhf128 : RuntimeLibcallImpl; +def tanhf128 : RuntimeLibcallImpl; nikic wrote: Should probably b

[llvm-branch-commits] [llvm] TableGen: Generate enum for runtime libcall implementations (PR #144973)

2025-06-27 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/144973 ___ 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] TableGen: Generate enum for runtime libcall implementations (PR #144973)

2025-06-27 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/144973 ___ 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] TableGen: Generate enum for runtime libcall implementations (PR #144973)

2025-06-27 Thread Nikita Popov via llvm-branch-commits
@@ -235,29 +247,57 @@ void RuntimeLibcallEmitter::emitGetInitRuntimeLibcallNames( // TODO: Emit libcall names as string offset table. OS << "#ifdef GET_INIT_RUNTIME_LIBCALL_NAMES\n" -"const char *const " +"const RTLIB::LibcallImpl " "llvm::RTLIB::

[llvm-branch-commits] [llvm] [InlineCost] Simplify extractvalue across callsite (PR #145054)

2025-06-23 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/145054 ___ 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] [InlineCost] Simplify extractvalue across callsite (PR #145054)

2025-06-23 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/145054 ___ 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] [InlineCost] Simplify extractvalue across callsite (PR #145054)

2025-06-23 Thread Nikita Popov via llvm-branch-commits
nikic wrote: Could you please also add a negative test where extractvalue does not simplify (e.g. same as current but swap 0 and 1). https://github.com/llvm/llvm-project/pull/145054 ___ llvm-branch-commits mailing li

[llvm-branch-commits] [llvm] MC: Move ExceptionHandling enum to Support (PR #144692)

2025-06-19 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/144692 ___ 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] RuntimeLibcalls: Pass in exception handling type (PR #144696)

2025-06-19 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/144696 ___ 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] PowerPC: Fix using long double libm functions for f128 intrinsics (PR #144382)

2025-06-16 Thread Nikita Popov via llvm-branch-commits
@@ -321,6 +321,24 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) { setLibcallName(RTLIB::OGT_F128, "__gtkf2"); setLibcallName(RTLIB::UO_F128, "__unordkf2"); +setLibcallName(RTLIB::ACOS_F128, "acosf128"); +setLibcallName(RTLIB::ASIN_F128, "asinf128"

[llvm-branch-commits] [llvm] Backport 90a52f494296 to release/20.x (PR #144299)

2025-06-16 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/144299 ___ 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] release/20.x: [InstCombine] Avoid folding select(umin(X, Y), X) with min/max values in false arm (#143020) (PR #144322)

2025-06-16 Thread Nikita Popov via llvm-branch-commits
nikic wrote: I'm not entirely sure about this one, as this is a performance rather than correctness fix and we're late in the release cycle. But the fix itself does seem quite safe and it blocks clickhouse from updating to LLVM 20. https://github.com/llvm/llvm-project/pull/144322 _

[llvm-branch-commits] [llvm] release/20.x: [InstCombine] Avoid folding select(umin(X, Y), X) with min/max values in false arm (#143020) (PR #144322)

2025-06-16 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/144322 ___ 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] release/20.x: [InstCombine] Avoid folding select(umin(X, Y), X) with min/max values in false arm (#143020) (PR #144322)

2025-06-16 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/144322 Backport of https://github.com/llvm/llvm-project/pull/143020 for https://github.com/llvm/llvm-project/issues/139050. >From 9792f981063d6ddadd3678ac31e2254daa6aa9cf Mon Sep 17 00:00:00 2001 From: Nikita Popov Dat

[llvm-branch-commits] [llvm] release/20.x: [CVP] Keep `ReachableCaseCount` in sync with range of condition (#142302) (PR #142730)

2025-06-06 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/142730 ___ 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] release/20.x: [AArch64] Handle XAR with v1i64 operand types (#141754) (PR #143163)

2025-06-06 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/143163 Backport of https://github.com/llvm/llvm-project/commit/32837f376f3c795d3ae6e632adc4f1a60180a646. >From 2c1c9730974c384b10bccc9f4a4f63c94377d302 Mon Sep 17 00:00:00 2001 From: David Green Date: Thu, 29 May 2025

[llvm-branch-commits] [llvm] release/20.x: [AArch64] Handle XAR with v1i64 operand types (#141754) (PR #143163)

2025-06-06 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/143163 ___ 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] WebAssembly: Stop directly using RuntimeLibcalls.def (PR #143054)

2025-06-06 Thread Nikita Popov via llvm-branch-commits
@@ -528,23 +528,20 @@ RuntimeLibcallSignatureTable &getRuntimeLibcallSignatures() { // constructor for use with a static variable struct StaticLibcallNameMap { StringMap Map; - StaticLibcallNameMap() { -static const std::pair NameLibcalls[] = { -#define HANDLE_LIBCALL(c

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
@@ -0,0 +1,24 @@ +;; Test if the callee_type metadata attached to indirect call sites adhere to the expected format. + +; RUN: llvm-as < %s | llvm-dis | FileCheck %s +define i32 @_Z13call_indirectPFicEc(ptr %func, i8 signext %x) !type !0 { +entry: + %func.addr = alloca ptr, alig

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
@@ -1302,6 +1302,24 @@ static void addRange(SmallVectorImpl &EndPoints, EndPoints.push_back(High); } +MDNode *MDNode::getMergedCalleeTypeMetadata(LLVMContext &Ctx, MDNode *A, +MDNode *B) { + SmallVector AB; + SmallSet MergedCall

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
nikic wrote: The way FileCheck works this will pass even if the metadata is not dropped. You could try whether `FileCheck --match-full-lines` works. Otherwise you could use explicit `CHECK-NOT` or `{{$}}`. https://github.com/llvm/llvm-project/pull/87573 _

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
@@ -4161,6 +4161,11 @@ Instruction *InstCombinerImpl::visitCallBase(CallBase &Call) { Call, Builder.CreateBitOrPointerCast(ReturnedArg, CallTy)); } + // Drop unnecessary callee_type metadata from calls that were converted + // into direct calls. + if (Call.

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
@@ -3377,6 +3377,11 @@ static void combineMetadata(Instruction *K, const Instruction *J, K->setMetadata(Kind, MDNode::getMostGenericAlignmentOrDereferenceable(JMD, KMD)); break; + case LLVMContext::MD_callee_type: +if (!AAOnly) +

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
@@ -5096,6 +5097,19 @@ void Verifier::visitCallsiteMetadata(Instruction &I, MDNode *MD) { visitCallStackMetadata(MD); } +void Verifier::visitCalleeTypeMetadata(Instruction &I, MDNode *MD) { + Check(isa(I), "!callee_type metadata should only exist on calls", +&I); +

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
@@ -1302,6 +1302,24 @@ static void addRange(SmallVectorImpl &EndPoints, EndPoints.push_back(High); } +MDNode *MDNode::getMergedCalleeTypeMetadata(LLVMContext &Ctx, MDNode *A, +MDNode *B) { + SmallVector AB; + SmallSet MergedCall

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
@@ -1252,6 +1252,12 @@ class MDNode : public Metadata { bool isReplaceable() const { return isTemporary() || isAlwaysReplaceable(); } bool isAlwaysReplaceable() const { return getMetadataID() == DIAssignIDKind; } + bool hasGeneralizedMDString() const { n

[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
@@ -1302,6 +1302,24 @@ static void addRange(SmallVectorImpl &EndPoints, EndPoints.push_back(High); } +MDNode *MDNode::getMergedCalleeTypeMetadata(LLVMContext &Ctx, MDNode *A, +MDNode *B) { + SmallVector AB; + SmallSet MergedCall

[llvm-branch-commits] LowerTypeTests: Avoid zext of ptrtoint ConstantExpr. (PR #142886)

2025-06-05 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/142886 ___ 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] TargetLibraryInfo: Add tests for function availability (PR #142536)

2025-06-03 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic requested changes to this pull request. I do not think these tests provide value. https://github.com/llvm/llvm-project/pull/142536 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/c

[llvm-branch-commits] [llvm] release/20.x: [RelLookupTableConverter] Drop unnamed_addr to avoid generating GOTPCREL relocations (#142304) (PR #142311)

2025-06-02 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/142311 ___ 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] release/20.x: [RelLookupTableConverter] Drop unnamed_addr to avoid generating GOTPCREL relocations (#142304) (PR #142311)

2025-06-01 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/142311 ___ 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] [clang] Backport: [clang] Serialization: support hashing null template arguments (PR #141957)

2025-05-30 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/141957 ___ 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] llvm-readobj: Use reportFatalUsageError (PR #142039)

2025-05-29 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/142039 ___ 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] CodeGen: Convert some assorted errors to use reportFatalUsageError (PR #142031)

2025-05-29 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/142031 ___ 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] X86: Add X86TTIImpl::isProfitableToSinkOperands hook for immediate operands. (PR #141326)

2025-05-28 Thread Nikita Popov via llvm-branch-commits
@@ -7170,16 +7165,31 @@ bool X86TTIImpl::isProfitableToSinkOperands(Instruction *I, II->getIntrinsicID() == Intrinsic::fshr) ShiftAmountOpNum = 2; } - if (ShiftAmountOpNum == -1) return false; + auto *ShiftAmount = &I->getOperandUse(ShiftAmountOpNum);

[llvm-branch-commits] X86: Add X86TargetLowering::isProfitableToHoist hook for immediate operands. (PR #141326)

2025-05-27 Thread Nikita Popov via llvm-branch-commits
nikic wrote: @pcc I think using fsh should at least help to get a ror instead of the shr+shl+or. Actually getting the value duplicated+sunk into each block is typically done in CGP, which has a bunch of related transforms. The most generic is probably tryToSinkFreeOperands driven by TTI.isPro

[llvm-branch-commits] [llvm] [llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO (PR #139999)

2025-05-27 Thread Nikita Popov via llvm-branch-commits
@@ -33,8 +34,11 @@ PreservedAnalyses EmbedBitcodePass::run(Module &M, ModuleAnalysisManager &AM) { std::string Data; raw_string_ostream OS(Data); + // Clone the module with with Thin LTO, since ThinLTOBitcodeWriterPass changes nikic wrote: ```suggestio

[llvm-branch-commits] [llvm] [llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO (PR #139999)

2025-05-27 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. Okay, let's go with this for now. Compile-time impact of cloning the module is about 0.2% when building clang with fat LTO: https://llvm-compile-time-tracker.com/compare.php?from=11a01e851a06188ae946ace1140f866d7a667221&to=46e037d763e7997a83

[llvm-branch-commits] [llvm] [llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO (PR #139999)

2025-05-27 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/13 ___ 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] release/20.x: [MachO] Improve bounds check (#141083) (PR #141461)

2025-05-26 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/141461 ___ 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] [release/20.x] Update release notes for SystemZ changes (PR #140060)

2025-05-24 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/140060 ___ 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] [libclc] release/20.x: [libclc] Include isnan implementation for SPIR-V targets (PR #140902)

2025-05-24 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/140902 ___ 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] X86: Add X86TargetLowering::isProfitableToHoist hook for immediate operands. (PR #141326)

2025-05-23 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic commented: I'm not super clear on what it is you're trying to fix here. Probably LowerTypeTests should be directly emitting a fshl/fshr instead of a bit shift sequence to make matching to rotate more reliable. Would that help you or not? https://github.com/llvm/llvm-p

[llvm-branch-commits] Transforms: Have CSE/GVN/LICM check isProfitableToHoist() before hoisting. (PR #141325)

2025-05-23 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic requested changes to this pull request. If you're using stacked pull requests, please link the other PRs from the stack. It's impossible to understand the context otherwise. Based on just the changes in this PR: * The EarlyCSE and GVN changes do not make sense to me.

[llvm-branch-commits] [mlir] Add missing imports (PR #138550)

2025-05-22 Thread Nikita Popov via llvm-branch-commits
nikic wrote: The LLVM 19 release is no longer supported. You'll have to apply this as a local patch if you want to build and old LLVM 19 with a new libstdc++. https://github.com/llvm/llvm-project/pull/138550 ___ llvm-branch-commits mailing list llvm-b

[llvm-branch-commits] [mlir] Add missing imports (PR #138550)

2025-05-22 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/138550 ___ 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] [llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO (PR #139999)

2025-05-15 Thread Nikita Popov via llvm-branch-commits
nikic wrote: @ilovepi Does it also work on the release branch? I'd mainly see the clone module approach as something easily backportable for the release branch, but I assume for main we'll want a different solution? https://github.com/llvm/llvm-project/pull/13 _

[llvm-branch-commits] [llvm] [llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO (PR #139999)

2025-05-15 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic commented: Didn't we switch away from cloning because it breaks blockaddress somehow? https://github.com/llvm/llvm-project/pull/13 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.o

[llvm-branch-commits] [llvm] IR: Remove redundant UseList check in addUse (PR #138676)

2025-05-14 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/138676 ___ 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: Remove redundant UseList check in addUse (PR #138676)

2025-05-14 Thread Nikita Popov via llvm-branch-commits
nikic wrote: I think this may have been noise. I reran this and there are no differences over the significance threshold: https://llvm-compile-time-tracker.com/compare.php?from=6c1bb48cc45396894597c8cb897c31205d1bdeb6&to=1837fe71fcfb4363fd2b66cdb9ff6a82b3f380fb&stat=instructions:u https://gith

[llvm-branch-commits] [llvm] release/20.x: AMDGPU: Stop emitting an error on illegal addrspacecasts (#127487) (PR #127496)

2025-05-10 Thread Nikita Popov via llvm-branch-commits
nikic wrote: Closing this as https://github.com/llvm/llvm-project/pull/127751 has landed. https://github.com/llvm/llvm-project/pull/127496 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[llvm-branch-commits] [llvm] release/20.x: AMDGPU: Stop emitting an error on illegal addrspacecasts (#127487) (PR #127496)

2025-05-10 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/127496 ___ 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] [clang] release/20.x: [clang-format] Fix a crash on formatting missing r_pare… (PR #139345)

2025-05-10 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/139345 ___ 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] [polly] Reapply "IR: Remove uselist for constantdata (#137313)" (PR #138961)

2025-05-07 Thread Nikita Popov via llvm-branch-commits
@@ -180,6 +180,10 @@ llvm::getKnowledgeForValue(const Value *V, } return RetainedKnowledge::none(); } + + if (!V->hasUseList()) +return RetainedKnowledge::none(); nikic wrote: As a followup, we should completely remove the non-AC code in this fu

[llvm-branch-commits] [llvm] [polly] Reapply "IR: Remove uselist for constantdata (#137313)" (PR #138961)

2025-05-07 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/138961 ___ 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] ValueTracking: Handle minimumnum and maximumnum in computeKnownFPClass (PR #138737)

2025-05-06 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/138737 ___ 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] ValueTracking: Handle minimumnum/maximumnum in canCreateUndefOrPoison (PR #138729)

2025-05-06 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/138729 ___ 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: Reorder ConstantData enum values (PR #138638)

2025-05-06 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/138638 ___ 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: Reorder ConstantData enum values (PR #138638)

2025-05-06 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic commented: Peculiarly, this has a negative effect on stage1 builds using gcc and a positive effect on stage2 builds using clang: https://llvm-compile-time-tracker.com/compare.php?from=420eca364b07bad78dc0a5d21da5980493798df0&to=00be79cbc7dea09fcd8a57ea51b3e800564fd986&s

[llvm-branch-commits] [llvm] llvm-reduce: Support exotic terminators in instructions-to-return (PR #134794)

2025-05-02 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/134794 ___ 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] llvm-reduce: Support exotic terminators in instructions-to-return (PR #134794)

2025-05-02 Thread Nikita Popov via llvm-branch-commits
@@ -73,28 +73,16 @@ static void rewriteFuncWithReturnType(Function &OldF, Value *NewRetValue) { } } - // Now prune any CFG edges we have to deal with. - // - // Use KeepOneInputPHIs in case the instruction we are using for the return is - // that phi. - // TODO: C

[llvm-branch-commits] [llvm] llvm-reduce: Support exotic terminators in instructions-to-return (PR #134794)

2025-05-02 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/134794 ___ 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] [clang] [llvm] [llvm] Introduce callee_type metadata (PR #87573)

2025-05-01 Thread Nikita Popov via llvm-branch-commits
@@ -5096,6 +5097,23 @@ void Verifier::visitCallsiteMetadata(Instruction &I, MDNode *MD) { visitCallStackMetadata(MD); } +void Verifier::visitCalleeTypeMetadata(Instruction &I, MDNode *MD) { + Check(isa(I), "!callee_type metadata should only exist on calls", +&I); +

[llvm-branch-commits] [llvm] release/20.x: [InstCombine] Do not combine shuffle+bitcast if the bitcast is eliminable. (#135769) (PR #138142)

2025-05-01 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/138142 ___ 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] [AArch64][llvm] Pre-commit tests for #137703 (NFC) (PR #137702)

2025-04-29 Thread Nikita Popov via llvm-branch-commits
nikic wrote: Looks like something went wrong here? https://github.com/llvm/llvm-project/pull/137702 ___ 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] release/20.x: [InstCombine] Fix ninf propagation for fcmp+sel -> minmax (#136433) (PR #137605)

2025-04-28 Thread Nikita Popov via llvm-branch-commits
nikic wrote: > > I don't think there is a need to backport FMF propagation fixes. > > Is there a policy to judge whether or not to backport a miscompilation bug > fix? Actually, it is unlikely to trigger this bug in real-world projects. But > this fix is simple and safe to be backported. Ther

[llvm-branch-commits] [llvm] release/20.x: [InstCombine] Fix ninf propagation for fcmp+sel -> minmax (#136433) (PR #137605)

2025-04-28 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic commented: I don't think there is a need to backport FMF propagation fixes. https://github.com/llvm/llvm-project/pull/137605 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[llvm-branch-commits] [llvm] release/20.x: [InstCombine] Do not fold logical is_finite test (#136851) (PR #137606)

2025-04-28 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/137606 ___ 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: Remove reference counts from ConstantData (PR #137314)

2025-04-26 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/137314 ___ 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: Remove reference counts from ConstantData (PR #137314)

2025-04-26 Thread Nikita Popov via llvm-branch-commits
@@ -518,17 +509,8 @@ class Value { /// This method should only be used by the Use class. void addUse(Use &U) { -if (hasUseList()) - U.addToList(Uses.List); -else - U.addToList(Uses.Count); - } - - void removeUse(Use &U) { -if (hasUseList()) - U

[llvm-branch-commits] [llvm] IR: Remove reference counts from ConstantData (PR #137314)

2025-04-26 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/137314 ___ 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: Remove reference counts from ConstantData (PR #137314)

2025-04-26 Thread Nikita Popov via llvm-branch-commits
@@ -85,10 +84,8 @@ class Use { Use **Prev = nullptr; User *Parent = nullptr; - inline void addToList(unsigned &Count); - inline void addToList(Use *&List); - inline void removeFromList(unsigned &Count); - inline void removeFromList(Use *&List); + inline void addToList

[llvm-branch-commits] [llvm] IR: Remove reference counts from ConstantData (PR #137314)

2025-04-26 Thread Nikita Popov via llvm-branch-commits
nikic wrote: Compile-time for both PRs taken together looks good: https://llvm-compile-time-tracker.com/compare.php?from=12a31658ea36cda74157c6b4e6b6c031e39a19c0&to=d769267079777e4fa4cf41188bfe2aab1b9361f1&stat=instructions%3Au (For reference, this is for the first PR only: https://llvm-compil

[llvm-branch-commits] [llvm] IR: Remove reference counts from ConstantData (PR #137314)

2025-04-25 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic commented: The general approach here makes sense to me. For reference, this is the diff for both PRs together, which is a bit clearer as the second undoes half of the first: https://github.com/llvm/llvm-project/compare/main...users/arsenm/ir/remove-constantdata-referen

[llvm-branch-commits] [llvm] IR: Remove reference counts from ConstantData (PR #137314)

2025-04-25 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/137314 ___ 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: Remove reference counts from ConstantData (PR #137314)

2025-04-25 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic commented: Looks like there are some polly assertion failures. https://github.com/llvm/llvm-project/pull/137314 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[llvm-branch-commits] [llvm] [Attributor] Use `getAllocaAddrSpace` to get address space for `AllocaInst` (PR #136865)

2025-04-23 Thread Nikita Popov via llvm-branch-commits
nikic wrote: @shiltian I'm not entirely sure what you're asking here. As @arsenm said, the alloca address space in the data layout is merely a hint on the address space to use when materializing allocas "out of thin air". There are targets that use multiple alloca address spaces, this just spe

[llvm-branch-commits] [clang] Backport to 20.x "[clang][analyzer] Fix error path of builtin overflow (#136345)" (PR #136589)

2025-04-21 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/136589 ___ 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] ARM: Avoid using getNumUses (PR #136355)

2025-04-18 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/136355 ___ 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] AArch64: Use use_empty instead of getNumUses == 0 (PR #136356)

2025-04-18 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/136356 ___ 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] [lldb] [lldb] Fix SBTarget::ReadInstruction with flavor (PR #136034)

2025-04-17 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/136034 ___ 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] [LV] Disable epilogue vectorization for FindLastIV if start is poison. (PR #135666)

2025-04-14 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/135666 ___ 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] release/20.x: [SCEV] Use ashr to adjust constant multipliers (#135534) (PR #135543)

2025-04-14 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/135543 ___ 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] release/20.x: [LLVM][MemCpyOpt] Unify alias tags if we optimize allocas (#129537) (PR #135615)

2025-04-14 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/135615 ___ 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] release/20.x: [LLVM][MemCpyOpt] Unify alias tags if we optimize allocas (#129537) (PR #135615)

2025-04-14 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/135615 Backport of 716b02d8c575afde7af1af13df145019659abca2, with conflicts in the test resolved. >From e385f5c5b9bd32f89754e8088c29f42a761f2880 Mon Sep 17 00:00:00 2001 From: Dominik Adamski Date: Thu, 10 Apr 2025 12:

[llvm-branch-commits] [clang] release/20.x: [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (#132214) (PR #134232)

2025-04-13 Thread Nikita Popov via llvm-branch-commits
nikic wrote: > @nikic what do you mean by ABI change in this case? It doesn't change ABI of > generated code, moreover it doesn't even change PCM serialized format because > it is in memory only filed and attribute. It changes the ABI of libclang-cpp, by changing the layout of an exported type

[llvm-branch-commits] [clang] release/20.x: [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (#132214) (PR #134232)

2025-04-13 Thread Nikita Popov via llvm-branch-commits
@@ -1392,6 +1392,10 @@ class ASTReader llvm::DenseMap DefinitionSource; + /// Friend functions that were defined but might have had their bodies + /// removed. + llvm::DenseSet ThisDeclarationWasADefinitionSet; nikic wrote: This is an ABI break. https:

[llvm-branch-commits] [clang] release/20.x: [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (#132214) (PR #134232)

2025-04-13 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic requested changes to this pull request. https://github.com/llvm/llvm-project/pull/134232 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit

[llvm-branch-commits] [clang] release/20.x: [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (#132214) (PR #134232)

2025-04-13 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/134232 ___ 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] [LV] An attempt to cherry-pick the fix PR #132691 (cherry-pick from the main branch to the release/20.x branch) (PR #135231)

2025-04-13 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic requested changes to this pull request. Breaks LoopUtils.h ABI in obvious ways and FMF.h ABI in less obvious ways. Can this be fixed in a more minimal way than backporting 18 commits that include a lot of refactorings? https://github.com/llvm/llvm-project/pull/135231 _

[llvm-branch-commits] [llvm] [LV] An attempt to cherry-pick the fix PR #132691 (cherry-pick from the main branch to the release/20.x branch) (PR #135231)

2025-04-13 Thread Nikita Popov via llvm-branch-commits
https://github.com/nikic milestoned https://github.com/llvm/llvm-project/pull/135231 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

  1   2   3   4   5   6   >