about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2015-01-08 16:28:07 +0100
committerBjörn Steinbrink <bsteinbr@gmail.com>2015-01-11 01:44:02 +0100
commit6ef08406dccdeeb828a6cfc7658ac149900e73ad (patch)
tree8038054383955ef2d8d2760b74f9e19e2306218d /src/rustllvm/RustWrapper.cpp
parent2100b10c4c61ac7c0fe67ae4c9a390eaf3708ae4 (diff)
downloadrust-6ef08406dccdeeb828a6cfc7658ac149900e73ad.tar.gz
rust-6ef08406dccdeeb828a6cfc7658ac149900e73ad.zip
Avoid loads/stores of first class aggregates
Currently, small aggregates are passed to functions as immediate values
as is. This has two consequences.

One is that aggregates are passed component-wise by LLVM, so e.g. a
struct containing four u8 values (e.g. an RGBA struct) will be passed as
four individual values.

The other is that LLVM isn't very good at optimizing loads/stores of
first class attributes. What clang does is converting the aggregate to
an appropriately sized integer type (e.g. i32 for the four u8 values),
and using that for the function argument. This allows LLVM to create
code that is a lot better.

Fixes #20450 #20149 #16506 #13927
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions