[PATCH] D39570: [SimplifyCFG] When merging conditional stores, don't count the store we're merging against the PHINodeFoldingThreshold

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 14:08:58 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL317368: [SimplifyCFG] When merging conditional stores, don't count the store we're… (authored by ctopper).

Changed prior to commit:
  https://reviews.llvm.org/D39570?vs=121383&id=121549#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39570

Files:
  llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/trunk/test/Transforms/SimplifyCFG/merge-cond-stores-2.ll


Index: llvm/trunk/test/Transforms/SimplifyCFG/merge-cond-stores-2.ll
===================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/merge-cond-stores-2.ll
+++ llvm/trunk/test/Transforms/SimplifyCFG/merge-cond-stores-2.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S < %s -simplifycfg -simplifycfg-merge-cond-stores=true -simplifycfg-merge-cond-stores-aggressively=false -phi-node-folding-threshold=2 | FileCheck %s
+; RUN: opt -S < %s -simplifycfg -simplifycfg-merge-cond-stores=true -simplifycfg-merge-cond-stores-aggressively=false -phi-node-folding-threshold=1 | FileCheck %s
 
 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
 target triple = "armv7--linux-gnueabihf"
Index: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -2901,7 +2901,9 @@
       else
         return false;
     }
-    return N <= PHINodeFoldingThreshold;
+    // The store we want to merge is counted in N, so add 1 to make sure
+    // we're counting the instructions that would be left.
+    return N <= (PHINodeFoldingThreshold + 1);
   };
 
   if (!MergeCondStoresAggressively &&


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39570.121549.patch
Type: text/x-patch
Size: 1365 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171103/e272b8df/attachment.bin>


More information about the llvm-commits mailing list