Fix https://github.com/llvm/llvm-project/issues/63579
% cat a.c void foo() {} % clang --target=arm-none-eabi -mthumb -mno-unaligned-access -fsanitize=kcfi a.c -S -o - | grep p2align .p2align 1 % clang --target=armv6m-none-eabi -fsanitize=function a.c -S -o - | grep p2align .p2align 1
Ensure that -fsanitize={function,kcfi} instrumented functions are aligned by at
least 4, so that loading the type hash before the function label will not cause
a misaligned access. This is especially important for -mno-unaligned-access
configurations that doesn't set setMinFunctionAlignment to 4 or greater.
With this patch, the generated assembly for the examples above will contain .p2align 2.
If __attribute__((aligned(N))) or -falign-functions=N is specified, the
larger alignment will be used.
Nit: These checks are the same now, so we can replace both lines with one CHECK: line. Also the other instance below.