[PATCH] D57335: [IR] Don't assume all functions are 4 byte aligned
Michael Platings via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 25 08:17:15 PST 2019
michaelplatings updated this revision to Diff 188184.
michaelplatings added a comment.
Herald added subscribers: cfe-commits, jdoerfert, mgorny, dschuff.
Herald added projects: clang, LLVM.
Hi @efriedma, sorry for the delayed response.
I've added the features you asked for to DataLayout.
It is intended that this patch preserves the existing behaviour if no function pointer alignment is specified.* Therefore I hope you'll agree that it isn't necessary for me to provide code to use the new feature on all platforms.
I did also look into using a target hook but doing so would require modifying a //lot// of functions to take a TargetTransformInfo argument. Given that we're in agreement that the DataLayout is an appropriate choice, it seemed like the best option.
- The exception to this is the case where the Function object doesn't have a parent - no alignment is assumed whereas previously 4-byte alignment was assumed. Hopefully this case is rare enough that code size won't be significantly impacted.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 28391 bytes
Desc: not available
More information about the cfe-commits