summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorKevin Qin <Kevin.Qin@arm.com>2014-05-06 09:48:52 +0000
committerKevin Qin <Kevin.Qin@arm.com>2014-05-06 09:48:52 +0000
commit1353c3405dfad371a87144edbff2abe38ae24e07 (patch)
tree87333272146c18ff3149d3637609a3ca82cb53cf /llvm
parent1b5fd3e52a6a42e007dbd16f6c37f1ce3e1f1f30 (diff)
downloadbcm5719-llvm-1353c3405dfad371a87144edbff2abe38ae24e07.tar.gz
bcm5719-llvm-1353c3405dfad371a87144edbff2abe38ae24e07.zip
[ARM64] Enable alignment control option in front-end for ARM64.
This is the modification in llvm part. llvm-svn: 208074
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/ARM64/ARM64ISelLowering.cpp19
-rw-r--r--llvm/test/CodeGen/ARM64/strict-align.ll1
2 files changed, 16 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp b/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp
index f95308b5c47..7de9d079ed2 100644
--- a/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp
+++ b/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp
@@ -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);
diff --git a/llvm/test/CodeGen/ARM64/strict-align.ll b/llvm/test/CodeGen/ARM64/strict-align.ll
index 2fbe47ce568..48a1528b5cd 100644
--- a/llvm/test/CodeGen/ARM64/strict-align.ll
+++ b/llvm/test/CodeGen/ARM64/strict-align.ll
@@ -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 {
OpenPOWER on IntegriCloud