diff options
author | Timm Baeder <tbaeder@redhat.com> | 2025-05-09 09:02:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-09 09:02:25 +0200 |
commit | 7439d7bdf5aa0069c91693ec590561f234d05c20 (patch) | |
tree | 950c6255e4a9a6928b3a5b29ce069acd0e10074d /clang/lib/CodeGen | |
parent | 52924a2d7255cdd280b2b82dad8616e01fe065da (diff) | |
download | llvm-7439d7bdf5aa0069c91693ec590561f234d05c20.zip llvm-7439d7bdf5aa0069c91693ec590561f234d05c20.tar.gz llvm-7439d7bdf5aa0069c91693ec590561f234d05c20.tar.bz2 |
[clang][bytecode] Slightly optimize integral casts of literals (#138879)
We often see initializers like
unsigned a = 10;
which take an integer literal and immediately cast it to another type.
Recognize this pattern and omit the cast, simply emitting the value as a
different type directly.
This reduces the instruction count by up to 0.13%:
http://llvm-compile-time-tracker.com/compare.php?from=303436c6d16518b35288d63a859506ffcc1681e4&to=648f5202f906d1606390b2d1081e4502dc74acc2&stat=instructions:u
Diffstat (limited to 'clang/lib/CodeGen')
0 files changed, 0 insertions, 0 deletions