From: Nikodemus Siivola Date: Fri, 19 Sep 2008 20:22:17 +0000 (+0000) Subject: 1.0.20.14: align loops on x86-64 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=6c7a026d79b5f971ac129846efe2d394239a0fee;p=sbcl.git 1.0.20.14: align loops on x86-64 * Intel recommends 16 byte alignment for branch target, and since code objects are 16 byte aligned on x86-64, we can get it. --- diff --git a/src/compiler/codegen.lisp b/src/compiler/codegen.lisp index e35909d..da07167 100644 --- a/src/compiler/codegen.lisp +++ b/src/compiler/codegen.lisp @@ -133,6 +133,18 @@ (when (and (eq (block-info 1block) block) (block-start 1block)) (sb!assem:assemble (*code-segment*) + ;; Align first emitted block of each loop: x86 and x86-64 both + ;; like 16 byte alignment, however, since x86 aligns code objects + ;; on 8 byte boundaries we cannot guarantee proper loop alignment + ;; there (yet.) + #!+x86-64 + (let ((cloop (sb!c::block-loop 1block))) + (when (and cloop + (sb!c::loop-tail cloop) + (not (sb!c::loop-info cloop))) + (sb!assem:align sb!vm:n-lowtag-bits #x90) + ;; Mark the loop as aligned by saving the IR1 block aligned. + (setf (sb!c::loop-info cloop) 1block))) (sb!assem:emit-label (block-label 1block))) (let ((env (block-physenv 1block))) (unless (eq env prev-env) diff --git a/src/compiler/vop.lisp b/src/compiler/vop.lisp index fbd0056..9f7ace3 100644 --- a/src/compiler/vop.lisp +++ b/src/compiler/vop.lisp @@ -430,7 +430,7 @@ ;; ;; :STRANGE ;; A segment of a "strange loop" in a non-reducible flow graph. - (kind (required-argument) :type (member :outer :natural :strange)) + (kind (missing-arg) :type (member :outer :natural :strange)) ;; The first and last blocks in the loop. There may be more than one tail, ;; since there may be multiple back branches to the same head. (head nil :type (or cblock null)) @@ -446,7 +446,9 @@ (depth 0 :type fixnum) ;; The head of the list of blocks directly within this loop. We must recurse ;; on INFERIORS to find all the blocks. - (blocks nil :type (or null cblock))) + (blocks nil :type (or null cblock)) + ;; Backend saves the first emitted block of each loop here. + (info nil)) (defprinter (cloop :conc-name loop-) kind diff --git a/version.lisp-expr b/version.lisp-expr index 9d5513a..babdc8f 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.20.13" +"1.0.20.14"