PPC: Allocate RS spill slot for unaligned i64 load/store
authorHal Finkel <hfinkel@anl.gov>
Tue, 9 Jul 2013 06:34:51 +0000 (06:34 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 9 Jul 2013 06:34:51 +0000 (06:34 +0000)
commitfa55969acb64da32acf6305064c9f6e3c237b74e
treeb06e4d05cba06724da68014998076e2aaa982fae
parentbe6b9101d412711b69f6cfc1068efdf0ba7eb586
PPC: Allocate RS spill slot for unaligned i64 load/store

This fixes another bug found by llvm-stress!

If we happen to be doing an i64 load or store into a stack slot that has less
than a 4-byte alignment, then the frame-index elimination may need to use an
indexed load or store instruction (because the offset may not be a multiple of
4, a requirement of the STD/LD instructions). The extra register needed to hold
the offset comes from the register scavenger, and it is possible that the
scavenger will need to use an emergency spill slot. As a result, we need to
make sure that a spill slot is allocated when doing an i64 load/store into a
less-than-4-byte-aligned stack slot.

Because test cases for things like this tend to be fairly fragile, I've
concatenated a few small bugpoint-reduced test cases together to form the
regression test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185907 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/std-unal-fi.ll [new file with mode: 0644]