functions with both inline expansions and compiler optimizations

Bug #392271 reported by Nikodemus Siivola
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Low
Unassigned

Bug Description

(do-all-symbols (s)
  (flet ((scan-name (s)
           (let* ((inline-exp (sb-int:info :function :inline-expansion-designator s))
                  (inlinep (sb-int:info :function :inlinep s))
                  (info (sb-int:info :function :info s))
                  (transforms (when info (and (sb-c::fun-info-transforms info) t)))
                  (templates (when info (and (sb-c::fun-info-templates info) t)))
                  #+nil
                  (pred (when info (and (sb-c::fun-info-predicate-type info)) t)))
             (when (and inline-exp
                        (or transforms templates #+nil pred))
               (print (list s inlinep
                            :transforms transforms
                            :templates templates))))))
    (scan-name s)
    (scan-name `(setf ,s))))

finds the following

(%POW :INLINE :TRANSFORMS NIL :TEMPLATES T)
(FLOOR :MAYBE-INLINE :TRANSFORMS T :TEMPLATES NIL)
(MOD :INLINE :TRANSFORMS T :TEMPLATES NIL)
(NTHCDR :MAYBE-INLINE :TRANSFORMS T :TEMPLATES NIL)
(CEILING :MAYBE-INLINE :TRANSFORMS T :TEMPLATES NIL)
(ARRAY-HAS-FILL-POINTER-P :INLINE :TRANSFORMS T :TEMPLATES NIL)
(KEYWORDP :MAYBE-INLINE :TRANSFORMS T :TEMPLATES NIL)
(REM :INLINE :TRANSFORMS T :TEMPLATES NIL)

The problem is that inlining defeats the compiler transforms, which could probably do a better job.

For some just nuking the inline expansion is probably TRT, but for some we may want to keep a %FOO version available for inlining if all transforms fails and no templates apply. Who knows, maybe it's the compiler magic that should go in some cases.

Tags: compiler
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.