[clang] [llvm] [fatlto] Use the ThinLTO default pipeline for FatLTO (PR #134434)

2025-04-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Switching to the ThinLTO post-link pipeline will have a big impact on optimization behavior and compile-time. I think it would be safer to make a change along the lines of https://github.com/llvm/llvm-project/pull/126168, i.e. to schedule the necessary passe

[clang] [Clang][CodeGen] Do not use the GEP result to infer offset and result type (PR #134221)

2025-04-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM. Please edit the commit message to avoid auto-close of https://github.com/llvm/llvm-project/issues/132449. https://github.com/llvm/llvm-project/pull/134221 ___ cfe-commits mailing list cfe-comm

[clang] 468452b - [CodeGen] Fix unused variable warning (NFC)

2025-04-05 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2025-03-20T19:36:38+01:00 New Revision: 468452b0814a3ad04700455af2d225e25a6aecaf URL: https://github.com/llvm/llvm-project/commit/468452b0814a3ad04700455af2d225e25a6aecaf DIFF: https://github.com/llvm/llvm-project/commit/468452b0814a3ad04700455af2d225e25a6aecaf.diff

[clang] [CodeGen] Don't include CGDebugInfo.h in CodeGenFunction.h (NFC) (PR #134100)

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

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-04-05 Thread Nikita Popov via cfe-commits
@@ -64,21 +64,27 @@ class CGBuilderTy : public CGBuilderBaseTy { Address createConstGEP2_32(Address Addr, unsigned Idx0, unsigned Idx1, const llvm::Twine &Name) { const llvm::DataLayout &DL = BB->getDataLayout(); -llvm::GetElementPtrInst *

[clang] [llvm] [fatlto] Use the ThinLTO default pipeline for FatLTO (PR #134434)

2025-04-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM, but PR title needs adjustment. https://github.com/llvm/llvm-project/pull/134434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang-tools-extra] [llvm] [llvm] add tool to verify mustache library (PR #111487)

2025-04-05 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,12 @@ +llvm-mustachespec - LLVM tool to test Mustache Compliance Library += + +llvm-mustachespec test the mustache spec conformance of the LLVM +mustache library. The spec can be found here https://github.c

[clang] [clang][CGObjC] Remove unused ExternalProtocolPtrTy (NFC) (PR #133870)

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

[clang] [llvm] [fatlto] Use the ThinLTO default pipeline for FatLTO (PR #134434)

2025-04-05 Thread Nikita Popov via cfe-commits
@@ -1692,6 +1692,19 @@ PassBuilder::buildFatLTODefaultPipeline(OptimizationLevel Level, bool ThinLTO, if (ThinLTO && PGOOpt && PGOOpt->Action == PGOOptions::SampleUse) MPM.addPass(buildThinLTODefaultPipeline(Level, /*ImportSummary=*/nullptr)); else { +// ModuleSimp

[clang] [llvm] [IRBuilder] Add new overload for CreateIntrinsic (PR #131942)

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

[clang] [llvm] [SimplifyCFG] Extend jump-threading to allow live local defs (PR #135079)

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

[clang] [Clang][CodeGen][X86] don't coerce int128 into `{i64,i64}` for SysV-like ABIs (PR #135230)

2025-04-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: I haven't checked the implementation, but conceptually this looks fine. Passing as i128 instead of {i64, i64} is better for optimization purposes. Rust already passes these as i128, so we know that works, and change will improve x-lang LTO. (Clang also passe

[clang] [Clang][CodeGen][X86] don't coerce int128 into `{i64,i64}` for SysV-like ABIs (PR #135230)

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

[clang] e6a87da - [CodeGen] Don't explicitly set intrinsic attributes (NFCI)

2025-03-30 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2025-03-20T15:04:03+01:00 New Revision: e6a87da8fe314a009eed769f9737b4b281a06fba URL: https://github.com/llvm/llvm-project/commit/e6a87da8fe314a009eed769f9737b4b281a06fba DIFF: https://github.com/llvm/llvm-project/commit/e6a87da8fe314a009eed769f9737b4b281a06fba.diff

[clang] [Tooling] Avoid repeated hash lookups (NFC) (PR #131264)

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

[clang] [Clang] Always verify LLVM IR inputs (PR #134396)

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

[clang] Reland [Clang][Cmake] fix libtool duplicate member name warnings (PR #133850)

2025-04-06 Thread Nikita Popov via cfe-commits
nikic wrote: I'm still somewhat confused about why that one file in particular is problematic, but I guess if this works it's fine. Would making these OBJECT instead of STATIC libraries avoid the issue perhaps? https://github.com/llvm/llvm-project/pull/133850 __

[clang] [llvm] [fatlto] Add coroutine passes when using FatLTO with ThinLTO (PR #134434)

2025-04-07 Thread Nikita Popov via cfe-commits
nikic wrote: /cherry-pick 268c065eab06b81a0d7256ac62c0865b3781e236 https://github.com/llvm/llvm-project/pull/134434 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RFC] Bypass TAD during overload resolution if a perfect match exists (PR #133426)

2025-04-18 Thread Nikita Popov via cfe-commits
nikic wrote: The final version had a 4% improvement on clang bootstrap: https://llvm-compile-time-tracker.com/compare.php?from=23324b8b109aed1f77cb20cef476b795f33b6835&to=8c5a307bd8d406e6167a5cd3ce3c74e2e3bfb2a6&stat=instructions:u Wow. https://github.com/llvm/llvm-project/pull/133426

[clang] [llvm] AMDGPU: Mark workitem ID intrinsics with range attribute (PR #136196)

2025-04-17 Thread Nikita Popov via cfe-commits
nikic wrote: > This avoids the need to have special handling at every use site. > Unfortunately this means we unnecessarily emit AssertZext in the DAG (where > we already directly understand the range of the intrinsic), andt we regress > in undefined cases as we don't fold out asserts on undef

[clang] [llvm] AMDGPU: Mark workitem ID intrinsics with range attribute (PR #136196)

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

[clang] Control analysis-based diagnostics with #pragma (PR #136323)

2025-04-23 Thread Nikita Popov via cfe-commits
nikic wrote: FYI this introduces some overhead: https://llvm-compile-time-tracker.com/compare.php?from=2a9f77f6bd48d757b2d45aadcb6cf76ef4b4ef32&to=71ce9e26aec00e4af27a69ccfab8ca1773ed7018&stat=instructions:u About 0.3% on clang files. https://github.com/llvm/llvm-project/pull/136323 __

[clang] [llvm] [mlir] [IR] Do not store Function inside BlockAddress (PR #137958)

2025-04-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/137958 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-ser

[clang] [llvm] [IR] Do not store Function inside BlockAddress (PR #137958)

2025-04-30 Thread Nikita Popov via cfe-commits
@@ -912,6 +912,11 @@ class BlockAddress final : public Constant { /// block must be embedded into a function. static BlockAddress *get(BasicBlock *BB); + /// Return a BlockAddress for the specified basic block, which may not be + /// part of a function. The specified typ

[clang] [llvm] [mlir] [IR] Do not store Function inside BlockAddress (PR #137958)

2025-04-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/137958 >From 2d3db51939ec6ca2dfb2e327bce0f33bd2532ff9 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 30 Apr 2025 13:00:19 +0200 Subject: [PATCH 1/2] [IR] Do not store Function inside BlockAddress Currently Block

[clang] [Clang][CodeGen] Check `isUnderlyingBasePointerConstantNull` in `emitPointerArithmetic` (PR #137849)

2025-04-30 Thread Nikita Popov via cfe-commits
@@ -4238,7 +4238,8 @@ static Value *emitPointerArithmetic(CodeGenFunction &CGF, else elemTy = CGF.ConvertTypeForMem(elementType); - if (CGF.getLangOpts().PointerOverflowDefined) + if (CGF.getLangOpts().PointerOverflowDefined || + CGF.isUnderlyingBasePointerConstan

[clang] [llvm] [IR] Do not store Function inside BlockAddress (PR #137958)

2025-04-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/137958 >From 2d3db51939ec6ca2dfb2e327bce0f33bd2532ff9 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 30 Apr 2025 13:00:19 +0200 Subject: [PATCH] [IR] Do not store Function inside BlockAddress Currently BlockAddr

[clang] [llvm] [IR] Do not store Function inside BlockAddress (PR #137958)

2025-04-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/137958 Currently BlockAddresses store both the Function and the BasicBlock they reference, and the BlockAddress is part of the use list of both the Function and BasicBlock. This is quite awkward, because this is not re

[clang] [llvm] [IR] Do not store Function inside BlockAddress (PR #137958)

2025-04-30 Thread Nikita Popov via cfe-commits
@@ -32,7 +32,7 @@ void llvm::reduceFunctionsDeltaPass(Oracle &O, ReducerWorkItem &WorkItem) { // Intrinsics don't have function bodies that are useful to // reduce. Additionally, intrinsics may have additional operand // constraints. But, do drop intrinsics that ar

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

2025-04-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic requested changes to this pull request. So if I understand correctly, you are marking memsets as unsplittable, lowering them to vector zero and smaller accesses to inserts/extracts. I don't think your general approach here is going to work. We need to be careful about

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

2025-04-14 Thread Nikita Popov via cfe-commits
@@ -1170,10 +1204,17 @@ class AllocaSlices::SliceBuilder : public PtrUseVisitor { if (!IsOffsetKnown) return PI.setAborted(&II); +bool Splittable; + +if (getVectorTypeFor(II, DL)) + Splittable = isSplittableMemOp(AS.AI.getAllocatedType(), II.isVolatile

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

2025-04-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/133301 ___ 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-04-14 Thread Nikita Popov via cfe-commits
nikic wrote: > > I don't think your general approach here is going to work. We need to be > > careful about introducing vector operations out of thin air, because LLVM > > is not going to second guess them. If you convert a memset to <32768 x i8> > > ops here, LLVM is going to carry those all

[clang] [llvm] [BasicAA] Do not decompose past casts with different index width (PR #119365)

2025-05-05 Thread Nikita Popov via cfe-commits
nikic wrote: @liushuyu Thanks for the report, should be fixed by https://github.com/llvm/llvm-project/pull/138528. https://github.com/llvm/llvm-project/pull/119365 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [llvm] [IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (PR #138324)

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

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/138251 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-ser

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
@@ -59,22 +59,41 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
@@ -59,22 +59,41 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/138251 >From 114ba17da2f522c5fd5045f5030a44fe13b3af27 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 2 May 2025 12:46:48 +0200 Subject: [PATCH 1/5] [ErrorHandling] Add reportFatalInternalError + reportFatalUsage

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/138251 >From 114ba17da2f522c5fd5045f5030a44fe13b3af27 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 2 May 2025 12:46:48 +0200 Subject: [PATCH 1/4] [ErrorHandling] Add reportFatalInternalError + reportFatalUsage

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
@@ -59,22 +59,41 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
@@ -59,22 +59,42 @@ namespace llvm { ~ScopedFatalErrorHandler() { remove_fatal_error_handler(); } }; -/// Reports a serious error, calling any installed error handler. These -/// functions are intended to be used for error conditions which are outside -/// the control of

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/138251 >From 114ba17da2f522c5fd5045f5030a44fe13b3af27 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 2 May 2025 12:46:48 +0200 Subject: [PATCH 1/6] [ErrorHandling] Add reportFatalInternalError + reportFatalUsage

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

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

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-05 Thread Nikita Popov via cfe-commits
nikic wrote: @optimisan Good point. I've put up https://github.com/llvm/llvm-project/pull/138502 to update the docs. https://github.com/llvm/llvm-project/pull/138251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang] Remove unused local variables (NFC) (PR #138468)

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

[clang] [Clang] Do not warn for serialized builtin or command-line definitions (PR #137306)

2025-05-01 Thread Nikita Popov via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caamaño?= Message-ID: In-Reply-To: nikic wrote: This has a large negative compile-time impact, esp for unoptimized builds: https://llvm-compile-time-tracker.com/compare.php?from=7ec1e0f7ba9f3b03fa6163ab62c17dc9b404303e&to=0d3d2f639c42b22fc1b9453c7b834dbb0f16c0dc

[clang] [Clang] Do not warn for serialized builtin or command-line definitions (PR #137306)

2025-05-01 Thread Nikita Popov via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caamaño?= Message-ID: In-Reply-To: @@ -371,8 +371,12 @@ bool Preprocessor::CheckMacroName(Token &MacroNameTok, MacroUse isDefineUndef, SourceLocation MacroNameLoc = MacroNameTok.getLocation(); if (ShadowFlag) *ShadowFlag = false; - if

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-05-01 Thread Nikita Popov via cfe-commits
@@ -26,11 +26,15 @@ typedef vbool64_t fixed_bool64_t __attribute__((riscv_rvv_vector_bits(__riscv_v_ // // CHECK-128-LABEL: @call_bool32_ff( // CHECK-128-NEXT: entry: +// CHECK-128-NEXT:[[SAVED_VALUE:%.*]] = alloca <1 x i8>, align 1 nikic wrote: @paulwal

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-05-01 Thread Nikita Popov via cfe-commits
@@ -26,11 +26,15 @@ typedef vbool64_t fixed_bool64_t __attribute__((riscv_rvv_vector_bits(__riscv_v_ // // CHECK-128-LABEL: @call_bool32_ff( // CHECK-128-NEXT: entry: +// CHECK-128-NEXT:[[SAVED_VALUE:%.*]] = alloca <1 x i8>, align 1 nikic wrote: I'd expe

[clang] [llvm] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use static library (PR #126143)

2025-04-24 Thread Nikita Popov via cfe-commits
nikic wrote: A naive question from someone who is not familiar with this area: Is any of this stuff usable with anything but a matching version of clang? If no, can we place these things in the clang resource directory, where the other version-bound runtimes live? https://github.com/llvm/llvm

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-23 Thread Nikita Popov via cfe-commits
nikic wrote: I agree with @efriedma-quic that we can't have targets restricting what integer types are legal in IR. And as far as I can tell, the AMDGPU backend does handle such types (there are plenty of tests with i24 values for example). (Which isn't to say that other things can't be enforc

[clang] [llvm] [TargetVerifier][AMDGPU] Add TargetVerifier. (PR #123609)

2025-04-23 Thread Nikita Popov via cfe-commits
nikic wrote: > In general, non-power-of-2 integer types are not compilable to machine code > on AMDGPU. That sounds like a bug in the AMDGPU backend. https://github.com/llvm/llvm-project/pull/123609 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [llvm] Clang: Add nsz to llvm.minnum and llvm.maxnum emitted from fmin and fmax (PR #113133)

2025-04-25 Thread Nikita Popov via cfe-commits
nikic wrote: I'm not sure this is correct. At least the way alive models the flag, I believe this would also allow returning -0.0 even if both operands are 0.0, which is not a legal outcome. https://github.com/llvm/llvm-project/pull/113133 ___ cfe-co

[clang] [llvm] Clang: Add nsz to llvm.minnum and llvm.maxnum emitted from fmin and fmax (PR #113133)

2025-04-25 Thread Nikita Popov via cfe-commits
nikic wrote: > > I'm not sure this is correct. At least the way alive models the flag, I > > believe this would also allow returning -0.0 even if both operands are 0.0, > > which is not a legal outcome. > > That sounds like a bad modeling. It shouldn't permit synthesizing a -0 out of > nowher

[clang] [Driver] Simplify string comparisons (NFC) (PR #137756)

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

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-29 Thread Nikita Popov via cfe-commits
@@ -554,6 +554,22 @@ class VectorType : public Type { return VectorType::get(VTy->getElementType(), EltCnt * 2); } + /// This static method returns a VectorType with the same size-in-bits as + /// SizeTy but with an element type that matches the scalar type of EltTy. -

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-29 Thread Nikita Popov via cfe-commits
@@ -80,7 +80,9 @@ fixed_bool32_t from_vbool32_t(vbool32_t type) { // // CHECK-128-LABEL: @to_vbool32_t( // CHECK-128-NEXT: entry: -// CHECK-128-NEXT:ret [[TYPE_COERCE:%.*]] +// CHECK-128-NEXT:[[SAVED_VALUE:%.*]] = alloca <1 x i8>, align 1 +// CHECK-128-NEXT: [[SAV

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-29 Thread Nikita Popov via cfe-commits
@@ -554,6 +554,22 @@ class VectorType : public Type { return VectorType::get(VTy->getElementType(), EltCnt * 2); } + /// This static method returns a VectorType with the same size-in-bits as + /// SizeTy but with an element type that matches the scalar type of EltTy. +

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

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

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-29 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Apart from the RISCV test changes this looks reasonable to me. https://github.com/llvm/llvm-project/pull/130973 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [Clang][CodeGen] Check `isUnderlyingBasePointerConstantNull` in `emitPointerArithmetic` (PR #137849)

2025-04-29 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: While we should omit inbounds, I think it would be good to not suppress the sanitizer. If the sanitizer doesn't warn about it, then things will never get better :( https://github.com/llvm/llvm-project/pull/137849 _

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-29 Thread Nikita Popov via cfe-commits
@@ -26,11 +26,15 @@ typedef vbool64_t fixed_bool64_t __attribute__((riscv_rvv_vector_bits(__riscv_v_ // // CHECK-128-LABEL: @call_bool32_ff( // CHECK-128-NEXT: entry: +// CHECK-128-NEXT:[[SAVED_VALUE:%.*]] = alloca <1 x i8>, align 1 nikic wrote: Looks li

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

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

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/138251 This implements the result of the discussion at: https://discourse.llvm.org/t/rfc-report-fatal-error-and-the-default-value-of-gencrashdialog/73587 There are two different use cases for report_fatal_error, so repla

[clang] [llvm] [mlir] [ErrorHandling] Add reportFatalInternalError + reportFatalUsageError (NFC) (PR #138251)

2025-05-02 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/138251 >From 114ba17da2f522c5fd5045f5030a44fe13b3af27 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 2 May 2025 12:46:48 +0200 Subject: [PATCH 1/2] [ErrorHandling] Add reportFatalInternalError + reportFatalUsage

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-05-02 Thread Nikita Popov via cfe-commits
@@ -250,6 +250,32 @@ static KeywordStatus getKeywordStatus(const LangOptions &LangOpts, return CurStatus; } +static bool IsKeywordInCpp(unsigned Flags) { + while (Flags != 0) { +unsigned CurFlag = Flags & ~(Flags - 1); +Flags = Flags & ~CurFlag; +switch (static

[clang] [llvm] [mlir] [IR] Do not store Function inside BlockAddress (PR #137958)

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

[clang] [llvm] Minimal support of floating-point operand bundles (PR #135658)

2025-04-18 Thread Nikita Popov via cfe-commits
nikic wrote: > I don't see the necessity of using operand bundles. All of the possible > arguments are metadata strings, not SSA values. Can't we just use metadata > instead? Metadata always has to be droppable. Some of this could in theory be handled with metadata if we say the behavior (wit

[clang] [CodeGen][NFC] Move test builtin_signbit.cpp to CodeGen (PR #127814)

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

[clang] [llvm] [clang][CodeGen][AA] Add `!llvm.errno.tbaa` gathering int-compatible TBAA nodes (PR #125258)

2025-02-28 Thread Nikita Popov via cfe-commits
nikic wrote: > > > so IIUC !llvm.errno.tbaa should just be a module-level list of > > > int-compatible TBAA nodes. > > > > > > Yes, exactly. It should be a module level MD node, not on individual > > instructions. > > Thank you, I'm updating this. I've been contemplating this, and thought >

[clang] [clang][test] Fix -DBUILD_SHARED_LIBS build by adding depency on Targ… (PR #130105)

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

[clang] [llvm] [Assignment Tracking] Replace `undef` debug info with `poison` (PR #129755)

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

[clang] [flang] [lldb] [llvm] [mlir] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

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

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-03-06 Thread Nikita Popov via cfe-commits
nikic wrote: This causes a large compile-time regression for C++ code: https://llvm-compile-time-tracker.com/compare_clang.php?from=37aad2c1196ea3de242d855cfe38bc25a65d6f5e&to=a24523ac8dc07f3478311a5969184b922b520395&stat=instructions%3Au&sortBy=interestingness It adds 1-3% overhead per file du

[clang] [Clang][CodeGen] Do not set inbounds flag for struct GEP with null base pointers (PR #130734)

2025-03-11 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. I think this makes sense, but please wait for a second opinion... https://github.com/llvm/llvm-project/pull/130734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-03-11 Thread Nikita Popov via cfe-commits
nikic wrote: Yes, reverting the change did recover the regression. Did you test exactly the change that was landed? It's also possible that it interacted with something that landed in the meantime... https://github.com/llvm/llvm-project/pull/126088 _

[clang] [flang] [llvm] [mlir] [TargetRegistry] Accept Triple in createTargetMachine() (NFC) (PR #130940)

2025-03-12 Thread Nikita Popov via cfe-commits
@@ -116,7 +116,7 @@ body: | successors: %bb.2, %bb.4 liveins: $rdi, $rsi -%1:gr32 = COPY $rsi +%1:gr64 = COPY $rsi nikic wrote: I believe this test was previously creating a 32-bit TM by accident. https://github.com/llvm/llvm-proj

[clang] [flang] [llvm] [mlir] [TargetRegistry] Accept Triple in createTargetMachine() (NFC) (PR #130940)

2025-03-12 Thread Nikita Popov via cfe-commits
@@ -93,7 +93,7 @@ LLVMState::LLVMState(std::unique_ptr TM, std::unique_ptr LLVMState::createTargetMachine() const { return std::unique_ptr( TheTargetMachine->getTarget().createTargetMachine( - TheTargetMachine->getTargetTriple().normalize(), + Triple(T

[clang] [flang] [llvm] [mlir] [TargetRegistry] Accept Triple in createTargetMachine() (NFC) (PR #130940)

2025-03-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/130940 This avoids doing a Triple -> std::string -> Triple round trip in lots of places, now that the Module stores a Triple. >From 7aa005a4e9aa14c79a527719936824bcfe9a409c Mon Sep 17 00:00:00 2001 From: Nikita Popov D

[clang] [llvm] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/129868 The module currently stores the target triple as a string. This means that any code that wants to actually use the triple first has to instantiate a Triple, which is somewhat expensive. The change in #121652 caus

[libclc] [libclc] Stop installing CLC headers (PR #126908)

2025-03-05 Thread Nikita Popov via cfe-commits
nikic wrote: This should be okay from the mesa side now. https://github.com/search?q=%22include+clc%2Fclc.h%22&type=code has some other mentions of clc/clc.h includes, but from a cursory looks all of those look very old. https://github.com/llvm/llvm-project/pull/126908 ___

[clang] [llvm] [mlir] [polly] [IR] Store Triple in Module (NFC) (PR #129868)

2025-03-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/129868 >From 13e2505e361d7ed462486162a5fe56b904018f65 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 4 Mar 2025 17:04:48 +0100 Subject: [PATCH 1/2] [IR] Store Triple in Module (NFC) The module currently stores t

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-03-12 Thread Nikita Popov via cfe-commits
@@ -3398,6 +3399,101 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// If `I` is a load instruction, used only by shufflevector instructions with +// poison values, attempt to shrink the load to only the lanes being used. +bool VectorCombi

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-03-12 Thread Nikita Popov via cfe-commits
@@ -3398,6 +3399,101 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// If `I` is a load instruction, used only by shufflevector instructions with +// poison values, attempt to shrink the load to only the lanes being used. +bool VectorCombi

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-03-12 Thread Nikita Popov via cfe-commits
@@ -336,7 +336,7 @@ define <8 x float> @load_v2f32_v8f32(ptr dereferenceable(32) %p) { define <4 x i32> @load_v2i32_v4i32(ptr dereferenceable(16) %p) { ; CHECK-LABEL: @load_v2i32_v4i32( -; CHECK-NEXT:[[S:%.*]] = load <4 x i32>, ptr [[P:%.*]], align 1 +; CHECK-NEXT:[[S

[clang] [flang] [llvm] [mlir] [TargetRegistry] Accept Triple in createTargetMachine() (NFC) (PR #130940)

2025-03-12 Thread Nikita Popov via cfe-commits
@@ -453,14 +453,14 @@ class Target { /// either the target triple from the module, or the target triple of the /// host if that does not exist. TargetMachine *createTargetMachine( - StringRef TT, StringRef CPU, StringRef Features, nikic wrote: Resto

[clang] [llvm] [CVP] Infer `nuw`/`nsw` flags for TruncInst (PR #130504)

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

[clang] [flang] [llvm] [mlir] [TargetRegistry] Accept Triple in createTargetMachine() (NFC) (PR #130940)

2025-03-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/130940 >From 7aa005a4e9aa14c79a527719936824bcfe9a409c Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 12 Mar 2025 10:57:58 +0100 Subject: [PATCH 1/3] [TargetRegistry] Accept Triple in createTargetMachine() (NFC)

[clang] [flang] [llvm] [mlir] [TargetRegistry] Accept Triple in createTargetMachine() (NFC) (PR #130940)

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

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

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

[clang] [llvm] [Clang] Add __builtin_assume_dereferenceable to encode deref assumption. (PR #121789)

2025-02-13 Thread Nikita Popov via cfe-commits
nikic wrote: Yeah, this is good to go now. https://github.com/llvm/llvm-project/pull/121789 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7e3735d - Reapply [CaptureTracking][FunctionAttrs] Add support for CaptureInfo (#125880)

2025-02-14 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2025-02-14T12:38:04+01:00 New Revision: 7e3735d1a1b85cea48feb45cb7c2b5d8eaa216ae URL: https://github.com/llvm/llvm-project/commit/7e3735d1a1b85cea48feb45cb7c2b5d8eaa216ae DIFF: https://github.com/llvm/llvm-project/commit/7e3735d1a1b85cea48feb45cb7c2b5d8eaa216ae.diff

[clang] [clang-linker-wrapper] Avoid repeated hash lookups (NFC) (PR #127443)

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

[clang] [clang-linker-wrapper] Avoid repeated hash lookups (NFC) (PR #127443)

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

[clang-tools-extra] [clang-tidy] Avoid repeated hash lookups (NFC) (PR #127444)

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

[clang] [clang-linker-wrapper] Avoid repeated hash lookups (NFC) (PR #127443)

2025-02-17 Thread Nikita Popov via cfe-commits
@@ -1060,8 +1060,9 @@ Expected getSymbolsFromBitcode(MemoryBufferRef Buffer, OffloadKind Kind, if (Sym.isFormatSpecific() || !Sym.isGlobal()) continue; - bool NewSymbol = Syms.count(Sym.getName()) == 0; - auto OldSym = NewSymbol ? Sym_None : Syms[Sym.g

[clang] [Sema] Avoid repeated hash lookups (NFC) (PR #127301)

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

[clang] [Index] Avoid repeated hash lookups (NFC) (PR #127300)

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

[clang] [clang-offload-packager] Avoid repeated hash lookups (NFC) (PR #127302)

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

<    9   10   11   12   13   14   15   16   17   >