[PATCH] [GVN] Perform Scalar PRE on gep indices that feed loads before doing Load PRE

Balaram Makam bmakam at codeaurora.org
Mon Nov 3 15:25:22 PST 2014


Hi jmolloy, dberlin, apazos, Jiangning, HaoLiu, mcrosier, hfinkel,

All, 

This patch addresses the missing PRE opportunities initially reported by James Molloy in 450.soplex

This patch re-factors James' patch to "Make GVN more iterative" based on the comments/suggestions from Daniel that iterating all of GVN over again is pretty big hammer.
Instead of iterating GVN all over, this patch does a ScalarPRE of any scalar instructions that a load is dependent on, before performing LoadPRE on that load.

When tested on a Cortex-A57, James' initial patch to make GVN more iterative improved 450.soplex by 3%. This patch improved 450.soplex by 7% without iterating GVN all over again.
In order to achieve this I had to enable the reverse post order traversal for iterateOnFunction because we would have to value number dependent scalar instructions before performing ScalarPRE on them. Although, traversing in reverse post order is costly in terms of compile time but this may be cheaper than iterating GVN all over again and also results in better performance. What do you guys think?

http://reviews.llvm.org/D6103

Files:
  lib/Transforms/Scalar/GVN.cpp
  test/Transforms/GVN/pre-gep-load.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6103.15736.patch
Type: text/x-patch
Size: 16640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141103/f317e045/attachment.bin>


More information about the llvm-commits mailing list