# LLVM backend: optimize memset with comptime-known element · gitcafe/zig

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

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

Visibility: public

Requested revision: 9295355985202c267b4326b5a6e2ad5158b48e5d

Requested commit: 9295355985202c267b4326b5a6e2ad5158b48e5d

Commit: 9295355985202c267b4326b5a6e2ad5158b48e5d

Tree: 31fd1162358b568f9adb34f11cc3e8e2074c6987

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
LLVM backend: optimize memset with comptime-known element

When the element is comptime-known, we can check if it has a repeated
byte representation. In this case, `@memset` can be lowered with the
LLVM intrinsic rather than with a loop.

```

## Parents

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

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