tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

revert-llvmorg-16-init-11301-g163bb6d64e5f_clang_21.patch (3158B)


      1 From cf00b30288c4c81b2c6a5af01c38f236148777a0 Mon Sep 17 00:00:00 2001
      2 From: Mike Hommey <mh@glandium.org>
      3 Date: Tue, 28 Mar 2023 06:13:36 +0900
      4 Subject: [PATCH] Revert "[Passes][VectorCombine] enable early run generally
      5 and try load folds"
      6 
      7 This reverts commit 163bb6d64e5f1220777c3ec2a8b58c0666a74d91.
      8 It causes various reftest regressions.
      9 ---
     10 llvm/lib/Passes/PassBuilderPipelines.cpp          |  7 ++++---
     11 llvm/lib/Transforms/Vectorize/VectorCombine.cpp   |  8 ++------
     12 9 files changed, 18 insertions(+), 19 deletions(-)
     13 
     14 diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
     15 index 07db107325f0..40045629af06 100644
     16 --- a/llvm/lib/Passes/PassBuilderPipelines.cpp
     17 +++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
     18 @@ -729,9 +729,10 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
     19   // Delete small array after loop unroll.
     20   FPM.addPass(SROAPass(SROAOptions::ModifyCFG));
     21 
     22 -  // Try vectorization/scalarization transforms that are both improvements
     23 -  // themselves and can allow further folds with GVN and InstCombine.
     24 -  FPM.addPass(VectorCombinePass(/*TryEarlyFoldsOnly=*/true));
     25 +  // The matrix extension can introduce large vector operations early, which can
     26 +  // benefit from running vector-combine early on.
     27 +  if (EnableMatrix)
     28 +    FPM.addPass(VectorCombinePass(/*TryEarlyFoldsOnly=*/true));
     29 
     30   // Eliminate redundancies.
     31   FPM.addPass(MergedLoadStoreMotionPass());
     32 diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
     33 index 019d79567b4a..b3e0f4cf0514 100644
     34 --- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
     35 +++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
     36 @@ -3500,23 +3500,6 @@ bool VectorCombine::run() {
     37 
     38     LLVM_DEBUG(dbgs() << "VC: Visiting: " << I << '\n');
     39 
     40 -    // These folds should be beneficial regardless of when this pass is run
     41 -    // in the optimization pipeline.
     42 -    // The type checking is for run-time efficiency. We can avoid wasting time
     43 -    // dispatching to folding functions if there's no chance of matching.
     44 -    if (IsFixedVectorType) {
     45 -      switch (Opcode) {
     46 -      case Instruction::InsertElement:
     47 -        MadeChange |= vectorizeLoadInsert(I);
     48 -        break;
     49 -      case Instruction::ShuffleVector:
     50 -        MadeChange |= widenSubvectorLoad(I);
     51 -        break;
     52 -      default:
     53 -        break;
     54 -      }
     55 -    }
     56 -
     57     // This transform works with scalable and fixed vectors
     58     // TODO: Identify and allow other scalable transforms
     59     if (IsVectorType) {
     60 @@ -3540,11 +3523,13 @@ bool VectorCombine::run() {
     61     if (IsFixedVectorType) {
     62       switch (Opcode) {
     63       case Instruction::InsertElement:
     64 +        MadeChange |= vectorizeLoadInsert(I);
     65         MadeChange |= foldInsExtFNeg(I);
     66         MadeChange |= foldInsExtBinop(I);
     67         MadeChange |= foldInsExtVectorToShuffle(I);
     68         break;
     69       case Instruction::ShuffleVector:
     70 +        MadeChange |= widenSubvectorLoad(I);
     71         MadeChange |= foldPermuteOfBinops(I);
     72         MadeChange |= foldShuffleOfBinops(I);
     73         MadeChange |= foldShuffleOfSelects(I);
     74 -- 
     75 2.47.0.1.g59ce1bf855