# AstGen: improved logic for nodeMayNeedMemoryLocation · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/7efc2a06264170632e56256a5fad97e945768056)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 7efc2a06264170632e56256a5fad97e945768056

Requested commit: 7efc2a06264170632e56256a5fad97e945768056

Commit: 7efc2a06264170632e56256a5fad97e945768056

Tree: f96446fade460810afbdf4ccc003be2069e378de

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
AstGen: improved logic for nodeMayNeedMemoryLocation

 * `@as` and `@bitCast` no longer unconditionally return `true` from
   this function; they forward the question to their sub-expression.
 * fix `@splat` incorrectly being marked as needing a memory location
   (this function returns a SIMD vector; it definitely does not want a
   memory location).

Makes AstGen generate slightly nicer ZIR, which in turn generates
slightly nicer AIR, generating slightly nicer machine code in debug
builds.

It also means I can procrastinate implementing the bitcast_result_ptr
ZIR instruction semantic analysis :^)

```

## Parents

- [51a40f9a666085b53353f65f017bcf9bf18daaa3](https://git.cafe/gitcafe/zig/commit/51a40f9a666085b53353f65f017bcf9bf18daaa3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/7efc2a06264170632e56256a5fad97e945768056?format=markdown)
