1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[ARM64] Enable alignment control option in front-end for ARM64.

This is the modification in llvm part.

llvm-svn: 208074
This commit is contained in:
Kevin Qin 2014-05-06 09:48:52 +00:00
parent c0ea2917f5
commit 7464b14156
2 changed files with 16 additions and 4 deletions

View File

@ -45,9 +45,20 @@ EnableARM64TailCalls("arm64-tail-calls", cl::Hidden,
cl::desc("Generate ARM64 tail calls (TEMPORARY OPTION)."),
cl::init(true));
static cl::opt<bool>
StrictAlign("arm64-strict-align", cl::Hidden,
cl::desc("Disallow all unaligned memory accesses"));
enum AlignMode {
StrictAlign,
NoStrictAlign
};
static cl::opt<AlignMode>
Align(cl::desc("Load/store alignment support"),
cl::Hidden, cl::init(NoStrictAlign),
cl::values(
clEnumValN(StrictAlign, "arm64-strict-align",
"Disallow all unaligned memory accesses"),
clEnumValN(NoStrictAlign, "arm64-no-strict-align",
"Allow unaligned memory accesses"),
clEnumValEnd));
// Place holder until extr generation is tested fully.
static cl::opt<bool>
@ -370,7 +381,7 @@ ARM64TargetLowering::ARM64TargetLowering(ARM64TargetMachine &TM)
setMinFunctionAlignment(2);
RequireStrictAlign = StrictAlign;
RequireStrictAlign = (Align == StrictAlign);
setHasExtractBitsInsn(true);

View File

@ -1,4 +1,5 @@
; RUN: llc < %s -mtriple=arm64-apple-darwin | FileCheck %s
; RUN: llc < %s -mtriple=arm64-apple-darwin -arm64-no-strict-align | FileCheck %s
; RUN: llc < %s -mtriple=arm64-apple-darwin -arm64-strict-align | FileCheck %s --check-prefix=CHECK-STRICT
define i32 @f0(i32* nocapture %p) nounwind {