[PATCH] D33150: [CodeGenPrep]Forming branch from select aggressively in loop

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 13:45:24 PDT 2017


junbuml created this revision.
Herald added a subscriber: javed.absar.

When a SelectInst is in a critical path of a loop, we aggressively turn the SelectInst into a branch
so that we rely more on the branch predictor.

      

This change simply check if the SelectInst is in a single latch of a loop in isFormingBranchFromSelectProfitable().
Most of the changes in this patch is to update LoopInfo when there is any change in CFG.

With this change, I observed 5% performance gain in spec2000/vpr in kryo without any regression in other benchmarks in spec2000/spec2006.

I am sending this out early to get early feedback about the basic idea of this change as I do the tuning/testing in parallel. This is also more test cases.


https://reviews.llvm.org/D33150

Files:
  lib/CodeGen/CodeGenPrepare.cpp
  test/CodeGen/AArch64/aarch64-aggressive-select-to-branch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33150.98832.patch
Type: text/x-patch
Size: 14444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170512/63bd5a6b/attachment.bin>


More information about the llvm-commits mailing list