diff options
author | Richard Osborne <richard@xmos.com> | 2009-01-15 11:32:30 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2009-01-15 11:32:30 +0000 |
commit | f6eefe6dfc6d32806434fc4758571ca3c23a17c7 (patch) | |
tree | 8da2ad631d62d1aaeffd8bf818c2c1bfb2f6e3bd /lib/Target/XCore/XCoreISelDAGToDAG.cpp | |
parent | 798d7c134e4d744c98787d645658d8f50241dca9 (diff) | |
download | external_llvm-f6eefe6dfc6d32806434fc4758571ca3c23a17c7.zip external_llvm-f6eefe6dfc6d32806434fc4758571ca3c23a17c7.tar.gz external_llvm-f6eefe6dfc6d32806434fc4758571ca3c23a17c7.tar.bz2 |
Don't fold address calculations which use negative offsets into
the ADDRspii addressing mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62258 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore/XCoreISelDAGToDAG.cpp')
-rw-r--r-- | lib/Target/XCore/XCoreISelDAGToDAG.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/XCore/XCoreISelDAGToDAG.cpp b/lib/Target/XCore/XCoreISelDAGToDAG.cpp index 28b501d..684ef0b 100644 --- a/lib/Target/XCore/XCoreISelDAGToDAG.cpp +++ b/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; |