[llvm-commits] [PATCH] Add support for loads and stores of first class aggregrates to ScalarReplaceAggregrates

Matthijs Kooijman matthijs at stdin.nl
Fri May 30 07:43:52 PDT 2008


Hi,

the attached patch makes the scalar replace aggregates pass properly replace
loads and stores of/to first class aggregrates and allows it to break up
structs that are loaded from or stored to in this way. For examples of the
replacements, see the comments in the code.

The changes work properly for the normal breaking up of aggregrates.

There is also some special casing for when an aggregrate is small and would
fit into a single integer (such as bitfields). This patch does not implement
any changes to that part, apart from gracefully not touching aggregrates that
are loaded or stored to directly. Since I don't fully grasp how that part
works, I hope someone else can look at it.

I think this patch would be good to put in, since currently first class
structs aren't optimized by this patch and it can even assert when they are
present. Objections to committing this, even without the bitfield stuff?

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scalarrepl.diff
Type: text/x-diff
Size: 3355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080530/82b45343/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080530/82b45343/attachment.sig>


More information about the llvm-commits mailing list