[PATCH] D35063: [ConstHoisting] Turn on consthoist-with-block-frequency by default

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 10:28:41 PDT 2017


davidxl added inline comments.


================
Comment at: test/CodeGen/X86/fold-tied-op.ll:10
 ; CHECK:       addl {{.*#+}} 4-byte Folded Reload
+; CHECK:       orl  {{.*#+}} 4-byte Folded Reload
 ; CHECK:       xorl {{.*#+}} 4-byte Folded Reload
----------------
wmi wrote:
> davidxl wrote:
> > wmi wrote:
> > > davidxl wrote:
> > > > explain this change?
> > > After BFI based const hoisting enabled, some const is not hoisted to func entry. This will change live range and affect scheduling for live range shrinking (https://reviews.llvm.org/D32563). 
> > Can you add profile annotation so that the test behavior does not change?
> Adding profile annotation doesn't change the result. Currently BFI based const hoisting only hoists the const when the freq of the target bb is colder, so for case like "if(cond)  then use constA; else use constA", although constA is used both in then and else branch, it will not be hoisted before if(cond) because the freq doesn't change after the hoisting. 
If the frequency is equal, should it be hoisted (as it reduces size at least)?


Repository:
  rL LLVM

https://reviews.llvm.org/D35063





More information about the llvm-commits mailing list