Encode alignment in MO_Memcpy and friends
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 16 Jun 2015 18:16:08 +0000 (20:16 +0200)
committerBen Gamari <ben@smart-cactus.org>
Tue, 16 Jun 2015 18:16:08 +0000 (20:16 +0200)
commit681973c31c614185229bdae4f6b7ab4f6e64753d
tree9ef8257217c05f4a05828a04e24199f42e0e2fe0
parentd20031d4c88b256cdae264cb05d9d850e973d956
Encode alignment in MO_Memcpy and friends

Summary:
Alignment needs to be a compile-time constant. Previously the code
generators had to jump through hoops to ensure this was the case as the
alignment was passed as a CmmExpr in the arguments list. Now we take
care of this up front.

This fixes #8131.

Authored-by: Reid Barton <rwbarton@gmail.com>
Dusted-off-by: Ben Gamari <ben@smart-cactus.org>
Tests for T8131

Test Plan: Validate

Reviewers: rwbarton, austin

Reviewed By: rwbarton, austin

Subscribers: bgamari, carter, thomie

Differential Revision: https://phabricator.haskell.org/D624

GHC Trac Issues: #8131
17 files changed:
compiler/cmm/CmmMachOp.hs
compiler/cmm/CmmParse.y
compiler/cmm/PprC.hs
compiler/codeGen/StgCmmPrim.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/nativeGen/PPC/CodeGen.hs
compiler/nativeGen/SPARC/CodeGen.hs
compiler/nativeGen/X86/CodeGen.hs
includes/Cmm.h
rts/PrimOps.cmm
testsuite/tests/codeGen/should_fail/Makefile [new file with mode: 0644]
testsuite/tests/codeGen/should_fail/T8131.cmm [new file with mode: 0644]
testsuite/tests/codeGen/should_fail/all.T [new file with mode: 0644]
testsuite/tests/codeGen/should_gen_asm/memcpy-unroll-conprop.cmm
testsuite/tests/codeGen/should_run/cgrun069_cmm.cmm
testsuite/tests/llvm/should_compile/T8131b.hs [new file with mode: 0644]
testsuite/tests/llvm/should_compile/all.T