summaryrefslogtreecommitdiff
path: root/lib/Target/XCore/XCoreISelLowering.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-10-28 17:55:38 +0000
committerDan Gohman <gohman@apple.com>2011-10-28 17:55:38 +0000
commitbf923b815d6da97367e3eedab69230918bf128a3 (patch)
tree6fb86a463862e9d74f54447c8c14c67648832c2a /lib/Target/XCore/XCoreISelLowering.cpp
parent82418ff4d1156dfd30d89a4874a365509a0798de (diff)
downloadllvm-bf923b815d6da97367e3eedab69230918bf128a3.tar.gz
llvm-bf923b815d6da97367e3eedab69230918bf128a3.tar.bz2
llvm-bf923b815d6da97367e3eedab69230918bf128a3.tar.xz
Reapply r143177 and r143179 (reverting r143188), with scheduler
fixes: Use a separate register, instead of SP, as the calling-convention resource, to avoid spurious conflicts with actual uses of SP. Also, fix unscheduling of calling sequences, which can be triggered by pseudo-two-address dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143206 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore/XCoreISelLowering.cpp')
-rw-r--r--lib/Target/XCore/XCoreISelLowering.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/XCore/XCoreISelLowering.cpp b/lib/Target/XCore/XCoreISelLowering.cpp
index 2afe0e35af..4b74f96047 100644
--- a/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/lib/Target/XCore/XCoreISelLowering.cpp
@@ -386,6 +386,15 @@ IsWordAlignedBasePlusConstantOffset(SDValue Addr, SDValue &AlignedBase,
Offset = off;
return true;
}
+ // Check for an aligned global variable.
+ if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(*Root)) {
+ const GlobalValue *GV = GA->getGlobal();
+ if (GA->getOffset() == 0 && GV->getAlignment() >= 4) {
+ AlignedBase = Base;
+ Offset = off;
+ return true;
+ }
+ }
return false;
}