[commit: ghc] master: remove redundant condition checking in profiling RTS code (b3d9636)

git at git.haskell.org git at git.haskell.org
Wed Jul 2 15:12:19 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b3d9636af37cfafbc947b69dff5747065f437804/ghc

>---------------------------------------------------------------

commit b3d9636af37cfafbc947b69dff5747065f437804
Author: osa1 <omeragacan at gmail.com>
Date:   Wed Jul 2 08:55:04 2014 -0500

    remove redundant condition checking in profiling RTS code
    
    Summary: A redundant condition checking is removed, as discussed in http://www.haskell.org/pipermail/ghc-devs/2014-June/005088.html
    
    Test Plan: validate
    
    Reviewers: simonmar, austin
    
    Reviewed By: austin
    
    Subscribers: simonmar, relrod, carter
    
    Differential Revision: https://phabricator.haskell.org/D37


>---------------------------------------------------------------

b3d9636af37cfafbc947b69dff5747065f437804
 rts/Profiling.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/rts/Profiling.c b/rts/Profiling.c
index 50c9c39..53f64a7 100644
--- a/rts/Profiling.c
+++ b/rts/Profiling.c
@@ -619,10 +619,8 @@ actualPush_ (CostCentreStack *ccs, CostCentre *cc, CostCentreStack *new_ccs)
     ccsSetSelected(new_ccs);
 
     /* update the memoization table for the parent stack */
-    if (ccs != EMPTY_STACK) {
-        ccs->indexTable = addToIndexTable(ccs->indexTable, new_ccs, cc,
-                                          0/*not a back edge*/);
-    }
+    ccs->indexTable = addToIndexTable(ccs->indexTable, new_ccs, cc,
+                                      0/*not a back edge*/);
 
     /* return a pointer to the new stack */
     return new_ccs;



More information about the ghc-commits mailing list