Commit 12056292 authored by Andreas Klebinger's avatar Andreas Klebinger Committed by Ben Gamari

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
parent 96d2eb27
......@@ -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
......
......@@ -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;
......
......@@ -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));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment