[PATCH] D57335: [IR] Don't assume all functions are 4 byte aligned

Michael Platings via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 28 09:12:08 PST 2019


michaelplatings created this revision.
michaelplatings added reviewers: rs, rupprecht, miyuki.
Herald added subscribers: llvm-commits, hiraditya, javed.absar.

This is based on previously discussed patches https://reviews.llvm.org/D55115 and https://reviews.llvm.org/D44781

D44781 <https://reviews.llvm.org/D44781> was abandoned on the understanding that tracking the alignment of function pointers was unlikely to be beneficial.
D55115 <https://reviews.llvm.org/D55115> was reverted after it emerged that it caused a code size regression because it removed an assumption about the alignment of function pointers.

This patch combines those two:
Add function pointer alignment to DataLayout.
If the function pointer alignment is set, use it. Otherwise, continue to assume that the alignment is 4 as before.


Repository:
  rL LLVM

https://reviews.llvm.org/D57335

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm/IR/DataLayout.h
  llvm/lib/IR/ConstantFold.cpp
  llvm/lib/IR/DataLayout.cpp
  llvm/lib/IR/Value.cpp
  llvm/lib/Target/ARM/ARMTargetMachine.cpp
  llvm/test/Analysis/ConstantFolding/func-and-folding.ll
  llvm/test/Analysis/ValueTracking/func-ptr-lsb.ll
  llvm/test/Assembler/2004-03-07-FunctionAddressAlignment.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57335.183881.patch
Type: text/x-patch
Size: 7657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190128/2c3dc473/attachment.bin>


More information about the llvm-commits mailing list