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

2024-07-05 Thread Nikita Popov via cfe-commits
@@ -1381,21 +1405,58 @@ 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 argumen

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

2024-07-05 Thread Nikita Popov via cfe-commits
@@ -1381,21 +1405,58 @@ 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 argumen

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

2024-07-05 Thread Nikita Popov via cfe-commits
@@ -1381,21 +1405,58 @@ 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 argumen

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

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

[clang] [flang] [llvm] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2024-07-05 Thread Nikita Popov via cfe-commits
nikic wrote: @htyu LLVM does not support this. Support for doing that was officially removed about ten years ago when data layout became mandatory, but even prior to that IR was already target-specific, e.g. due to target-specific ABI. I think some parts of MLIR may support this, but certainly

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

2024-07-05 Thread Nikita Popov via cfe-commits
nikic wrote: High level question: Are all of these really useful? For parameter attributes, there are really two types, ones that are used to reason about calls, and ones used to reason about function definitions. I think the split here is something like: * readonly/readnone: Mostly used for

[clang] [Clang][CodeGen] Fix type for atomic float incdec operators (PR #107075)

2024-09-04 Thread Nikita Popov via cfe-commits
nikic wrote: Manual backport for reference: https://github.com/llvm/llvm-project/pull/107184 https://github.com/llvm/llvm-project/pull/107075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [CGOpenMPRuntime] Use DenseMap::operator[] (NFC) (PR #107185)

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

[clang] [Clang] Fix handling of placeholder variables name in init captures (PR #107055)

2024-09-04 Thread Nikita Popov via cfe-commits
nikic wrote: For reference, the manual cherry pick is https://github.com/llvm/llvm-project/pull/107214. https://github.com/llvm/llvm-project/pull/107055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [llvm] [SPARC] Align i128 to 16 bytes in SPARC datalayouts (PR #106951)

2024-09-04 Thread Nikita Popov via cfe-commits
nikic wrote: > I guess this is a breaking change? Yes, but as previously discussed, it's acceptable breakage. > Following the discussion in the linked revision it looks like this also needs > some AutoUpgrade changes. Yes, this should be handled in UpgradeDataLayoutString(). https://github.

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

2024-09-04 Thread Nikita Popov via cfe-commits
nikic wrote: This should be ready to re-apply now. https://github.com/llvm/llvm-project/pull/105496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

2024-09-04 Thread Nikita Popov via cfe-commits
nikic wrote: Can this be closed in favor of https://github.com/llvm/llvm-project/pull/105496? https://github.com/llvm/llvm-project/pull/103088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

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

2024-09-04 Thread Nikita Popov via cfe-commits
nikic wrote: > To see how effective this would be, a lot of visitors all over the codebase > have been migrated to use the dynamic visitor. The results of this refactor > can be viewed > [here](https://llvm-compile-time-tracker.com/compare.php?from=27e5f505e5eee3da27c1515d6ed95d66fbe543ea&to=8

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

2024-09-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LG if CI is happy. https://github.com/llvm/llvm-project/pull/107257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CGOpenMPRuntime] Avoid repeated hash lookups (NFC) (PR #107358)

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

[clang] [Analysis] Avoid repeated hash lookups (NFC) (PR #107357)

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

[clang] [lldb] [llvm] [mlir] [APInt] Assert correct values in APInt constructor (PR #80309)

2024-09-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/80309 >From f6002ad249359131be6d668036b4f17ff43e67c7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 13 Aug 2024 15:11:18 +0200 Subject: [PATCH] apint only --- clang/lib/AST/ByteCode/IntegralAP.h | 6

[clang] [clang-tools-extra] [NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (PR #107301)

2024-09-05 Thread Nikita Popov via cfe-commits
@@ -15,6 +15,7 @@ #include "clang/Driver/InputInfo.h" #include "clang/Driver/Options.h" #include "clang/Driver/SanitizerArgs.h" +#include "llvm/Config/llvm-config.h" // for LLVM_HOST_TRIPLE nikic wrote: Possibly we should not have the include for cases like th

[clang] [clang-tools-extra] [NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (PR #107301)

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

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

2024-09-06 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/107601 As things are now, this reduces size of clang bootstrapped with ThinLTO by 0.3% and reduces thin link time by 0.3%. More importantly, it avoids a large regression once https://github.com/llvm/llvm-project/pull/10

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

2024-09-06 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/107601 >From f16539428465d61c9017c0f7686d9632913aa853 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 6 Sep 2024 17:45:14 +0200 Subject: [PATCH] [RecursiveASTVisitor] Do not inline TraverseStmt (NFC) --- clang/i

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

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

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

2024-09-07 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM with the note that converting these to SmallSetVector would probably be more elegant... https://github.com/llvm/llvm-project/pull/107728 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [CodeGen] Avoid repeated hash lookups (NFC) (PR #107736)

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

[clang] [FrontEnd] Use SetVector (NFC) (PR #107743)

2024-09-08 Thread Nikita Popov via cfe-commits
@@ -5157,14 +5163,12 @@ void RewriteModernObjC::CollectBlockDeclRefInfo(BlockExpr *Exp) { // Unique all "by copy" declarations. for (unsigned i = 0; i < BlockDeclRefs.size(); i++) if (!BlockDeclRefs[i]->getDecl()->hasAttr()) { nikic wrote: Can d

[clang] [FrontEnd] Use SetVector (NFC) (PR #107743)

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

[clang] [FrontEnd] Use SetVector (NFC) (PR #107743)

2024-09-08 Thread Nikita Popov via cfe-commits
@@ -4082,8 +4080,10 @@ std::string RewriteModernObjC::SynthesizeBlockFunc(BlockExpr *CE, int i, // Create local declarations to avoid rewriting all closure decl ref exprs. // First, emit a declaration for all "by ref" decls. - for (SmallVectorImpl::iterator I = BlockByRe

[clang] [CodeGen] Avoid repeated hash lookups (NFC) (PR #107759)

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

[clang] [Frontend] Use range-based for loops (NFC) (PR #107757)

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

[clang] [APINotes] Avoid repeated hash lookups (NFC) (PR #107758)

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

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-09 Thread Nikita Popov via cfe-commits
nikic wrote: It looks like this breaks the clang stage 2 build: https://llvm-compile-time-tracker.com/show_error.php?commit=3cdb30ebbc18fa894d3bd67aebcff76ce7c741ac https://github.com/llvm/llvm-project/pull/104458 ___ cfe-commits mailing list cfe-comm

[clang] 3681d85 - Revert "[Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (#104458)"

2024-09-09 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-09-09T21:10:12+02:00 New Revision: 3681d8552fb9e6cb15e9d45849ff2e34a25c518e URL: https://github.com/llvm/llvm-project/commit/3681d8552fb9e6cb15e9d45849ff2e34a25c518e DIFF: https://github.com/llvm/llvm-project/commit/3681d8552fb9e6cb15e9d45849ff2e34a25c518e.diff

[clang] [Lex] Avoid repeated hash lookups (NFC) (PR #107963)

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

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

[clang] [Tablegen] Avoid repeated hash lookps (NFC) (PR #107961)

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

[clang] [APINotes] Avoid repeated hash lookups (NFC) (PR #107959)

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

[clang] [llvm] [IR] Add method to GlobalVariable to change type of initializer. (PR #102553)

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

[clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)

2024-08-10 Thread Nikita Popov via cfe-commits
nikic wrote: Build fails with: ``` CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm-project-build-stage1/lib/Support -I/var/llvm-compile-time-tracker/llvm-project

[clang] [llvm] [DataLayout] Remove constructor accepting a pointer to Module (PR #102841)

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

[clang] [llvm] Add emitAtomicCompareExchangeBuiltin helper function (PR #101966)

2024-08-12 Thread Nikita Popov via cfe-commits
nikic wrote: The TLI dependency in Clang CodeGen is a pretty substantial departure from how things currently work -- with the major implication that you can no longer reliably run codegen for a target for which the corresponding LLVM backend has not been compiled. Currently, codegen tests assu

[clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)

2024-08-12 Thread Nikita Popov via cfe-commits
nikic wrote: I'm seeing a 0.06% increase in build time with this change. Per-file breakdown: http://llvm-compile-time-tracker.com/compare_clang.php?from=9a227ba3e129eaa89498b97421afefb1e9d681df&to=e354fa543d20a8f50ea678c4cfc7d6dc091ad569&stat=instructions%3Au&sortBy=interestingness Clearly, thi

[clang] [llvm] [HLSL][DXIL][SPIRV] Create llvm dot intrinsic and use for HLSL (PR #102872)

2024-08-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic requested changes to this pull request. Please create a separate RFC for these intrinsics. I don't think there is a consensus on these intrinsics, and https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294 covers way too much disparate ground (something like "t

[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

2024-08-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: As a high level comment: Do we need to pass through the nuw flag, rather than deriving it from signedIndices? Basically, I think that we should be emitting nuw if and only if `-fsanitize=undefined` would perform a check for unsigned overflow for that gep, a

[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

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

[clang] [clang] Emit nuw GEPs for array subscript expressions (PR #103088)

2024-08-14 Thread Nikita Popov via cfe-commits
@@ -4345,8 +4355,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, QualType ptrType = E->getBase()->getType(); Addr = emitArraySubscriptGEP(*this, Addr, Idx, E->getType(), !getLangOpts().isSignedOverflowDe

[clang] [llvm] [APInt] Assert correct values in APInt constructor (PR #80309)

2024-08-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/80309 >From ea98673ca75046290cffdbca76fa7272cb7d3db4 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 13 Aug 2024 15:11:18 +0200 Subject: [PATCH] apint only --- clang/lib/AST/Interp/IntegralAP.h | 6

[clang] [llvm] [mlir] [APInt] Assert correct values in APInt constructor (PR #80309)

2024-08-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/80309 >From 1d7578f5b8a5dcd8519344cc6c71ee54447b9923 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 13 Aug 2024 15:11:18 +0200 Subject: [PATCH 1/2] apint only --- clang/lib/AST/Interp/IntegralAP.h |

[clang] [compiler-rt] [ubsan] Display correct runtime messages for negative _BitInt (PR #96240)

2024-08-16 Thread Nikita Popov via cfe-commits
nikic wrote: The clang test also fails on s390x (big endian): ``` RUN: at line 2: /builddir/build/BUILD/llvm-project-ec29660c44e5e73d3b78f4884f9178036563fb25/llvm/s390x-redhat-linux-gnu/bin/clang -cc1 -internal-isystem /builddir/build/BUILD/llvm-project-ec29660c44e5e73d3b78f4884f9178036563fb25

[clang] [compiler-rt] [test] Prevent generation of the bigendian code inside clang test CodeGen/bit-int-ubsan.c (PR #104607)

2024-08-16 Thread Nikita Popov via cfe-commits
@@ -1,5 +1,5 @@ // REQUIRES: x86-registered-target nikic wrote: Is this REQUIRED needed? You normally do not need the backend to be available for clang codegen tests. https://github.com/llvm/llvm-project/pull/104607

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-07 Thread Nikita Popov via cfe-commits
@@ -897,7 +897,20 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) { } } - return nullptr; + bool Changed = false; + if (!Trunc.hasNoSignedWrap() && + ComputeMaxSignificantBits(Src, /*Depth=*/0, &Trunc) <= DestWidth) { +Trunc.setHasNoSignedWrap

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-09 Thread Nikita Popov via cfe-commits
@@ -897,7 +897,20 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) { } } - return nullptr; + bool Changed = false; + if (!Trunc.hasNoSignedWrap() && + ComputeMaxSignificantBits(Src, /*Depth=*/0, &Trunc) <= DestWidth) { +Trunc.setHasNoSignedWrap

[clang] [llvm] [InstCombine][CVP][SCCP] Add support for `uitofp nneg` (PR #86154)

2024-04-09 Thread Nikita Popov via cfe-commits
nikic wrote: Can you please split this into separate patches? Or at least split out the InstCombine part of it? https://github.com/llvm/llvm-project/pull/86154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [llvm] [InstCombine] Add canonicalization of `sitofp` -> `uitofp nneg` (PR #88299)

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

[clang] [llvm] [InstCombine] Add canonicalization of `sitofp` -> `uitofp nneg` (PR #88299)

2024-04-10 Thread Nikita Popov via cfe-commits
nikic wrote: Can the implementation of foldFBinOpOfIntCastsFromSign be simplified to use nneg instead of KnownBits after this change? https://github.com/llvm/llvm-project/pull/88299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [llvm] [InstCombine] Add canonicalization of `sitofp` -> `uitofp nneg` (PR #88299)

2024-04-11 Thread Nikita Popov via cfe-commits
nikic wrote: > > Can the implementation of foldFBinOpOfIntCastsFromSign be simplified to use > > nneg instead of KnownBits after this change? > > yeah we could. Should I do a survey of existing folds first to ensure we > don't incorrectly keep flags (like with `trunc nuw/nsw`) before integrati

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

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

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

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

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-11 Thread Nikita Popov via cfe-commits
@@ -897,7 +897,20 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) { } } - return nullptr; + bool Changed = false; + if (!Trunc.hasNoSignedWrap() && + ComputeMaxSignificantBits(Src, /*Depth=*/0, &Trunc) <= DestWidth) { +Trunc.setHasNoSignedWrap

[clang] [llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

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

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Nikita Popov via cfe-commits
@@ -139,24 +138,23 @@ define ptx_device i32 @test_ctaid_w() { define ptx_device i32 @test_nctaid_y() { ; CHECK: mov.u32 %r{{[0-9]+}}, %nctaid.y; -; RANGE: call i32 @llvm.nvvm.read.ptx.sreg.nctaid.y(), !range ![[GRID_SIZE_YZ:[0-9]+]] +; RANGE: call range(i32 1, 65536) i32 @llv

[clang-tools-extra] [clang-tidy] Remove redundant LINK_LIBS (PR #94588)

2024-06-06 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/94588 clangAnalysis is already being pulled in via clang_target_link_libraries(). Also listing it in LINK_LIBS means that we'll link both against the static libraries and the shared libclang-cpp.so library if CLANG_LINK_

[clang] [cmake] Respect CLANG_LINK_CLANG_DYLIB for objlibs (PR #93454)

2024-06-06 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/93454 >From b0bcd36b62a93e7d8bd0f7f01e857ce9aa7544c2 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 27 May 2024 11:56:41 +0200 Subject: [PATCH 1/2] [cmake] Respect CLANG_LINK_CLANG_DYLIB for objlibs add_clang_lib

[clang] [cmake] Respect CLANG_LINK_CLANG_DYLIB for objlibs (PR #93454)

2024-06-06 Thread Nikita Popov via cfe-commits
nikic wrote: I suspect I may have misdiagnosed the issue, and the actual problem may be just https://github.com/llvm/llvm-project/pull/94588. I'll double check whether this change is necessary before landing. https://github.com/llvm/llvm-project/pull/93454 _

[clang-tools-extra] [clang-tidy] Remove redundant LINK_LIBS (PR #94588)

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

[clang] [flang] [llvm] [mlir] [Flang]Fix for changed code at the end of AllocaIP. (PR #92430)

2024-06-06 Thread Nikita Popov via cfe-commits
nikic wrote: > > Allocas should be placed at the start of the entry block. > > Would it be acceptable to make this change such that the alloca's are at the > very start of the block? I have tried that, and it seems to work. It will > still mean changes to the tests, and I can't guarantee ALL a

[clang] [CodeGen] Simplify codegen for array initialization (PR #93956)

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

[clang] [flang] [llvm] [mlir] [Flang]Fix for changed code at the end of AllocaIP. (PR #92430)

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

[clang] [CodeGen] Simplify codegen for array initialization (PR #93956)

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

[clang-tools-extra] [clangd] Use clang_target_link_libraries() for clang libs (PR #94937)

2024-06-10 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/94937 Use clang_target_link_libraries() instead of LINK_LIBS when linking clang libraries. This ensures that in CLANG_LINK_CLANG_DYLIB mode we link against libclang-cpp.so (instead of linking against both it and the stat

[clang] [llvm] Revert "[llvm][IR] Extend BranchWeightMetadata to track provenance of weights" (PR #95060)

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

[clang] [llvm] Revert "[llvm][IR] Extend BranchWeightMetadata to track provenance of weights" (PR #95060)

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

[clang-tools-extra] [clangd] Use clang_target_link_libraries() for clang libs (PR #94937)

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

[clang] [llvm] [ConstantFold] Drop gep of gep fold entirely (PR #95126)

2024-06-11 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/95126 This is a followup to https://github.com/llvm/llvm-project/pull/93823 and drops the DataLayout-unaware GEP of GEP fold entirely. All cases are now left to the DataLayout-aware constant folder, which will fold every

[clang] [llvm] [ConstantFold] Drop gep of gep fold entirely (PR #95126)

2024-06-11 Thread Nikita Popov via cfe-commits
nikic wrote: > See > [51e459a](https://github.com/llvm/llvm-project/commit/51e459a561519c8d51e2b4cadddc0d1f99c8b7ef): > > > This causes some non-trivial text size increases in unoptimized builds for > > Bullet. Revert while I investigate. > > Can you double check this? This was mitigated by

[clang] [Clang] Swap range metadata to attribute for intrinsics. (PR #94851)

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

[clang] [llvm] [ConstantFold] Drop gep of gep fold entirely (PR #95126)

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

[clang] cece0a1 - Revert "[ConstantFold] Drop gep of gep fold entirely (#95126)"

2024-06-12 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-06-12T11:52:12+02:00 New Revision: cece0a105b29dcbb9d88d0aa264c4745c07a8456 URL: https://github.com/llvm/llvm-project/commit/cece0a105b29dcbb9d88d0aa264c4745c07a8456 DIFF: https://github.com/llvm/llvm-project/commit/cece0a105b29dcbb9d88d0aa264c4745c07a8456.diff

[clang] [llvm] [ConstantFold] Drop gep of gep fold entirely (PR #95126)

2024-06-12 Thread Nikita Popov via cfe-commits
nikic wrote: > I believe this broke our flang+openmp+offload bot: > https://lab.llvm.org/staging/#/builders/140/builds/10168 Happy to help > looking into it. That's for the heads-up, I've reverted this patch in https://github.com/llvm/llvm-project/commit/cece0a105b29dcbb9d88d0aa264c4745c07a84

[clang] [llvm] [ConstantFold] Drop gep of gep fold entirely (PR #95126)

2024-06-12 Thread Nikita Popov via cfe-commits
nikic wrote: @agozillon Thanks for looking into this! This change isn't urgent, so I'm happy to wait for your PR to go in first. https://github.com/llvm/llvm-project/pull/95126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [llvm] Reapply "[llvm][IR] Extend BranchWeightMetadata to track provenance o… (PR #95281)

2024-06-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. Looks good now, no text size of compile-time changes. https://github.com/llvm/llvm-project/pull/95281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] cc2dc09 - Reapply [ConstantFold] Drop gep of gep fold entirely (#95126)

2024-06-13 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-06-13T17:03:35+02:00 New Revision: cc2dc0916ad6a00ebc9373a58854d77cf73af122 URL: https://github.com/llvm/llvm-project/commit/cc2dc0916ad6a00ebc9373a58854d77cf73af122 DIFF: https://github.com/llvm/llvm-project/commit/cc2dc0916ad6a00ebc9373a58854d77cf73af122.diff

[clang-tools-extra] [llvm] [llvm] Remove the Legacy PM Hello example (PR #95708)

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

[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)

2024-06-18 Thread Nikita Popov via cfe-commits
@@ -118,6 +124,37 @@ llvm::Type *CodeGenTypes::ConvertTypeForMem(QualType T, bool ForBitField) { return R; } +bool CodeGenTypes::LLVMTypeLayoutMatchesAST(QualType ASTTy, +llvm::Type *LLVMTy) { + CharUnits ASTSize = Context.getTyp

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

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

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. Thanks for doing this, LGTM! https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -63,10 +63,10 @@ class IRBuilderDefaultInserter { virtual ~IRBuilderDefaultInserter(); virtual void InsertHelper(Instruction *I, const Twine &Name, -BasicBlock *BB, BasicBlock::iterator InsertPt) const { -if (

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -1460,56 +1184,29 @@ static Value *getAISize(LLVMContext &Context, Value *Amt) { return Amt; } -static Align computeAllocaDefaultAlign(Type *Ty, BasicBlock *BB) { - assert(BB && "Insertion BB cannot be null when alignment not provided!"); +static Align computeAllocaDefa

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -120,7 +120,8 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = Builder.CreateAlloca(Ty, ArraySize, Name); else Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), - ArraySize,

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -44,6 +44,23 @@ template <> struct ilist_alloc_traits { iterator_range::iterator> getDbgRecordRange(DbgMarker *); +class InsertPosition { + using InstListType = SymbolTableList, + ilist_parent>; + InstListType::iterator InsertAt; + +p

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -63,10 +63,10 @@ class IRBuilderDefaultInserter { virtual ~IRBuilderDefaultInserter(); virtual void InsertHelper(Instruction *I, const Twine &Name, -BasicBlock *BB, BasicBlock::iterator InsertPt) const { -if (

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
nikic wrote: It looks like polly needs an update as well. https://github.com/llvm/llvm-project/pull/94226 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

2024-06-19 Thread Nikita Popov via cfe-commits
@@ -1567,68 +1242,33 @@ void LoadInst::AssertOK() { "Ptr must have pointer type."); } -static Align computeLoadStoreDefaultAlign(Type *Ty, BasicBlock *BB) { - assert(BB && "Insertion BB cannot be null when alignment not provided!"); +static Align computeLoadStoreDefa

[clang] [llvm] [polly] [LLVM] Add InsertPosition union-type to remove overloads of Instruction-creation (PR #94226)

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

[clang] [llvm] [PassManager] Remove some unnecessary includes (NFC) (PR #96175)

2024-06-20 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/96175 SmallPtrSet.h and TimeProfiler.h are unused. CommandLine.h is only needed for the UseNewDbgInfoFormat declare, which can be moved to the places that need it. >From 09446aad3123c3051267fd3311ffc9ad2fb99486 Mon Sep 1

[clang] [llvm] [PassManager] Remove some unnecessary includes (NFC) (PR #96175)

2024-06-20 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/96175 >From 4da2e8622b296b644755c924f317d0be95ce4d42 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 20 Jun 2024 13:25:28 +0200 Subject: [PATCH] [PassManger] Remove some unnecessary includes (NFC) SmallPtrSet.h an

[clang] [lld] [llvm] [PassManager] Remove some unnecessary includes (NFC) (PR #96175)

2024-06-20 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/96175 >From 8a5e15bffd2bbb1fbb35968f38a0ad2ba067 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 20 Jun 2024 13:25:28 +0200 Subject: [PATCH 1/2] [PassManger] Remove some unnecessary includes (NFC) SmallPtrSet.

[clang] [lld] [llvm] [PassManager] Remove some unnecessary includes (NFC) (PR #96175)

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

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-20 Thread Nikita Popov via cfe-commits
nikic wrote: It looks like this PR was merged without being approved, and I also couldn't find the corresponding RFC for this addition on discourse. I've reverted it for now. https://github.com/llvm/llvm-project/pull/93841 ___ cfe-commits mailing lis

[clang-tools-extra] 48ef912 - [VFS] Avoid include (NFC)

2024-06-21 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-06-21T15:17:41+02:00 New Revision: 48ef912e2b32798b704af242e551a7090102c750 URL: https://github.com/llvm/llvm-project/commit/48ef912e2b32798b704af242e551a7090102c750 DIFF: https://github.com/llvm/llvm-project/commit/48ef912e2b32798b704af242e551a7090102c750.diff

[clang] 30299b8 - [CommandLine] Avoid ManagedStatic.h include (NFC)

2024-06-21 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-06-21T15:45:17+02:00 New Revision: 30299b87171cbad2dacb8b1ec0e75801785f16d9 URL: https://github.com/llvm/llvm-project/commit/30299b87171cbad2dacb8b1ec0e75801785f16d9 DIFF: https://github.com/llvm/llvm-project/commit/30299b87171cbad2dacb8b1ec0e75801785f16d9.diff

<    1   2   3   4   5   6   7   8   9   10   >