[clang] [clang] Expand invalid PCM diagnostic (PR #69489)

2023-10-18 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari created https://github.com/llvm/llvm-project/pull/69489 Summary: When a PCM file is loaded, it can go wrong in various ways. The current diagnostic only produces the name of the malformed PCM, not why it is malformed. Expand the diagnostic to display what went wro

[clang] [clang] Expand invalid PCM diagnostic (PR #69489)

2023-10-18 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/69489 >From 3fa795fae47d00ece00e9414a268610d3c4a6bf3 Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Fri, 22 Sep 2023 12:03:23 -0700 Subject: [PATCH 1/2] Expand invalid PCM diagnostic Summary: When a PCM file is lo

[clang] Add option to dump IR to files instead of stderr (PR #66412)

2023-09-27 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/66412 >From da5da863d20cd8bef88066bba931c068042833cf Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Thu, 7 Sep 2023 12:34:15 -0700 Subject: [PATCH 1/3] Add option to dump IR to files intstead of stderr This patch a

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-07 Thread Nuri Amari via cfe-commits
NuriAmari wrote: > What about an option that just redirects the PrintIRInstrumentation output to > files instead of stderr? The files can be something like `$N-$modulename.ll` > where `$N` is an int that increments. Yeah that's more or less what I'm working on now. My plan is: - Add a flag th

[clang] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-07 Thread Nuri Amari via cfe-commits
NuriAmari wrote: > What about an option that just redirects the PrintIRInstrumentation output to > files instead of stderr? The files can be something like `$N-$modulename.ll` > where `$N` is an int that increments. Yeah that's more or less what I'm working on now. My plan is: - Add a flag th

[clang] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-03 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/2] Add flags to dump IR to a file before and after LLVM passes

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-03 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/2] Add flags to dump IR to a file before and after LLVM passes

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-03 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/3] Add flags to dump IR to a file before and after LLVM passes

[clang] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-03 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/3] Add flags to dump IR to a file before and after LLVM passes

[clang] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/4] Add flags to dump IR to a file before and after LLVM passes

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/65179: >From 5d395c85b84e5a554df4b092014d38123e666c6c Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Tue, 29 Aug 2023 10:10:57 -0700 Subject: [PATCH 1/4] Add flags to dump IR to a file before and after LLVM passes

[clang] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
@@ -0,0 +1,71 @@ +; RUN: mkdir -p %t/logs +; RUN: rm -rf %t/logs + +; Basic dump before and after a single module pass +; RUN: opt %s -disable-output -passes='no-op-module' -ir-dump-directory %t/logs -dump-after=no-op-module -dump-before=no-op-module +; RUN: find %t/logs -type f

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
@@ -0,0 +1,71 @@ +; RUN: mkdir -p %t/logs +; RUN: rm -rf %t/logs + +; Basic dump before and after a single module pass +; RUN: opt %s -disable-output -passes='no-op-module' -ir-dump-directory %t/logs -dump-after=no-op-module -dump-before=no-op-module +; RUN: find %t/logs -type f

[clang] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari review_requested https://github.com/llvm/llvm-project/pull/65179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
NuriAmari wrote: I've tried this on a real application, and the output paths quickly get extremely long. So long that we fail to create the directory structure. Perhaps the nesting idea isn't the right choice after all. https://github.com/llvm/llvm-project/pull/65179 __

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-06 Thread Nuri Amari via cfe-commits
NuriAmari wrote: I've tried this on a real application, and the output paths quickly get extremely long. So long that we fail to create the directory structure. Perhaps the nesting idea isn't the right choice after all. https://github.com/llvm/llvm-project/pull/65179 __

[clang] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-07 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari closed https://github.com/llvm/llvm-project/pull/65179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add flags to dump IR to a file before and after LLVM passes (PR #65179)

2023-09-07 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari closed https://github.com/llvm/llvm-project/pull/65179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] Run ObjCContractPass in Default Codegen Pipeline (PR #92331)

2024-05-28 Thread Nuri Amari via cfe-commits
@@ -31,6 +31,10 @@ ; CHECK-NEXT: AArch64 Stack Tagging ; CHECK-NEXT: SME ABI Pass ; CHECK-NEXT: Exception handling preparation +; CHECK-NEXT: Dominator Tree Construction +; CHECK-NEXT: Basic Alias Analysis (stateless AA impl) +; CHECK-NEXT: F

[clang] [lld] [llvm] [LTO] enable `ObjCARCContractPass` only on optimized build (PR #101114)

2024-07-29 Thread Nuri Amari via cfe-commits
@@ -588,12 +588,6 @@ bool EmitAssemblyHelper::AddEmitPasses(legacy::PassManager &CodeGenPasses, // this also adds codegenerator level optimization passes. CodeGenFileType CGFT = getCodeGenFileType(Action); - // Add ObjC ARC final-cleanup optimizations. This is done as pa

[clang] [lld] [llvm] [LTO] enable `ObjCARCContractPass` only on optimized build (PR #101114)

2024-07-30 Thread Nuri Amari via cfe-commits
NuriAmari wrote: This pass is added in numerous places: https://github.com/search?q=repo%3Allvm%2Fllvm-project%20createObjCARCContractPass&type=code, and we were hoping to consolidate all the places and instead schedule it by default, or behind some kind of predicate. We haven’t been able to f

[clang] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-15 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari created https://github.com/llvm/llvm-project/pull/92331 Prior to this patch, when using -fthinlto-index= the ObjCARCContractPass isn't run prior to CodeGen, and instruction selection fails on IR containing arc intrinstics. The pass would normally be added here: h

[clang] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-15 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari edited https://github.com/llvm/llvm-project/pull/92331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-16 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari ready_for_review https://github.com/llvm/llvm-project/pull/92331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-16 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari edited https://github.com/llvm/llvm-project/pull/92331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-16 Thread Nuri Amari via cfe-commits
NuriAmari wrote: > Shouldn't this be added to the LTO code generator? In `libLTO` (used by > Apple's linker) it is added here `llvm/lib/LTO/ThinLTOCodeGenerator.cpp` Presumably because the pass is likely not useful unless targeting MachO, LLD does this via configuration hook: https://reviews.l

[clang] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-16 Thread Nuri Amari via cfe-commits
@@ -0,0 +1,19 @@ +; RUN: opt -thinlto-bc -o %t.o %s + +; RUN: llvm-lto2 run -thinlto-distributed-indexes %t.o \ +; RUN: -o %t2.index \ +; RUN: -r=%t.o,_use_arc,px + +; RUN: %clang_cc1 -triple x86_64-apple-darwin \ +; RUN: -emit-obj -fthinlto-index=%t.o.thinlto.bc \ +; RUN:

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-17 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/92331 >From 66ddf609c0e77867ec48c17136fb80d1e482041d Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Wed, 15 May 2024 16:33:03 -0700 Subject: [PATCH 1/2] Run ObjCContractPass in Distributed Thin-LTO Pipeline Prior t

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-17 Thread Nuri Amari via cfe-commits
NuriAmari wrote: > > Shouldn't this be added to the LTO code generator? In `libLTO` (used by > > Apple's linker) it is added here `llvm/lib/LTO/ThinLTOCodeGenerator.cpp` > > Presumably because the pass is likely not useful unless targeting MachO, LLD > does this via configuration hook: https:/

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-20 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/92331 >From 66ddf609c0e77867ec48c17136fb80d1e482041d Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Wed, 15 May 2024 16:33:03 -0700 Subject: [PATCH 1/3] Run ObjCContractPass in Distributed Thin-LTO Pipeline Prior t

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-20 Thread Nuri Amari via cfe-commits
@@ -101,6 +101,19 @@ class ARCRuntimeEntryPoints { llvm_unreachable("Switch should be a covered switch."); } + bool moduleContainsARCEntryPoints() { +assert(TheModule != nullptr && "Not initialized."); + +for (auto ARCInstricID : + enum_seq_inclusive(Int

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-20 Thread Nuri Amari via cfe-commits
NuriAmari wrote: > it seems like this should just be in the default codegen pipeline? you'd need > to change the pass to bail out early if there are no relevant intrinsics (by > checking if the module contains the intrinsic declaration) to not affect > compile times I've done this, and remove

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-20 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/92331 >From 66ddf609c0e77867ec48c17136fb80d1e482041d Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Wed, 15 May 2024 16:33:03 -0700 Subject: [PATCH 1/4] Run ObjCContractPass in Distributed Thin-LTO Pipeline Prior t

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-20 Thread Nuri Amari via cfe-commits
NuriAmari wrote: I've added the check back in, and reverted my custom check. There is too much going on in https://reviews.llvm.org/D92808 for me to quickly understand everything, but I don't see an obvious reason the check needed to be removed. @ahatanaka Please let me know if I'm missing so

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-20 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/92331 >From 66ddf609c0e77867ec48c17136fb80d1e482041d Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Wed, 15 May 2024 16:33:03 -0700 Subject: [PATCH 1/5] Run ObjCContractPass in Distributed Thin-LTO Pipeline Prior t

[clang] [lld] [llvm] Run ObjCContractPass in Distributed Thin-LTO Pipeline (PR #92331)

2024-05-21 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/92331 >From 66ddf609c0e77867ec48c17136fb80d1e482041d Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Wed, 15 May 2024 16:33:03 -0700 Subject: [PATCH 1/6] Run ObjCContractPass in Distributed Thin-LTO Pipeline Prior t

[clang] [lld] [llvm] Run ObjCContractPass in Default Codegen Pipeline (PR #92331)

2024-05-22 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari edited https://github.com/llvm/llvm-project/pull/92331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] Run ObjCContractPass in Default Codegen Pipeline (PR #92331)

2024-05-22 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/92331 >From 66ddf609c0e77867ec48c17136fb80d1e482041d Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Wed, 15 May 2024 16:33:03 -0700 Subject: [PATCH 1/7] Run ObjCContractPass in Distributed Thin-LTO Pipeline Prior t

[clang] [lld] [llvm] Run ObjCContractPass in Default Codegen Pipeline (PR #92331)

2024-05-23 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari closed https://github.com/llvm/llvm-project/pull/92331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CGData] Clang Options (PR #90304)

2024-09-13 Thread Nuri Amari via cfe-commits
NuriAmari wrote: > Do you see or expect any issues with using distributed ThinLTO? No seems good to me! https://github.com/llvm/llvm-project/pull/90304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [CGData] Clang Options (PR #90304)

2024-09-13 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari approved this pull request. https://github.com/llvm/llvm-project/pull/90304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-09-17 Thread Nuri Amari via cfe-commits
@@ -1558,6 +1562,60 @@ class InProcessThinBackend : public ThinBackendProc { return BackendThreadPool.getMaxConcurrency(); } }; + +/// This Backend will run ThinBackend process but throw away all the output from +/// the codegen. This class facilitates the first codegen

[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)

2024-09-17 Thread Nuri Amari via cfe-commits
@@ -1558,6 +1562,60 @@ class InProcessThinBackend : public ThinBackendProc { return BackendThreadPool.getMaxConcurrency(); } }; + +/// This Backend will run ThinBackend process but throw away all the output from +/// the codegen. This class facilitates the first codegen

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-11 Thread Nuri Amari via cfe-commits
@@ -2142,3 +2190,327 @@ std::vector lto::generateModulesOrdering(ArrayRef R) { }); return ModulesOrdering; } + +namespace { +// For this out-of-process backend no codegen is done when invoked for each +// task. Instead we generate the required information (e.g. the summary

[clang] Avoid Assertion Failure Using -fcs-profile-generate with distributed thin-lto (PR #129736)

2025-03-14 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari updated https://github.com/llvm/llvm-project/pull/129736 >From fc06ad49b1b166dd1ef09c8babe65c337487ee65 Mon Sep 17 00:00:00 2001 From: Nuri Amari Date: Mon, 3 Mar 2025 16:10:54 -0800 Subject: [PATCH 1/2] Move Clang distributd thin-lto codegen tests into their own d

[clang] Avoid Assertion Failure Using -fcs-profile-generate with distributed thin-lto (PR #129736)

2025-03-14 Thread Nuri Amari via cfe-commits
@@ -6,7 +6,7 @@ ; RUN: opt -thinlto-bc -o %t.o %s ; RUN: %clang_cc1 -triple x86_64-grtev4-linux-gnu \ -; RUN: -fthinlto-index=%S/Inputs/thinlto-distributed-backend-skip.bc \ +; RUN: -fthinlto-index=%S/../Inputs/thinlto-distributed-backend-skip.bc \ NuriAma

[clang] Avoid Assertion Failure Using -fcs-profile-generate with distributed thin-lto (PR #129736)

2025-03-14 Thread Nuri Amari via cfe-commits
https://github.com/NuriAmari edited https://github.com/llvm/llvm-project/pull/129736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits