[all-commits] [llvm/llvm-project] 94e4e3: [Thumb] set code alignment for 16-bit load from co...

simonwallis2 via All-commits all-commits at lists.llvm.org
Wed Jul 22 02:14:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 94e4e37d5564c401dcdc7f98d36d87020b6759e1
      https://github.com/llvm/llvm-project/commit/94e4e37d5564c401dcdc7f98d36d87020b6759e1
  Author: Simon Wallis <simon.wallis2 at arm.com>
  Date:   2020-07-22 (Wed, 22 Jul 2020)

  Changed paths:
    M llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
    A llvm/test/CodeGen/ARM/const-load-align-thumb.mir

  Log Message:
  -----------
  [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




More information about the All-commits mailing list