Minor CSE optimization
authorAndy Wingo <wingo@pobox.com>
Thu, 3 Apr 2014 07:40:18 +0000 (09:40 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 3 Apr 2014 07:40:18 +0000 (09:40 +0200)
* module/language/tree-il/cse.scm (cse): Use hashq instead of modulo to
  convert a full-width hash value to a vector index.

module/language/tree-il/cse.scm

index 5d0277f..d4cf686 100644 (file)
@@ -1,6 +1,6 @@
 ;;; Common Subexpression Elimination (CSE) on Tree-IL
 
-;; Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
 
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
 
   
   (define (hasher n)
-    (lambda (x size) (modulo n size)))
+    (lambda (x size) (hashq n size)))
 
   (define (add-to-db exp effects ctx db)
     (let ((v (vector exp effects ctx))