Files
clang-p2996/llvm/test/CodeGen/MIR/Generic/aligned-memoperands-err.mir
Jay Foad 719bac55df [MIRParser] Diagnose too large align values in MachineMemOperands
When parsing MachineMemOperands, MIRParser treated the "align" keyword
the same as "basealign". Really "basealign" should specify the
alignment of the MachinePointerInfo base value, and "align" should
specify the alignment of that base value plus the offset.

This worked OK when the specified alignment was no larger than the
alignment of the offset, but in cases like this it just caused
confusion:

    STW killed %18, 4, %stack.1.ap2.i.i :: (store (s32) into %stack.1.ap2.i.i + 4, align 8)

MIRPrinter would never have printed this, with an offset of 4 but an
align of 8, so it must have been written by hand. MIRParser would
interpret "align 8" as "basealign 8", but I think it is better to give
an error and force the user to write "basealign 8" if that is what they
really meant.

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

Change-Id: I7eeeefc55c2df3554ba8d89f8809a2f45ada32d8
2022-02-24 15:32:08 +00:00

11 lines
297 B
YAML

# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
---
name: aligned_memoperands
body: |
bb.0:
%0:_(p0) = IMPLICIT_DEF
; CHECK: :[[@LINE+1]]:73: specified alignment is more aligned than offset
%1:_(s32) = G_LOAD %0 :: (load (s32) from `i32* undef` + 12, align 8)
...