Optimize %CHECK-BOUND away.
commit229481e91f87b35cff039ab43a21f5227a53bf9b
authorStas Boukarev <stassats@gmail.com>
Fri, 4 Dec 2015 15:43:53 +0000 (4 18:43 +0300)
committerStas Boukarev <stassats@gmail.com>
Fri, 4 Dec 2015 15:44:18 +0000 (4 18:44 +0300)
tree1935af01b2de1c6ac95e4627b89e1ac765ca1080
parent3aeeff262cbe5a39dc91e440d67aad35637df6eb
Optimize %CHECK-BOUND away.

Previously %CHECK-BOUND was translated to just (the (integer 0
(bound)) index) which was able to get optimized away, but didn't
retain any relevant information about the array for good error
messages.
Recently it was changed to
(progn (%check-bound-vop array bound index) (truly-the (integer 0 (bound)) index)),
but now only the cast was deleted away when types matched.

Introducing, BOUND-CAST, a subtype of CAST which always follows a
%CHECK-BOUND combination and they are deleted together and still
provides good errors and warnings.
src/code/array.lisp
src/compiler/array-tran.lisp
src/compiler/checkgen.lisp
src/compiler/ir1-translators.lisp
src/compiler/ir1opt.lisp
src/compiler/node.lisp
tests/array.pure.lisp