[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Nikita Popov via cfe-commits
nikic wrote: Looks like using InsertPosition in IRBuilder has some overhead: https://llvm-compile-time-tracker.com/compare.php?from=317277e4f961edf13132914a58a26408db4ab0aa&to=6481dc57612671ebe77fe9c34214fba94e1b3b27&stat=instructions:u So it might make sense to keep some explicit overloads for

[clang] Update Clang extension criteria (PR #96532)

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

[clang] [llvm] [mlir] [polly] [IR][NFC] Update IRBuilder to use InsertPosition (PR #96497)

2024-06-24 Thread Nikita Popov via cfe-commits
nikic wrote: > > Looks like using InsertPosition in IRBuilder has some overhead: > > Hm, we're adding an extra pointer chase when we give up passing a basicblock > - I think then it makes sense to keep the option to pass BB+It, and do so > when the caller already knows the BB (while removing t

[clang] [llvm] [Pipelines] Move IPSCCP after inliner pipeline (PR #96620)

2024-06-27 Thread Nikita Popov via cfe-commits
nikic wrote: Yes, this causes a massive compile-time regression: http://llvm-compile-time-tracker.com/compare.php?from=253a294b54a6096a0b66f840931dd0e345d70c4f&to=20869e8ed55c58696ce4e9dc3d18cd6af01ed49c&stat=instructions:u https://github.com/llvm/llvm-project/pull/96620 ___

[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/97023 Replace it with a forward declaration instead. Analysis.h is pulled in by all passes, but not all passes need to access the module. >From f21bee2d46446e9238992fde4e190ce8010ede7a Mon Sep 17 00:00:00 2001 From: Niki

[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/97023 >From f21bee2d46446e9238992fde4e190ce8010ede7a Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 27 Jun 2024 17:05:54 +0200 Subject: [PATCH 1/2] [IR] Don't include Module.h in Analysis.h (NFC) Replace it with

[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

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

[clang] [llvm] [polly] Revert "[IR] Don't include Module.h in Analysis.h (NFC) (#97023)" (PR #97129)

2024-06-29 Thread Nikita Popov via cfe-commits
https://github.com/nikic requested changes to this pull request. This is probably caused by some downstream patches in google3? https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp does not contain any mentions of `M->getFunction` or `M->getCont

[clang] 5cc1287 - [CGBuilder] Use getDataLayout() helpers (NFC)

2024-06-29 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-06-29T11:50:28+02:00 New Revision: 5cc1287bdbb2de9ad91e4ba8dc9eeb9508c734a5 URL: https://github.com/llvm/llvm-project/commit/5cc1287bdbb2de9ad91e4ba8dc9eeb9508c734a5 DIFF: https://github.com/llvm/llvm-project/commit/5cc1287bdbb2de9ad91e4ba8dc9eeb9508c734a5.diff

[clang] Reland "[clang] Add nuw attribute to GEPs (#105496)" (PR #107257)

2024-09-12 Thread Nikita Popov via cfe-commits
nikic wrote: Reduced: https://llvm.godbolt.org/z/TPdd9qore I believe the problem is this line: https://github.com/llvm/llvm-project/blob/c05e29bff036060f0811b887a92715104abdceb5/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp#L2513 This does an in-place modification of the GEP, but on

[clang] Reland "[clang] Add nuw attribute to GEPs (#105496)" (PR #107257)

2024-09-13 Thread Nikita Popov via cfe-commits
nikic wrote: Should be fixed by https://github.com/llvm/llvm-project/commit/940f89255e4a3982d94dad57837e8e658092af78. https://github.com/llvm/llvm-project/pull/107257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] 1c298c9 - [InstCombine] Preserve nuw flags when merging geps

2024-09-13 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-09-13T11:15:22+02:00 New Revision: 1c298c927498983dee29037ed1d3e71b72ca0082 URL: https://github.com/llvm/llvm-project/commit/1c298c927498983dee29037ed1d3e71b72ca0082 DIFF: https://github.com/llvm/llvm-project/commit/1c298c927498983dee29037ed1d3e71b72ca0082.diff

[clang] [RecursiveASTVisitor] Do not inline TraverseStmt (NFC) (PR #107601)

2024-09-13 Thread Nikita Popov via cfe-commits
nikic wrote: ping https://github.com/llvm/llvm-project/pull/107601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [X86] AMD Zen 5 Initial enablement (PR #107964)

2024-09-13 Thread Nikita Popov via cfe-commits
nikic wrote: Zen 5 support in GCC was upstreamed more than half a year ago -- why is the LLVM support being upstreamed only now, after missing the 19.x window? What steps are being taken to ensure this does not happen again? The change to X86TargetParser.h looks ABI breaking to me. https://gi

[clang] [TableGen] Avoid repeated map lookups (NFC) (PR #108675)

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

[clang] [PowerPC] Fix incorrect store alignment for __builtin_vsx_build_pair() (PR #108606)

2024-09-14 Thread Nikita Popov via cfe-commits
@@ -18197,7 +18197,7 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID, CallOps.push_back(Ops[i]); llvm::Function *F = CGM.getIntrinsic(ID); Value *Call = Builder.CreateCall(F, CallOps); -return Builder.CreateAlignedStore(Call, Ops[0], MaybeAli

[clang] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do (PR #108549)

2024-09-14 Thread Nikita Popov via cfe-commits
nikic wrote: It looks like you're trying to undo https://github.com/llvm/llvm-project/pull/106612? cc @mgorny https://github.com/llvm/llvm-project/pull/108549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Frontend] Avoid repeated hash lookups (NFC) (PR #108738)

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

[clang] [TableGen] Avoid repeated hash lookups (NFC) (PR #108736)

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

[clang] [CodeGen] Avoid repeated hash lookup (NFC) (PR #108735)

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

[clang] [lld] [llvm] [mlir] [IR] Introduce `T` to `DataLayout` to represent flat address space if a target supports it (PR #108786)

2024-09-16 Thread Nikita Popov via cfe-commits
@@ -3050,6 +3050,19 @@ as follows: address space 0, this property only affects the default value to be used when creating globals without additional contextual information (e.g. in LLVM passes). +``T`` +Specifies the address space for a target's 'flat' address s

[clang] [RecursiveASTVisitor] Do not inline TraverseStmt (NFC) (PR #107601)

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

[clang] [Format] Avoid repeated hash lookups (NFC) (PR #108794)

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

[clang] [llvm] [CodeView] Flatten cmd args in frontend for LF_BUILDINFO (PR #106369)

2024-09-16 Thread Nikita Popov via cfe-commits
nikic wrote: FYI this is a measurable compile-time regression when compiling tiny files (e.g. see the red 7zip entries at the end of https://llvm-compile-time-tracker.com/compare.php?from=5c348f692a8dff98a3780d0b859fb0949eccbaca&to=f5ba3e1fa6b5f862789786fbb4b342dfc2c27c33&stat=instructions%3Au&

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-13 Thread Nikita Popov via cfe-commits
nikic wrote: To reuse the name with different semantics, I'd put removal and reuse in different releases, so it takes about half a year. (Deprecation itself can be very short-lived.) https://github.com/llvm/llvm-project/pull/111752 ___ cfe-commits ma

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

2024-10-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/112071 ___ 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 #112074)

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

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-14 Thread Nikita Popov via cfe-commits
@@ -1391,22 +1411,60 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { -// Check if the underlying value for the parameter is an argum

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

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

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

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

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-15 Thread Nikita Popov via cfe-commits
@@ -171,7 +171,7 @@ bool HexagonGenExtract::convert(Instruction *In) { // this value. if (!LogicalSR && (SR > SL)) return false; -APInt A = APInt(BW, ~0ULL).lshr(SR).shl(SL); +APInt A = APInt(BW, ~0ULL, true).lshr(SR).shl(SL); nikic wrote:

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-15 Thread Nikita Popov via cfe-commits
nikic wrote: > `APInt::getAllOnes` will assert if `BitWidth == 0`. > > [snip] For the record, this is fixed by https://github.com/llvm/llvm-project/pull/112227. https://github.com/llvm/llvm-project/pull/80309 ___ cfe-commits mailing list cfe-commits

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-15 Thread Nikita Popov via cfe-commits
@@ -273,8 +273,6 @@ PreservedAnalyses FunctionToLoopPassAdaptor::run(Function &F, llvm::any_cast(&IR)); const Loop **LPtr = llvm::any_cast(&IR); const Loop *L = LPtr ? *LPtr : nullptr; -if (!L) - L = &llvm::any_cast(IR)->getOutermostLoop();

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

2024-10-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LLVM changes LGTM https://github.com/llvm/llvm-project/pull/108051 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm] Support llvm::Any across shared libraries on windows (PR #108051)

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

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/80309 >From 96795194fc79359363bac0423516da2a06733047 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 19 Sep 2024 17:27:13 +0200 Subject: [PATCH 1/2] apint only --- clang/lib/AST/ByteCode/IntegralAP.h |

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-15 Thread Nikita Popov via cfe-commits
@@ -1159,7 +1159,9 @@ class ARMOperand : public MCParsedAsmOperand { if (!isImm()) return false; const MCConstantExpr *CE = dyn_cast(getImm()); if (!CE) return false; nikic wrote: Not quite, but this put me on the right path. I added a check for `i

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-12 Thread Nikita Popov via cfe-commits
@@ -1391,22 +1412,65 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { -// Check if the underlying value for the parameter is an argum

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-12 Thread Nikita Popov via cfe-commits
@@ -1358,18 +1360,37 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, auto &Context = CalledFunction->getContext(); // Collect valid attributes for all params. - SmallVector ValidParamAttrs; + SmallVector ValidObjParamAttrs, ValidExactParamAttrs; bool

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-12 Thread Nikita Popov via cfe-commits
@@ -787,6 +787,11 @@ class AttributeList { [[nodiscard]] AttributeList addRangeRetAttr(LLVMContext &C, const ConstantRange &CR) const; + /// Add the range attribute to the attribute set at the given arg index. + /// Returns a n

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-12 Thread Nikita Popov via cfe-commits
@@ -373,6 +373,13 @@ FPClassTest CallBase::getParamNoFPClass(unsigned i) const { return Mask; } +std::optional CallBase::getParamRange(unsigned ArgNo) const { nikic wrote: I don't think this API is used? https://github.com/llvm/llvm-project/pull/91101

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-12 Thread Nikita Popov via cfe-commits
@@ -1391,22 +1412,65 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { -// Check if the underlying value for the parameter is an argum

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-12 Thread Nikita Popov via cfe-commits
@@ -1391,22 +1412,65 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { -// Check if the underlying value for the parameter is an argum

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-12 Thread Nikita Popov via cfe-commits
@@ -1391,22 +1412,65 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { -// Check if the underlying value for the parameter is an argum

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-12 Thread Nikita Popov via cfe-commits
@@ -1391,22 +1412,65 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { -// Check if the underlying value for the parameter is an argum

[clang] [llvm] [Clang] Fix argument extensions in CGBlocks.cpp (PR #111740)

2024-10-09 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: > I realize this is not the approach you had in mind, but it would at least be > nice to hear the reasoning as to why something more elaborate would be > preferred? Basically, because this is an ABI-dependent property, so we should let the existing ABI hand

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-09 Thread Nikita Popov via cfe-commits
nikic wrote: The invoke merging problem still exists, though the impact dropped: ``` simplifycfg.NumInvokesMerged 136372 -> 136185 -0.14% ``` Need to adjust this: https://github.com/llvm/llvm-project/blob/774893dcd929c370bad714a70a7d670bb2d6f649/llvm/lib/Transforms/Utils/SimplifyCFG.cpp#L2782

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

2024-10-09 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGOpenMPRuntime] Avoid Type::getPointerTo() (NFC) (PR #112017)

2024-10-11 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/112017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-11 Thread Nikita Popov via cfe-commits
nikic wrote: > > `test_demangle` should definitely **not** be updated when renaming > > functions. > > Could you please explain a bit more since this is new to me? Thanks in > advance! The use of LLVM symbols in this file is incidental -- it's just a data set of mangled C++ symbol names. The

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-11 Thread Nikita Popov via cfe-commits
nikic wrote: `test_demangle` should definitely **not** be updated when renaming functions. https://github.com/llvm/llvm-project/pull/111752 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [llvm] [mlir] [polly] [NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (PR #111752)

2024-10-11 Thread Nikita Popov via cfe-commits
nikic wrote: TBH I am wondering if we should revert this rename. I don't think it's a good idea to reuse getDeclaration with substantially different semantics, and if we're not reusing it, then there's not much point to rename... Instead of having getOrInsertDeclaration + getDeclaration with a

[clang] [clang][CGOpenMPRuntime] Avoid Type::getPointerTo() (NFC) (PR #112017)

2024-10-11 Thread Nikita Popov via cfe-commits
@@ -1713,25 +1713,15 @@ llvm::Function *CGOpenMPRuntime::emitThreadPrivateVarDefinition( if (!Ctor && !Dtor) return nullptr; -llvm::Type *CopyCtorTyArgs[] = {CGM.VoidPtrTy, CGM.VoidPtrTy}; -auto *CopyCtorTy = llvm::FunctionType::get(CGM.VoidPtrTy, CopyCtorTy

[clang] [AST] Avoid repeated hash lookups (NFC) (PR #111327)

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

[clang] [StaticAnalyzer] Avoid repeated hash lookups (NFC) (PR #111272)

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

[clang] [ByteCode] Avoid repeated hash lookups (NFC) (PR #111273)

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

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-02 Thread Nikita Popov via cfe-commits
nikic wrote: Based on llvm-opt-benchmark results, it looks like there are some significant compile-time regressions, could you please take a look? I also see: ``` early-cse.NumCSECall 18050 -> 17883 -0.93% simplifycfg.NumInvokesMerged 121710 -> 120984 -0.60% ``` EarlyCSE uses isIdenticalTo and

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-02 Thread Nikita Popov via cfe-commits
nikic wrote: It may be a good idea to skip the inference for constant arguments. I see a decent amount of things like `range(i64 -2147483576, 34359738361) 272` in the diffs. Though I still don't think that we should be inferring range at all. https://github.com/llvm/llvm-project/pull/91101 __

[clang] [Basic] Avoid repeated hash lookups (NFC) (PR #111228)

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

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/80309 >From 96795194fc79359363bac0423516da2a06733047 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 19 Sep 2024 17:27:13 +0200 Subject: [PATCH 1/5] apint only --- clang/lib/AST/ByteCode/IntegralAP.h |

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-16 Thread Nikita Popov via cfe-commits
@@ -3600,8 +3600,11 @@ ExprResult Sema::ActOnCharacterConstant(const Token &Tok, Scope *UDLScope) { ExprResult Sema::ActOnIntegerConstant(SourceLocation Loc, uint64_t Val) { unsigned IntSize = Context.getTargetInfo().getIntWidth(); - return IntegerLiteral::Create(Context,

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-16 Thread Nikita Popov via cfe-commits
@@ -437,7 +437,9 @@ ExprResult Parser::createEmbedExpr() { SourceLocation StartLoc = ConsumeAnnotationToken(); if (Data->BinaryData.size() == 1) { Res = IntegerLiteral::Create(Context, - llvm::APInt(CHAR_BIT, Data->BinaryData.back()), +

[clang] [llvm] [NFC] Replace more DenseMaps with SmallDenseMaps (PR #111836)

2024-10-16 Thread Nikita Popov via cfe-commits
@@ -268,7 +268,7 @@ struct UniqueVirtualMethod { /// subobject in which that virtual function occurs). class OverridingMethods { using ValuesT = SmallVector; - using MapType = llvm::MapVector; + using MapType = llvm::SmallMapVector; nikic wrote: It looks l

[clang] [llvm] [NFC] Replace more DenseMaps with SmallDenseMaps (PR #111836)

2024-10-16 Thread Nikita Popov via cfe-commits
@@ -51,7 +51,7 @@ class ConstraintSystem { /// A map of variables (IR values) to their corresponding index in the /// constraint system. - DenseMap Value2Index; + SmallDenseMap Value2Index; nikic wrote: I'd add a using/typedef for this one, especially a

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/80309 >From 96795194fc79359363bac0423516da2a06733047 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 19 Sep 2024 17:27:13 +0200 Subject: [PATCH 1/6] apint only --- clang/lib/AST/ByteCode/IntegralAP.h |

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-16 Thread Nikita Popov via cfe-commits
@@ -1391,22 +1411,60 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { -// Check if the underlying value for the parameter is an argum

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-10-16 Thread Nikita Popov via cfe-commits
@@ -1391,22 +1411,60 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB, AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { -// Check if the underlying value for the parameter is an argum

[clang] [Tooling] Simplify code with StringMap::operator[] (NFC) (PR #113071)

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

[clang] [llvm] [MIPS] LLVM data layout give i128 an alignment of 16 for mips64 (PR #112084)

2024-10-17 Thread Nikita Popov via cfe-commits
nikic wrote: > @nikic I checked several other arch-32 situations with ForceEnableInt128, and > they all use `alloca i128, align 16`. But they did not modify the target > datalayout content with `i128:128`, should mips be consistent? I think either way is fine here. Something to consider though

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

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

[clang] [llvm] Reapply "[Inliner] Propagate more attributes to params when inlining (#91101)" (2nd Attempt) (PR #112749)

2024-10-17 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/112749 ___ 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 #111785)

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

[clang-tools-extra] [clang-change-namespace] Avoid repeated hash lookups (NFC) (PR #111784)

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

[clang-tools-extra] [clang-apply-replacements] Avoid repeated hash lookups (NFC) (PR #111783)

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

[clang] [Basic] Avoid repeated hash lookups (NFC) (PR #111467)

2024-10-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-10-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Avoid repeated hash lookups (NFC) (PR #111468)

2024-10-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Avoid repeated hash lookups (NFC) (PR #111225)

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

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

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

[clang] [Basic] Avoid repeated hash lookups (NFC) (PR #111228)

2024-10-05 Thread Nikita Popov via cfe-commits
@@ -92,11 +92,10 @@ parseTargetIDWithFormatCheckingOnly(llvm::StringRef TargetID, if (Sign != '+' && Sign != '-') return std::nullopt; bool IsOn = Sign == '+'; -auto Loc = FeatureMap->find(Feature); +auto [Loc, Inserted] = FeatureMap->try_emplace(Feature,

[clang] [DependencyScanning] Avoid repeated hash lookups (NFC) (PR #111088)

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

[clang] [TableGen] Avoid repeated hash lookups (NFC) (PR #111089)

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

[clang] [libclang] Avoid repeated hash lookups (NFC) (PR #111087)

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

[clang] [llvm] [MIPS] LLVM data layout give i128 an alignment of 16 for mips64 (PR #112084)

2024-10-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: This looks technically fine, but I'm having trouble finding a normative reference for this. Is there an ABI specification for N32/N64 somewhere? Also, what alignment does clang use for o32 with ForceEnableInt128? https://github.com/llvm/llvm-project/blob/cb2

[clang-tools-extra] [clangd] Simplify code with *Map::operator[] (NFC) (PR #111939)

2024-10-11 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/111939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [AST] Avoid repeated set lookups (NFC) (PR #112155)

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

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/80309 >From ab1d3f23ee1a8402403a61038effb9bb15c91a13 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 19 Sep 2024 17:27:13 +0200 Subject: [PATCH] apint only --- clang/lib/AST/ByteCode/IntegralAP.h | 6 +

[clang] [lldb] [llvm] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-10-14 Thread Nikita Popov via cfe-commits
nikic wrote: Ping. The PR no longer contains MLIR changes now. https://github.com/llvm/llvm-project/pull/80309 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [libcxx] [llvm] [libc++] Replace LIBCXX_ENABLE_STATIC_ABI_LIBRARY & friends by a new LIBCXX_CXX_ABI choice (PR #112978)

2024-11-04 Thread Nikita Popov via cfe-commits
nikic wrote: Looking at our current cmake config, we're using: ``` -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \ ``` Do I understand correctly that the new replacement for that would be? ``` -DLIBCXX_ABILIB_FOR_SHARED="shared-libcxxabi" \ -DLIBCXX_ABIL

[clang] [compiler-rt] [libcxx] [llvm] [libc++] Replace LIBCXX_ENABLE_STATIC_ABI_LIBRARY & friends by a new LIBCXX_CXX_ABI choice (PR #112978)

2024-11-04 Thread Nikita Popov via cfe-commits
nikic wrote: > Yes, that is correct. This patch should be changing your CMake config as > well, unless that config is not visible in the monorepo (or if I missed it). It's out of tree :) > > And those LIBCXX_ABILIB options are also the defaults, if I'm reading the > > docs right. > > Not qui

[clang] [llvm] [Loads] Check context instruction for context-sensitive derefability (PR #109277)

2024-11-04 Thread Nikita Popov via cfe-commits
nikic wrote: > Is it even possible for `isSafeToSpeculativelyExecute` to return `true` now > with the default (nullptr) CtxI for loads? Can > `isDereferenceableAndAlignedPointer` just short-circuit to `false` with null > CtxI? Yes, it's possible for anything where the derefability is not cont

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Nikita Popov via cfe-commits
nikic wrote: I do think this change still makes sense, especially from a consistency point of view. If SROA sets one of the value-based FMF flags (nsz) then it stands to reason that it should also set the other two (nnan and ninf). Unless there is some reason why nsz would be more problematic

[clang] [llvm] Remove leftover uses of llvm::Type::getPointerTo() (PR #114993)

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

[clang] [Clang] [NFC] Introduce `DynamicRecursiveASTVisitor` (PR #110040)

2024-11-05 Thread Nikita Popov via cfe-commits
nikic wrote: > I think these are a net positive change; @nikic are you comfortable with the > performance numbers? I feel like the changes come awfully close to falling > out in the noise aside from the positive improvements with building Clang, > but you look at compile time performance numbe

[clang] [llvm] [Loads] Check context instruction for context-sensitive derefability (PR #109277)

2024-11-04 Thread Nikita Popov via cfe-commits
nikic wrote: > @nikic I mean not in theory but currently. I don't see those (except allocas) > handled anywhere unless I'm missing something? The `I &&` part handles those. If it's a global or argument (thus not an instruction) we'll fall through to the return true. https://github.com/llvm/ll

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Nikita Popov via cfe-commits
nikic wrote: > I've rebased my PR so this branch could also contain phase-ordering test for > vectorizing predicated selects introduced by commit > [577c7dd](https://github.com/llvm/llvm-project/commit/577c7dd7cc4c5a9f62f9654cfa30ee9d55709426) Do I understand correctly that this PR doesn't cha

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: We should probably also handle `no-infs-fp-math` to save the next person the trouble. https://github.com/llvm/llvm-project/pull/114271 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Nikita Popov via cfe-commits
@@ -1140,6 +1148,15 @@ void PromoteMem2Reg::RenamePass(BasicBlock *BB, BasicBlock *Pred, if (isa(APN) && NoSignedZeros) APN->setHasNoSignedZeros(true); +// This allows select instruction folding relevant to floating point +// reductions whose

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

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

<    4   5   6   7   8   9   10   11   12   13   >