Don't splice in vector creation when optimizing vector-length.
Closes PR13788. original commit: d9264525bd823052cd456df0caa900eac2d87ed3
This commit is contained in:
parent
60f3bcbc46
commit
724cd37520
9
collects/tests/typed-racket/optimizer/tests/pr13788.rkt
Normal file
9
collects/tests/typed-racket/optimizer/tests/pr13788.rkt
Normal file
|
@ -0,0 +1,9 @@
|
|||
#;
|
||||
(
|
||||
TR opt: pr13788.rkt 9:0 (vector-length (vector 1 2 3)) -- known-length vector-length
|
||||
3
|
||||
)
|
||||
|
||||
#lang typed/racket
|
||||
|
||||
(vector-length (vector 1 2 3)) ; should not print the vector
|
|
@ -44,7 +44,7 @@
|
|||
(add-disappeared-use #'op)
|
||||
(match (type-of #'v)
|
||||
[(tc-result1: (HeterogeneousVector: es))
|
||||
#`(begin v.opt #,(length es))]))) ; v may have side effects
|
||||
#`(let () v.opt #,(length es))]))) ; v may have side effects
|
||||
;; we can optimize vector-length on all vectors.
|
||||
;; since the program typechecked, we know the arg is a vector.
|
||||
;; we can optimize no matter what.
|
||||
|
|
Loading…
Reference in New Issue
Block a user