[llvm] r307338 - [ConstHoisting] Turn on consthoist-with-block-frequency by default.

Wei Mi via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 17:11:05 PDT 2017


Author: wmi
Date: Thu Jul  6 17:11:05 2017
New Revision: 307338

URL: http://llvm.org/viewvc/llvm-project?rev=307338&view=rev
Log:
[ConstHoisting] Turn on consthoist-with-block-frequency by default.

Using profile information to guide consthoisting is generally helpful for
performance, so the patch turns it on by default. No compile time or perf
regression were found using spec2000 and spec2006 on x86.  Some significant
improvement (>20%) was seen on internal benchmarks.

Differential Revision: https://reviews.llvm.org/D35063

Modified:
    llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp
    llvm/trunk/test/Transforms/ConstantHoisting/X86/ehpad.ll

Modified: llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp?rev=307338&r1=307337&r2=307338&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ConstantHoisting.cpp Thu Jul  6 17:11:05 2017
@@ -55,7 +55,7 @@ STATISTIC(NumConstantsHoisted, "Number o
 STATISTIC(NumConstantsRebased, "Number of constants rebased");
 
 static cl::opt<bool> ConstHoistWithBlockFrequency(
-    "consthoist-with-block-frequency", cl::init(false), cl::Hidden,
+    "consthoist-with-block-frequency", cl::init(true), cl::Hidden,
     cl::desc("Enable the use of the block frequency analysis to reduce the "
              "chance to execute const materialization more frequently than "
              "without hoisting."));

Modified: llvm/trunk/test/Transforms/ConstantHoisting/X86/ehpad.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ConstantHoisting/X86/ehpad.ll?rev=307338&r1=307337&r2=307338&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ConstantHoisting/X86/ehpad.ll (original)
+++ llvm/trunk/test/Transforms/ConstantHoisting/X86/ehpad.ll Thu Jul  6 17:11:05 2017
@@ -1,9 +1,6 @@
-; RUN: opt -S -consthoist < %s | FileCheck %s
+; RUN: opt -S -consthoist -consthoist-with-block-frequency=false < %s | FileCheck %s
 ; RUN: opt -S -consthoist -consthoist-with-block-frequency=true < %s | FileCheck --check-prefix=BFIHOIST %s
 
-; FIXME: The catchpad doesn't even use the constant, so a better fix would be to
-; insert the bitcast in the catchpad block.
-
 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-pc-windows-msvc"
 




More information about the llvm-commits mailing list