This is an archive of the discontinued LLVM Phabricator instance.

Synchronize the NaCl DataLayout string with the one in clang
ClosedPublic

Authored by rafael on Dec 18 2013, 7:48 AM.

Details

Summary

Derek tells me they have local changes for DataLayout for NaCl.

This patch simply synchronizes llvm so that it produces the same string as clang. Once clang is using the llvm strings it should be easy to upstream the changes.

Diff Detail

Event Timeline

Thanks for looking at this.
Just to refresh my memory, the preferred alignment defaults to the ABI alignment, so e.g. i64:64:64 is equivalent to i64:64, correct?

lib/Target/ARM/ARMTargetMachine.cpp
93

NaCl uses AAPCS VFP conventions, with a stack alignment of 16 bytes. Would it make more sense just to set that in ARMSubtarget.cpp instead of special casing here?

lib/Target/X86/X86TargetMachine.cpp
43

I'm a little unclear about this; does this mean 64-bit targets have i64 but not f64?
NaCl does use f64:64 and i64:64 for both 32 and 64 bits, but I don't see where else but here that f64 is even set.

56

This can be removed. Clang seems to have it it upstream, but that's wrong. vectors are never generated for le32, and for i686-nacl and x86_64-nacl they have the same alignment as linux.

59

I think this condition can move to just the stack alignment, as we use s32-n8:16:32-S128 for i686-nacl and s:64-n8:16:32:64-S128 for x86_64-nacl

rafael updated this revision to Unknown Object (????).Dec 18 2013, 4:15 PM

Updated with the new strings in clang.

LGTM, thanks!

rafael accepted this revision.Dec 18 2013, 4:51 PM

Committed as r197640.

rafael closed this revision.Dec 18 2013, 4:51 PM
jfb added a subscriber: jfb.Oct 15 2014, 3:28 PM
jfb added inline comments.
lib/Target/X86/X86TargetMachine.cpp
50

I'm editing this line in D5807.