This is an archive of the discontinued LLVM Phabricator instance.

Avoid passing objects with __declspec(align) members by value (PR24113) - llvm part
Needs ReviewPublic

Authored by hans on Jul 13 2015, 5:07 PM.

Details

Reviewers
Bigcheese
rnk
Summary

This allows us to remove the specializations of AlignedCharArray<8> etc. that tried to use e.g. a union with 'double' to get alignment while avoiding the declspec. That work-around never really worked, as those unions wouldn't cause stack realignment, and an AlignedCharArray<8> on the stack would not necessarily be aligned.

Diff Detail

Event Timeline

hans updated this revision to Diff 29628.Jul 13 2015, 5:07 PM
hans retitled this revision from to Avoid passing objects with __declspec(align) members by value (PR24113) - llvm part.
hans updated this object.
hans added reviewers: rnk, Bigcheese.
hans set the repository for this revision to rL LLVM.
hans added a subscriber: llvm-commits.
rnk added inline comments.Jul 14 2015, 9:21 AM
include/llvm/ADT/iterator_range.h
35

I'd bug Chandler about this.

include/llvm/IR/PassManagerInternal.h
313

I'd bug Chandler about this.

include/llvm/Support/AlignOf.h
140–142

So, it occurs to me that MSVC can guarantee 1, 2, or 4 byte stack alignment on x86, just not 8 or more. Does it help reduce the diff if we undo these?

lib/CodeGen/AsmPrinter/DIEHash.h
137

For DIEValue, we could ask Duncan why he used AlignedCharArrayUnion instead of regular union in the first place.

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
192

The whole ARM asm parser probably didn't meant to pass these by value and can probably be committed as is.

hans added a comment.Jul 14 2015, 9:41 AM

I've worked around the PR by allocating the IntervalMap in ELF.h on the heap instead, r242157.

I probably won't pursue this patch further right now.

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
192

r242160