[llvm-branch-commits] [llvm] [CodeGen] Limit number of analyzed predecessors (PR #142584)

2025-06-04 Thread Alexis Engelke via llvm-branch-commits
aengelke wrote: > Adding this threshold check within isTrellis() feels somewhat unnatural. If > compile time is a concern, could we simply check the size of functions (in > terms of the number of blocks, as opposed to predecessor only) early in this > pass and either skip it or switch to a fas

[llvm-branch-commits] [llvm] [CodeGen] Limit number of analyzed predecessors (PR #142584)

2025-06-04 Thread Alexis Engelke via llvm-branch-commits
@@ -1592,6 +1603,11 @@ bool MachineBlockPlacement::hasBetterLayoutPredecessor( BlockFrequency CandidateEdgeFreq = MBFI->getBlockFreq(BB) * RealSuccProb; bool BadCFGConflict = false; + // Compile-time optimization: runtime is quadratic in the number of aen

[llvm-branch-commits] [CodeGen] Limit number of analyzed predecessors (PR #142584)

2025-06-04 Thread Alexis Engelke via llvm-branch-commits
@@ -1030,6 +1036,11 @@ bool MachineBlockPlacement::isTrellis( SmallPtrSet SeenPreds; for (MachineBasicBlock *Succ : ViableSuccs) { +// Compile-time optimization: runtime is quadratic in the number of +// predecessors. For such uncommon cases, exit early. +if (S

[llvm-branch-commits] [llvm] [CodeGen] Limit number of analyzed predecessors (PR #142584)

2025-06-04 Thread Alexis Engelke via llvm-branch-commits
https://github.com/aengelke updated https://github.com/llvm/llvm-project/pull/142584 >From 4cbc231699c11444cff73ff28b88dc0f3835c752 Mon Sep 17 00:00:00 2001 From: Alexis Engelke Date: Wed, 4 Jun 2025 09:21:02 + Subject: [PATCH] Move one check to beginning of function Created using spr 1.3.

[llvm-branch-commits] [CodeGen] Limit number of analyzed predecessors (PR #142584)

2025-06-03 Thread Alexis Engelke via llvm-branch-commits
https://github.com/aengelke created https://github.com/llvm/llvm-project/pull/142584 MachineBlockPlacement has quadratic runtime in the number of predecessors: in some situation, for an edge, all predecessors of the successor are considered. Limit the number of considered predecessors to bound

[llvm-branch-commits] [CodeGen] Limit number of analyzed predecessors (PR #142584)

2025-06-03 Thread Alexis Engelke via llvm-branch-commits
aengelke wrote: NB: I don't claim to fully understand what this code does, but it seems to be safe to return a default value. [Example generator](https://github.com/tpde2/tpde/blob/f6e87d2e97f49f403c12a27e7cf513a44f0f5dbc/tpde-llvm/test/filetest/many-preds.test) to demonstrate the behavior, e.

[llvm-branch-commits] [Support] Use block numbers for LoopInfo BBMap (PR #103400)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
aengelke wrote: [c-t-t](http://llvm-compile-time-tracker.com/compare.php?from=2db9cb5fec35a7516b0e1d123d161ace78e14be6&to=c34780d18ac411ca2363eeff1cecd08aeb1d154a&stat=instructions:u) -0.13% stage2-O3 https://github.com/llvm/llvm-project/pull/103400 _

[llvm-branch-commits] [Support] Use block numbers for LoopInfo BBMap (PR #103400)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
https://github.com/aengelke created https://github.com/llvm/llvm-project/pull/103400 Replace the DenseMap from blocks to their innermost loop a vector indexed by block numbers, when possible. This requires updating the loop info when blocks are renumbered. This update is currently implemented b

[llvm-branch-commits] [llvm] [InstCombine] Don't look at ConstantData users (PR #103302)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
https://github.com/aengelke updated https://github.com/llvm/llvm-project/pull/103302 >From 6a2ac00a8424a4402475e2b7972bfb01330c3bf8 Mon Sep 17 00:00:00 2001 From: Alexis Engelke Date: Tue, 13 Aug 2024 16:10:38 + Subject: [PATCH 1/2] Only run instcombine in test case Created using spr 1.3.5

[llvm-branch-commits] [llvm] [InstCombine] Don't look at ConstantData users (PR #103302)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
https://github.com/aengelke updated https://github.com/llvm/llvm-project/pull/103302 >From 6a2ac00a8424a4402475e2b7972bfb01330c3bf8 Mon Sep 17 00:00:00 2001 From: Alexis Engelke Date: Tue, 13 Aug 2024 16:10:38 + Subject: [PATCH 1/2] Only run instcombine in test case Created using spr 1.3.5

[llvm-branch-commits] [llvm] [InstCombine] Don't look at ConstantData users (PR #103302)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
aengelke wrote: Done. Fun fact, llvm-reduce crashed on the input due to this bug. https://github.com/llvm/llvm-project/pull/103302 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.

[llvm-branch-commits] [llvm] [InstCombine] Don't look at ConstantData users (PR #103302)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
https://github.com/aengelke updated https://github.com/llvm/llvm-project/pull/103302 >From 6a2ac00a8424a4402475e2b7972bfb01330c3bf8 Mon Sep 17 00:00:00 2001 From: Alexis Engelke Date: Tue, 13 Aug 2024 16:10:38 + Subject: [PATCH 1/2] Only run instcombine in test case Created using spr 1.3.5

[llvm-branch-commits] [llvm] [InstCombine] Don't look at ConstantData users (PR #103302)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
@@ -0,0 +1,576 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 +; RUN: opt -mtriple=arm64 -passes='inline,function(sroa,jump-threading,instcombine)' -S < %s | FileCheck %s aengelke wrote: True, changed https

[llvm-branch-commits] [llvm] [InstCombine] Don't look at ConstantData users (PR #103302)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
https://github.com/aengelke updated https://github.com/llvm/llvm-project/pull/103302 >From 6a2ac00a8424a4402475e2b7972bfb01330c3bf8 Mon Sep 17 00:00:00 2001 From: Alexis Engelke Date: Tue, 13 Aug 2024 16:10:38 + Subject: [PATCH] Only run instcombine in test case Created using spr 1.3.5-bog

[llvm-branch-commits] [InstCombine] Don't look at ConstantData users (PR #103302)

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
https://github.com/aengelke created https://github.com/llvm/llvm-project/pull/103302 When looking at PHI operand for combining, only look at instructions and arguments. The loop later iteraters over Arg's users, which is not useful if Arg is a constant -- it's users are not meaningful and might

[llvm-branch-commits] [llvm] d0b1a58 - Address comments

2024-08-13 Thread Alexis Engelke via llvm-branch-commits
Author: Alexis Engelke Date: 2024-08-13T07:50:05Z New Revision: d0b1a582fd33e8c3605c027883c6deb35757f560 URL: https://github.com/llvm/llvm-project/commit/d0b1a582fd33e8c3605c027883c6deb35757f560 DIFF: https://github.com/llvm/llvm-project/commit/d0b1a582fd33e8c3605c027883c6deb35757f560.diff LOG

[llvm-branch-commits] [llvm] 084d025 - Address comments

2024-08-11 Thread Alexis Engelke via llvm-branch-commits
Author: Alexis Engelke Date: 2024-08-11T07:39:53Z New Revision: 084d02577eb68dd2b6260b9b1d12a61631e8d799 URL: https://github.com/llvm/llvm-project/commit/084d02577eb68dd2b6260b9b1d12a61631e8d799 DIFF: https://github.com/llvm/llvm-project/commit/084d02577eb68dd2b6260b9b1d12a61631e8d799.diff LOG

[llvm-branch-commits] [llvm] 1739628 - Fix SLPVectorize assumption that all users are in the same function

2024-08-10 Thread Alexis Engelke via llvm-branch-commits
Author: Alexis Engelke Date: 2024-08-11T05:55:56Z New Revision: 1739628f12950e3ddbd80418750b93cdc11b48e8 URL: https://github.com/llvm/llvm-project/commit/1739628f12950e3ddbd80418750b93cdc11b48e8 DIFF: https://github.com/llvm/llvm-project/commit/1739628f12950e3ddbd80418750b93cdc11b48e8.diff LOG