[mips] Fix unsigned/signed type error
authorSimon Dardis <simon.dardis@imgtec.com>
Wed, 16 Nov 2016 11:29:07 +0000 (11:29 +0000)
committerSimon Dardis <simon.dardis@imgtec.com>
Wed, 16 Nov 2016 11:29:07 +0000 (11:29 +0000)
commit8ca1cbccc67ff348085c70a3d213c0da2428c8d1
tree583ab7df93f96531ba82616ec9eb41d918f492d8
parent06e1592663fe9dc9da5e754b54bd74d1823f766c
[mips] Fix unsigned/signed type error

MipsFastISel uses a a class to represent addresses with a signed member
to represent the offset. MipsFastISel::emitStore, emitLoad and computeAddress
all treated the offset as being positive. In cases where the offset was
actually negative and a frame pointer was used, this would cause the constant
synthesis routine to crash as it would generate an unexpected instruction
sequence when frame indexes are replaced.

Reviewers: vkalintiris

Differential Revision: https://reviews.llvm.org/D26192

llvm-svn: 287099
llvm/lib/Target/Mips/MipsFastISel.cpp
llvm/test/CodeGen/Mips/Fast-ISel/stackloadstore.ll [new file with mode: 0644]