diff options
author | Chris Lattner <sabre@nondot.org> | 2010-12-15 06:38:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-12-15 06:38:24 +0000 |
commit | 2fc36e19b19bb7836e9ccc67c80c7fe7aa4f4a03 (patch) | |
tree | 632438bab4eacacb2fd73da0af3d60f8f07292fe | |
parent | 33e77d3cb98de64b8657c011b549bdb54abf73fc (diff) |
add a note about a SPEC hack that gcc mainline does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121849 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/README.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 836e74e6bc..70dc136c5f 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -1226,6 +1226,29 @@ loadpre14.c loadpre15.c actually a conditional increment: loadpre18.c loadpre19.c +//===---------------------------------------------------------------------===// + +[LOAD PRE / STORE SINKING / SPEC HACK] + +This is a chunk of code from 456.hmmer: + +int f(int M, int *mc, int *mpp, int *tpmm, int *ip, int *tpim, int *dpp, + int *tpdm, int xmb, int *bp, int *ms) { + int k, sc; + for (k = 1; k <= M; k++) { + mc[k] = mpp[k-1] + tpmm[k-1]; + if ((sc = ip[k-1] + tpim[k-1]) > mc[k]) mc[k] = sc; + if ((sc = dpp[k-1] + tpdm[k-1]) > mc[k]) mc[k] = sc; + if ((sc = xmb + bp[k]) > mc[k]) mc[k] = sc; + mc[k] += ms[k]; + } +} + +It is very profitable for this benchmark to turn the conditional stores to mc[k] +into a conditional move (select instr in IR) and allow the final store to do the +store. See GCC PR27313 for more details. Note that this is valid to xform even +with the new C++ memory model, since mc[k] is previously loaded and later +stored. //===---------------------------------------------------------------------===// |