Ulrich Weigand edb27188b4 [PowerPC] Fix invalid displacement created by LocalStackAlloc
This commit fixes a bug in PPCRegisterInfo::isFrameOffsetLegal that
could result in the LocalStackAlloc pass creating an MI instruction
out-of-range displacement:
        %vreg17<def> = LD 33184, %vreg31; mem:LD8[%g](align=32)
        %G8RC:%vreg17 G8RC_and_G8RC_NOX0:%vreg31
(In final assembler output the top bits are stripped off, resulting
in a negative offset loading from below the stack pointer.)

Common code expects the isFrameOffsetLegal routine to verify whether
adding a given offset to the offset already present in the instruction
results in a valid displacement.  However, on PowerPC the routine
did not take the already present instruction offset into account.

This commit fixes isFrameOffsetLegal to add the instruction offset,
and updates a local caller (needsFrameBaseReg) to no longer add the
instruction offset itself before calling isFrameOffsetLegal.

Reviewed by Hal Finkel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212832 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-11 17:19:31 +00:00
..
2014-04-12 01:26:00 +00:00
2013-03-27 06:52:27 +00:00
2013-07-03 17:59:07 +00:00
2013-08-19 05:01:02 +00:00
2013-04-05 23:29:01 +00:00
2012-12-20 17:47:27 +00:00
2013-08-06 17:03:03 +00:00
2013-04-01 15:58:15 +00:00
2012-08-28 02:10:15 +00:00
2011-05-02 15:58:16 +00:00
2012-08-28 02:10:33 +00:00
2010-11-14 22:22:14 +00:00
2013-04-27 00:43:16 +00:00
2013-12-20 18:08:54 +00:00
2010-11-14 22:22:14 +00:00
2014-06-19 19:41:26 +00:00
2012-12-19 15:49:14 +00:00