svn commit: r314168 - in vendor/llvm/dist: lib/Target/ARM test/CodeGen/ARM
Dimitry Andric
dim at FreeBSD.org
Thu Feb 23 19:13:50 UTC 2017
Author: dim
Date: Thu Feb 23 19:13:48 2017
New Revision: 314168
URL: https://svnweb.freebsd.org/changeset/base/314168
Log:
Vendor import of llvm release_40 branch r296002:
https://llvm.org/svn/llvm-project/llvm/branches/release_40@296002
Added:
vendor/llvm/dist/test/CodeGen/ARM/alias_store.ll
Modified:
vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp
Modified: vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp
==============================================================================
--- vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp Thu Feb 23 19:02:40 2017 (r314167)
+++ vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp Thu Feb 23 19:13:48 2017 (r314168)
@@ -3027,17 +3027,20 @@ static SDValue promoteToConstantPool(con
return DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr);
}
+static bool isReadOnly(const GlobalValue *GV) {
+ if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
+ GV = GA->getBaseObject();
+ return (isa<GlobalVariable>(GV) && cast<GlobalVariable>(GV)->isConstant()) ||
+ isa<Function>(GV);
+}
+
SDValue ARMTargetLowering::LowerGlobalAddressELF(SDValue Op,
SelectionDAG &DAG) const {
EVT PtrVT = getPointerTy(DAG.getDataLayout());
SDLoc dl(Op);
const GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
const TargetMachine &TM = getTargetMachine();
- if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
- GV = GA->getBaseObject();
- bool IsRO =
- (isa<GlobalVariable>(GV) && cast<GlobalVariable>(GV)->isConstant()) ||
- isa<Function>(GV);
+ bool IsRO = isReadOnly(GV);
// promoteToConstantPool only if not generating XO text section
if (TM.shouldAssumeDSOLocal(*GV->getParent(), GV) && !Subtarget->genExecuteOnly())
Added: vendor/llvm/dist/test/CodeGen/ARM/alias_store.ll
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/llvm/dist/test/CodeGen/ARM/alias_store.ll Thu Feb 23 19:13:48 2017 (r314168)
@@ -0,0 +1,16 @@
+; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s
+
+ at X = constant {i8, i8 } { i8 0, i8 0 }
+ at XA = alias i8, getelementptr inbounds ({ i8, i8 }, {i8, i8}* @X, i32 0, i32 1)
+
+define void @f(i8** %p) align 2 {
+entry:
+ store i8* @XA, i8 **%p, align 4
+ ret void
+}
+
+; CHECK: f:
+; CHECK: ldr r{{.*}}, [[L:.*]]
+; CHECK: [[L]]:
+; CHECK-NEXT: .long XA
+; CHECK: XA = X+1
More information about the svn-src-vendor
mailing list