[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2024-07-23 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: I think this is missing some test coverage for the `!align` values. Right now it just includes test updates, and I don't think the actual value is checked anywhere. https://github.com/llvm/llvm-project/pull/98746

[clang] [llvm] [mlir] Remove the `x86_mmx` IR type. (PR #98505)

2024-07-23 Thread Nikita Popov via cfe-commits
nikic wrote: 19.x has already branched, so it's fine to land this now (for LLVM 20). https://github.com/llvm/llvm-project/pull/98505 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix some type errors, add type annotations (PR #98745)

2024-07-21 Thread Nikita Popov via cfe-commits
nikic wrote: @DeinAlptraum It's a major change to the clang python bindings. In general, please refrain from landing major changes immediately before branching (and certainly do not backport them to the release branch). https://github.com/llvm/llvm-project/pull/98745

[clang] [libclang/python] Fix some type errors, add type annotations (PR #98745)

2024-07-21 Thread Nikita Popov via cfe-commits
nikic wrote: https://github.com/llvm/llvm-project/pull/78114 should absolutely not go onto the release branch -- and with that in mind, please hold off on merging this PR until LLVM 19 has branched as well. https://github.com/llvm/llvm-project/pull/98745

[clang] [clang] Add -Wimplicit-fallthrough to -Wextra (PR #97926)

2024-07-21 Thread Nikita Popov via cfe-commits
nikic wrote: CTMark is not compiled with `-Wextra`, so we'd not get any useful data out of this patch. What changes does one have to do to enable `-Wimplicit-fallthrough` by default (not just for `-Wextra`)? https://github.com/llvm/llvm-project/pull/97926

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2024-07-21 Thread Nikita Popov via cfe-commits
@@ -2799,9 +2799,37 @@ CodeGenFunction::EmitLoadOfReference(LValue RefLVal, llvm::LoadInst *Load = Builder.CreateLoad(RefLVal.getAddress(), RefLVal.isVolatile()); CGM.DecorateInstructionWithTBAA(Load, RefLVal.getTBAAInfo()); - return

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

2024-07-19 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/99620 >From 23bdf84091020df916441b3ed2d2cc74f4059e37 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 19 Jul 2024 11:02:56 +0200 Subject: [PATCH] [CVP] Infer range return attribute We already infer this in IPSCCP,

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

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

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

2024-07-19 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/99620 We already infer this in IPSCCP, but as that pass runs very early, it cannot make use of simplifications (in particular post-inline simplifications). This fixes most cases from

[clang] Performance optimizations for function effects (nonblocking attribute etc.) (PR #96844)

2024-07-17 Thread Nikita Popov via cfe-commits
nikic wrote: Thanks for following up on this! For the record, this was the final result: https://llvm-compile-time-tracker.com/compare.php?from=18cdfa72e046a40d4372ee98602fd1a65a94=0bb68b55715487447ffceaa1ab59f7a0bc8c7979=instructions:u https://github.com/llvm/llvm-project/pull/96844

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

2024-07-16 Thread Nikita Popov via cfe-commits
nikic wrote: I can see the argument for dereferenceable_or_null, but I don't see any way in which range will be useful. https://github.com/llvm/llvm-project/pull/91101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[libunwind] [libunwind] Undefined behaviour pointer arithmetic with null pointer (PR #98648)

2024-07-12 Thread Nikita Popov via cfe-commits
@@ -230,8 +230,13 @@ void DwarfFDECache::iterateCacheEntries(void (*func)( } #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) - -#define arrayoffsetof(type, index, field) ((size_t)(&((type *)0)[index].field)) +template +__attribute__((no_sanitize("undefined"))) static

[clang] [clang][NFC] Fix a warning (PR #98611)

2024-07-12 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/98611 ___ 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-07-12 Thread Nikita Popov via cfe-commits
nikic wrote: > Okay, so x86_64 describes it in byte terms and says they're little-endian, > which is consistent with the overall target. Interestingly, it does not > guarantee the content of the excess bits. The code-generation in this patch > is consistent with that: the extension we do is

[clang] [NFC][Clang] Move set functions out BranchProtectionInfo. (PR #98451)

2024-07-11 Thread Nikita Popov via cfe-commits
@@ -413,6 +414,12 @@ class TargetCodeGenInfo { return nullptr; } + void setFnAttributes(const TargetInfo::BranchProtectionInfo , nikic wrote: ```suggestion void setBranchProtectionFnAttributes(const TargetInfo::BranchProtectionInfo , ``` Or so? The

[clang] [NFC][Clang] Move set functions out BranchProtectionInfo. (PR #98451)

2024-07-11 Thread Nikita Popov via cfe-commits
@@ -133,7 +133,7 @@ class AArch64TargetCodeGenInfo : public TargetCodeGenInfo { } } auto *Fn = cast(GV); -BPI.setFnAttributes(*Fn); +CGM.getTargetCodeGenInfo().setFnAttributes(BPI, *Fn); nikic wrote: ```suggestion

[clang] [NFC][Clang] Move functions of BranchProtectionInfo out of line (PR #98329)

2024-07-11 Thread Nikita Popov via cfe-commits
nikic wrote: > in some build config `TargetInfo.cpp` is built without dependency to > `LLVM-Core`. Okay, that means that putting this code inside Basic/ is a layering violation. You need to move it into CodeGen/. Probably best to revert the whole change in the meantime.

[clang] [NFC][Clang] Move functions of BranchProtectionInfo out of line (PR #98329)

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

[clang] [llvm] [Clang][ARM][AArch64] Alway emit protection attributes for functions. (PR #82819)

2024-07-10 Thread Nikita Popov via cfe-commits
@@ -32,7 +32,9 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSet.h" #include "llvm/Frontend/OpenMP/OMPGridValues.h" +#include "llvm/IR/Attributes.h" #include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Function.h" nikic wrote: Could you please

[clang] [lldb] [llvm] [llvm][TargetParser] Return StringMap from getHostCPUFeatures (PR #97824)

2024-07-09 Thread Nikita Popov via cfe-commits
@@ -20,16 +20,15 @@ using namespace llvm; int main(int argc, char **argv) { #if defined(__i386__) || defined(_M_IX86) || \ defined(__x86_64__) || defined(_M_X64) - StringMap features; - - if (!sys::getHostCPUFeatures(features)) + const < StringMap features =

[clang] [llvm] [SCCP] Add support for vectors (PR #98026)

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

[clang] [llvm] [SCCP] Add support for vectors (PR #98026)

2024-07-09 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/98026 >From e5c0cba0f065a8efab6c8a91d436f1309478 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 8 Jul 2024 15:02:31 +0200 Subject: [PATCH 1/2] [SCCP] Add support for vectors Add preliminary support for

[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

[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

[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 , auto = 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-07-05 Thread Nikita Popov via cfe-commits
@@ -1381,21 +1405,58 @@ static void AddParamAndFnBasicAttributes(const CallBase , 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 argument.

[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 , 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 argument.

[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 , auto = 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-07-05 Thread Nikita Popov via cfe-commits
@@ -1381,21 +1405,58 @@ static void AddParamAndFnBasicAttributes(const CallBase , 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 argument.

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

2024-07-05 Thread Nikita Popov via cfe-commits
nikic wrote: Did you check whether this has any compile-time impact? 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] [clang] fix the unexpected controlflow in `ParseTentative.cpp` (PR #95917)

2024-07-04 Thread Nikita Popov via cfe-commits
nikic wrote: The TryParseProtocolQualifiers code path can be reached using something like this: ``` struct X { }; void foo() { X; } ``` But I don't know how to make that valid code without it taking some different code path... https://github.com/llvm/llvm-project/pull/95917

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

2024-07-04 Thread Nikita Popov via cfe-commits
nikic wrote: @karthik-man LLVM *always* requires a correct data layout. Yes, that includes InstCombine. https://github.com/llvm/llvm-project/pull/68882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [Hashing] Use a non-deterministic seed if LLVM_ENABLE_ABI_BREAKING_CHECKS (PR #96282)

2024-07-02 Thread Nikita Popov via cfe-commits
@@ -322,24 +306,20 @@ struct hash_state { } }; - -/// A global, fixed seed-override variable. -/// -/// This variable can be set using the \see llvm::set_fixed_execution_seed -/// function. See that function for details. Do not, under any circumstances, -/// set or read

[clang] 05670b4 - [InstCombine] Remove root special case in demanded bits simplification

2024-07-02 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-07-02T11:14:36+02:00 New Revision: 05670b42f5b45710bfdba48dcb7e8c30c8c7478f URL: https://github.com/llvm/llvm-project/commit/05670b42f5b45710bfdba48dcb7e8c30c8c7478f DIFF: https://github.com/llvm/llvm-project/commit/05670b42f5b45710bfdba48dcb7e8c30c8c7478f.diff

[clang] 86b3794 - Reapply [InstCombine] Fix context for multi-use demanded bits simplification

2024-07-02 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-07-02T11:02:55+02:00 New Revision: 86b37944a70229b07626e63bdb9a46b4bc3d1460 URL: https://github.com/llvm/llvm-project/commit/86b37944a70229b07626e63bdb9a46b4bc3d1460 DIFF: https://github.com/llvm/llvm-project/commit/86b37944a70229b07626e63bdb9a46b4bc3d1460.diff

[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] [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

[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] [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 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:

[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=20869e8ed55c58696ce4e9dc3d18cd6af01ed49c=instructions:u https://github.com/llvm/llvm-project/pull/96620

[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

[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: https://llvm-compile-time-tracker.com/compare.php?from=317277e4f961edf13132914a58a26408db4ab0aa=6481dc57612671ebe77fe9c34214fba94e1b3b27=instructions:u So it might make sense to keep some explicit overloads for

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

2024-06-24 Thread Nikita Popov via cfe-commits
@@ -637,8 +637,7 @@ void ARMParallelDSP::InsertParallelMACs(Reduction ) { Intrinsic::getDeclaration(M, Intrinsic::arm_smlad) : Intrinsic::getDeclaration(M, Intrinsic::arm_smlald); -IRBuilder Builder(InsertAfter->getParent(), -

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

2024-06-24 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM if CI is happy. https://github.com/llvm/llvm-project/pull/96497 ___ 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
@@ -3136,7 +3136,7 @@ static void LLVMPositionBuilderImpl(IRBuilder<> *Builder, BasicBlock *Block, Instruction *Instr, bool BeforeDbgRecords) { BasicBlock::iterator I = Instr ? Instr->getIterator() : Block->end();

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

2024-06-24 Thread Nikita Popov via cfe-commits
@@ -44,15 +44,19 @@ template <> struct ilist_alloc_traits { iterator_range::iterator> getDbgRecordRange(DbgMarker *); +/// Class used to generate an insert position (ultimately always a +/// BasicBlock::iterator, which it will implicitly convert to) from either: +/// - An

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

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

[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

[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] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-21 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

[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] [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)

[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

[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

[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] [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

[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
@@ -63,10 +63,10 @@ class IRBuilderDefaultInserter { virtual ~IRBuilderDefaultInserter(); virtual void InsertHelper(Instruction *I, const Twine , -BasicBlock *BB, BasicBlock::iterator InsertPt) const { -if (BB)

[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; +

[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
@@ -1460,56 +1184,29 @@ static Value *getAISize(LLVMContext , Value *Amt) { return Amt; } -static Align computeAllocaDefaultAlign(Type *Ty, BasicBlock *BB) { - assert(BB && "Insertion BB cannot be null when alignment not provided!"); +static Align

[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 , -BasicBlock *BB, BasicBlock::iterator InsertPt) const { -if (BB)

[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
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] [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 =

[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] 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] [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

[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

[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

[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
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] [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-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] [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

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

2024-06-11 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] Revert "[llvm][IR] Extend BranchWeightMetadata to track provenance of weights" (PR #95060)

2024-06-11 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] [llvm] Revert "[llvm][IR] Extend BranchWeightMetadata to track provenance of weights" (PR #95060)

2024-06-11 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-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

[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] [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-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-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

[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] [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] [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

[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] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-06 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

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-06-03 Thread Nikita Popov via cfe-commits
nikic wrote: @mikaelholmen Thanks for the report, should be fixed by https://github.com/llvm/llvm-project/commit/bda8d1ad72fc72f21f6c536692594376d00db8b6. https://github.com/llvm/llvm-project/pull/92885 ___ cfe-commits mailing list

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

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

[clang] 51e459a - Revert "[ConstantFold] Remove non-trivial gep-of-gep fold (#93823)"

2024-05-31 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-05-31T10:37:32+02:00 New Revision: 51e459a561519c8d51e2b4cadddc0d1f99c8b7ef URL: https://github.com/llvm/llvm-project/commit/51e459a561519c8d51e2b4cadddc0d1f99c8b7ef DIFF: https://github.com/llvm/llvm-project/commit/51e459a561519c8d51e2b4cadddc0d1f99c8b7ef.diff

[clang] [llvm] [ConstantFold] Remove non-trivial gep-of-gep fold (PR #93823)

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

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-31 Thread Nikita Popov via cfe-commits
nikic wrote: > I wonder if compile-time regressions come from new translation units I add, > because they definitely include stuff. Yes, I believe that is the primary contributor. You can see the per-file breakdown here:

[clang] 63dc31b - Reapply [IR] Avoid creating icmp/fcmp constant expressions (#92885)

2024-05-31 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2024-05-31T08:55:59+02:00 New Revision: 63dc31b68b78bc0e5deef21b98cab72de997c471 URL: https://github.com/llvm/llvm-project/commit/63dc31b68b78bc0e5deef21b98cab72de997c471 DIFF: https://github.com/llvm/llvm-project/commit/63dc31b68b78bc0e5deef21b98cab72de997c471.diff

[clang] [llvm] [ConstantFold] Remove non-trivial gep-of-gep fold (PR #93823)

2024-05-31 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/93823 >From 7fbc0366638de3262294c1923a1b45aa6338fe8f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 30 May 2024 09:57:21 +0200 Subject: [PATCH 1/2] [ConstantFold] Remove non-trivial gep-of-gep fold This fold is

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-30 Thread Nikita Popov via cfe-commits
nikic wrote: These Sema refactorings have been increasing the time to build clang by a small increment with every patch -- this one is an extra large jump of 0.7%

[clang] [llvm] [ConstantFold] Remove non-trivial gep-of-gep fold (PR #93823)

2024-05-30 Thread Nikita Popov via cfe-commits
nikic wrote: > > because the DL-aware constant folding will take care of this anyway. > > Can you point out where we do this fold? https://github.com/llvm/llvm-project/blob/1f46729a18ef13c3ba4184ead1da4ab3037cb7ae/llvm/lib/Analysis/ConstantFolding.cpp#L865 > > I've only kept the

[clang] [llvm] [ConstantFold] Remove non-trivial gep-of-gep fold (PR #93823)

2024-05-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/93823 This fold is subtly incorrect, because DL-unaware constant folding does not know the correct index type to use, and just performs the addition in the type that happens to already be there. This is incorrect, since

  1   2   3   4   5   6   7   8   >