From 74197b16c475bf9cad48ac148fcbc34e61c4e5bd Mon Sep 17 00:00:00 2001 From: Bike Date: Thu, 21 Sep 2023 09:56:58 -0400 Subject: [PATCH 1/2] Remove bad verification condition Actually comes up with e.g. ANSI MISC.316. --- BIR/verify.lisp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/BIR/verify.lisp b/BIR/verify.lisp index ee87027b..aeb8f354 100644 --- a/BIR/verify.lisp +++ b/BIR/verify.lisp @@ -290,14 +290,6 @@ If there are problems, a VERIFICATION-FAILED is signaled. If the verification pr "has mismatch between inputs ~a and outputs ~a" inst inputs outputs)) -(defun collect-duplicates (list) - ;; quadratic, but next lists are really short anyway - (loop with duplicates = nil - for (e . rest) on list - when (member e rest) - do (pushnew e duplicates) - finally (return duplicates))) - (defmethod verify progn ((instruction terminator)) ;; No successor (verify type decl) (test (null (successor instruction)) @@ -313,12 +305,7 @@ If there are problems, a VERIFICATION-FAILED is signaled. If the verification pr (test (not (set:presentp (next instruction) *seen-next*)) "shares its next-list ~a" instruction (next instruction)) - (set:nadjoinf *seen-next* (next instruction))) - ;; NEXT doesn't have any repeats other than maybe the normal - (let ((dupes (collect-duplicates (rest (next instruction))))) - (test (null dupes) - "has repeated elements in next-list ~a" - instruction dupes))) + (set:nadjoinf *seen-next* (next instruction)))) (defmethod verify progn ((instruction terminator0)) ;; No NEXT (verify type decl) From bf080c3a897bdfa9527e02936e336d514a46c360 Mon Sep 17 00:00:00 2001 From: Bike Date: Thu, 21 Sep 2023 09:59:06 -0400 Subject: [PATCH 2/2] BIR disassembler: Display new constants --- BIR/disassemble.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BIR/disassemble.lisp b/BIR/disassemble.lisp index d301f180..04c26ffe 100644 --- a/BIR/disassemble.lisp +++ b/BIR/disassemble.lisp @@ -45,6 +45,10 @@ (defgeneric disassemble-datum (datum)) (defmethod disassemble-datum ((value constant)) `',(constant-value value)) +(defmethod disassemble-datum ((value function-cell)) + `(function-cell ,(function-name value))) +(defmethod disassemble-datum ((value variable-cell)) + `(variable-cell ,(variable-name value))) (defmethod disassemble-datum ((value datum)) (or (gethash value *ids*) (setf (gethash value *ids*) @@ -157,7 +161,7 @@ (defmethod cleavir-bir-disassembler:disassemble ((module module)) (check-type module module) (cleavir-bir-disassembler:with-disassembly () - (list* (set:mapset 'list #'constant-value (constants module)) + (list* (set:mapset 'list #'disassemble-datum (constants module)) (set:mapset 'list #'cleavir-bir-disassembler:disassemble (functions module)))))