summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorRichard Osborne <richard@xmos.com>2009-01-15 11:32:30 +0000
committerRichard Osborne <richard@xmos.com>2009-01-15 11:32:30 +0000
commit40119780a8bd4c3846771a5b30ec231048053999 (patch)
tree2c1174e379717787b76cab1a451785ad29db1c27 /llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp
parent502b91a35cf61abcef292504c4db916c1abebd80 (diff)
downloadbcm5719-llvm-40119780a8bd4c3846771a5b30ec231048053999.tar.gz
bcm5719-llvm-40119780a8bd4c3846771a5b30ec231048053999.zip
Don't fold address calculations which use negative offsets into
the ADDRspii addressing mode. llvm-svn: 62258
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp b/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp
index 28b501de7dd..684ef0bf125 100644
--- a/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp
+++ b/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp
@@ -92,8 +92,8 @@ bool XCoreDAGToDAGISel::SelectADDRspii(SDValue Op, SDValue Addr,
ConstantSDNode *CN = 0;
if ((FIN = dyn_cast<FrameIndexSDNode>(Addr.getOperand(0)))
&& (CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1)))
- && (CN->getSExtValue() % 4 == 0)) {
- // Constant word offset from frame pointer
+ && (CN->getSExtValue() % 4 == 0 && CN->getSExtValue() >= 0)) {
+ // Constant positive word offset from frame index
Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
Offset = CurDAG->getTargetConstant(CN->getSExtValue(), MVT::i32);
return true;
OpenPOWER on IntegriCloud