OSDN Git Service

Relax unaligned access assertion when type is byte aligned
authorDylan McKay <me@dylanmckay.io>
Sat, 9 Dec 2017 06:45:36 +0000 (06:45 +0000)
committerDylan McKay <me@dylanmckay.io>
Sat, 9 Dec 2017 06:45:36 +0000 (06:45 +0000)
commit68063cffdf93867fb787e6e2e9d7f47cc8b9a0d9
tree27b4e73b3f669d3e9fd6e65e9940b3f6feab174a
parentce39caef81ecf0369ae4fa382c6f40c7409a08b4
Relax unaligned access assertion when type is byte aligned

Summary:
This relaxes an assertion inside SelectionDAGBuilder which is overly
restrictive on targets which have no concept of alignment (such as AVR).

In these architectures, all types are aligned to 8-bits.

After this, LLVM will only assert that accesses are aligned on targets
which actually require alignment.

This patch follows from a discussion on llvm-dev a few months ago
http://llvm.1065342.n5.nabble.com/llvm-dev-Unaligned-atomic-load-store-td112815.html

Reviewers: bogner, nemanjai, joerg, efriedma

Reviewed By: efriedma

Subscribers: efriedma, cactus, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320243 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/TargetLowering.h
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/AVR/AVRISelLowering.cpp
test/CodeGen/AVR/unaligned-atomic-loads.ll [new file with mode: 0644]