summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorklebinger.andreas@gmx.at <klebinger.andreas@gmx.at>2018-01-29 18:25:00 -0500
committerBen Gamari <ben@smart-cactus.org>2018-01-29 18:25:00 -0500
commit1205629228064537545a0be9c2e9a995aa2dcd03 (patch)
tree58b17898f7ac63f140bc6fb25ef68e94681ff763
parent96d2eb27eb86540796944253ce47b2bcd6a2df1c (diff)
downloadhaskell-1205629228064537545a0be9c2e9a995aa2dcd03.tar.gz
Add likely annotation to cmm files in a few obvious places.
Provide information about paths more likely to be taken in the cmm files used by the rts. This leads to slightly better assembly being generated. Reviewers: bgamari, erikd, simonmar Subscribers: alexbiehl, rwbarton, thomie, carter GHC Trac Issues: #14672 Differential Revision: https://phabricator.haskell.org/D4324
-rw-r--r--rts/Compact.cmm6
-rw-r--r--rts/PrimOps.cmm6
-rw-r--r--rts/Updates.cmm4
3 files changed, 8 insertions, 8 deletions
diff --git a/rts/Compact.cmm b/rts/Compact.cmm
index 174444db40..719dac87f1 100644
--- a/rts/Compact.cmm
+++ b/rts/Compact.cmm
@@ -174,7 +174,7 @@ eval:
prim %memcpy(to + cards, p + cards , size - cards, 1);
i = 0;
loop0:
- if (i < ptrs) {
+ if (i < ptrs) ( likely: True ) {
W_ q;
q = to + SIZEOF_StgMutArrPtrs + WDS(i);
call stg_compactAddWorkerzh(
@@ -200,7 +200,7 @@ eval:
prim %memcpy(to, p, size, 1);
i = 0;
loop0:
- if (i < ptrs) {
+ if (i < ptrs) ( likely: True ) {
W_ q;
q = to + SIZEOF_StgSmallMutArrPtrs + WDS(i);
call stg_compactAddWorkerzh(
@@ -241,7 +241,7 @@ eval:
loop1:
StgClosure_payload(to,i) = StgClosure_payload(p,i);
i = i + 1;
- if (i < ptrs + nptrs) goto loop1;
+ if (i < ptrs + nptrs) ( likely: True ) goto loop1;
}
// Next, recursively compact and copy the pointers
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 2b3a304d06..fb9db0aa45 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -263,7 +263,7 @@ stg_newArrayzh ( W_ n /* words */, gcptr init )
// Initialise all elements of the array with the value in R2
p = arr + SIZEOF_StgMutArrPtrs;
for:
- if (p < arr + SIZEOF_StgMutArrPtrs + WDS(n)) {
+ if (p < arr + SIZEOF_StgMutArrPtrs + WDS(n)) (likely: True) {
W_[p] = init;
p = p + WDS(1);
goto for;
@@ -392,7 +392,7 @@ stg_newArrayArrayzh ( W_ n /* words */ )
// Initialise all elements of the array with a pointer to the new array
p = arr + SIZEOF_StgMutArrPtrs;
for:
- if (p < arr + SIZEOF_StgMutArrPtrs + WDS(n)) {
+ if (p < arr + SIZEOF_StgMutArrPtrs + WDS(n)) (likely: True) {
W_[p] = arr;
p = p + WDS(1);
goto for;
@@ -426,7 +426,7 @@ stg_newSmallArrayzh ( W_ n /* words */, gcptr init )
// Initialise all elements of the array with the value in R2
p = arr + SIZEOF_StgSmallMutArrPtrs;
for:
- if (p < arr + SIZEOF_StgSmallMutArrPtrs + WDS(n)) {
+ if (p < arr + SIZEOF_StgSmallMutArrPtrs + WDS(n)) (likely: True) {
W_[p] = init;
p = p + WDS(1);
goto for;
diff --git a/rts/Updates.cmm b/rts/Updates.cmm
index b3b6b20ef3..9d00fb8efb 100644
--- a/rts/Updates.cmm
+++ b/rts/Updates.cmm
@@ -54,7 +54,7 @@ INFO_TABLE_RET ( stg_marked_upd_frame, UPDATE_FRAME,
// we know the closure is a BLACKHOLE
v = StgInd_indirectee(updatee);
- if (GETTAG(v) != 0) {
+ if (GETTAG(v) != 0) (likely: False) {
// updated by someone else: discard our value and use the
// other one to increase sharing, but check the blocking
// queues to see if any threads were waiting on this BLACKHOLE.
@@ -63,7 +63,7 @@ INFO_TABLE_RET ( stg_marked_upd_frame, UPDATE_FRAME,
}
// common case: it is still our BLACKHOLE
- if (v == CurrentTSO) {
+ if (v == CurrentTSO) (likely: True) {
updateWithIndirection(updatee, ret, return (ret));
}