[all-commits] [llvm/llvm-project] 821522: [RISCV] Add a test w/ RVV stack objects misalignin...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Tue May 17 01:01:44 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 821522d343cd127312fb07b53aa99e22b3aacc0c
      https://github.com/llvm/llvm-project/commit/821522d343cd127312fb07b53aa99e22b3aacc0c
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2022-05-17 (Tue, 17 May 2022)

  Changed paths:
    A llvm/test/CodeGen/RISCV/rvv/scalar-stack-align.ll

  Log Message:
  -----------
  [RISCV] Add a test w/ RVV stack objects misaligning non-RVV ones

This patch adds a simple test which demonstrates a miscompilation of
16-byte-aligned scalar (non-RVV) objects when combined with RVV stack
objects.

The RISCV stack is assumed to be aligned to 16 bytes, and this is
guaranteed/assumed to be true when setting up the stack. However, when
the stack contains RVV objects, we decrement the stack pointer by some
multiple of vlenb, which is only guaranteed to be aligned to 8 bytes.
This means that non-RVV objects specifically requiring 16-byte alignment
fall through the cracks and are misaligned. Objects requiring larger
alignment trigger stack realignment and thus should be okay.

Reviewed By: craig.topper

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




More information about the All-commits mailing list