HomePhabricator

[Thumb] set code alignment for 16-bit load from constant pool

Authored by simonwallis2 on Jul 22 2020, 2:11 AM.

Description

[Thumb] set code alignment for 16-bit load from constant pool

Summary:
[Thumb] set code alignment for 16-bit load from constant pool

LLVM miscompiles this code when compiling for a target with v8.2-A FP16 and the Thumb ISA at -O0:

extern void bar(__fp16 P5);

int main() {

__fp16 P5 = 1.96875;
bar(P5);

}

The code section containing main has 2 byte alignment.
It needs to have 4 byte alignment,
because the load literal instruction has an offset from the
load address with the low 2 bits zeroed.

I do not include a test case in this check-in.
llc and llvm-mc do not exhibit this bug. They do not set code section alignment
in the same manner as clang.

Reviewers: dnsampaio

Reviewed By: dnsampaio

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

Details

Committed
simonwallis2Jul 22 2020, 2:12 AM
Reviewer
dnsampaio
Differential Revision
D84169: [Thumb] set code alignment for 16-bit load from constant pool
Parents
rG5567c62afa55: [Matrix] Add LowerMatrixIntrinsics to the NPM
Branches
Unknown
Tags
Unknown