[IR] Don't assume all functions are 4 byte aligned
authorRanjeet Singh <Ranjeet.Singh@arm.com>
Tue, 4 Dec 2018 00:01:23 +0000 (00:01 +0000)
committerRanjeet Singh <Ranjeet.Singh@arm.com>
Tue, 4 Dec 2018 00:01:23 +0000 (00:01 +0000)
commitf5d1b6413f4f9a160e030b1a467be0aee7dbfafc
tree6c8de6bff82e569ebc92282515968ad097f9d048
parentd97feef2de78440d77920848a469cf98453833d4
[IR] Don't assume all functions are 4 byte aligned

In some cases different alignments for function might be used to save
space e.g. thumb mode with -Oz will try to use 2 byte function
alignment. Similar patch that fixed this in other areas exists here
https://reviews.llvm.org/D46110

Differential Revision: https://reviews.llvm.org/D55115

llvm-svn: 348215
llvm/lib/IR/ConstantFold.cpp
llvm/test/Analysis/ConstantFolding/func-and-folding.ll [new file with mode: 0644]
llvm/test/Assembler/2004-03-07-FunctionAddressAlignment.ll [deleted file]